This little project makes an ATtiny tell you when it is dark or bright. This is a great introduction into the capabilities of the ATtiny85 chip.

You can also see these instructions on my website www.PeterFoxFlick.com

Step 1: Parts

  • Solderless Breadboard
  • ATtiny 85
  • Red Led
  • Green Led
  • 2 330 ohm Resistors
  • 10k ohm Resistor
  • Photocell
  • Jumper Wires


  • Arduino
  • ATtiny Programer

Step 2: Build the Photocell Circuit

Build the photocell circuit. Connect one leg of the photocell to 5v. Connect the other leg to the digital 2 pin on the Arduino Uno and the 10k resistor. Connect the unused leg of the resistor to ground.

Step 3: Serial Communication

Use the Arduino Uno and serial communication to read the level of light coming from your photocell. You will need to upload the code at the bottom of the page and then click on the Serial Monitor button (top right). Record a number that seems to be a good cut off for when you want your ATtiny to say its dark.

Step 4: Upload Code to ATtiny

Upload this code to the ATtiny85. If you need help on how to do this follow this tutorial. Feel free to change the threshold to whatever number you decided on in STEP 2. I picked 600 because it worked where I was at the time of programing.

Step 5: Build the Circuit

Build the circuit for the ATtiny85 chip. Follow the images or the schematic in the program.

<p>I loved this project and edited it for my fabric night lights!</p><p>https://medium.com/@volkerwandering/i-love-combining-electronics-and-embroidery-76632a6a0864</p>
<p>Nice little project! Thanks for sharing!</p>

About This Instructable



Bio: I'm an eagle scout from Colorado. I like to program, Arduino (if thats a verb) and make cool things. I also like to hike ... More »
More by peterfoxflick:ATtiny Flower Pot Programing an Attiny with Arduino IDE ATtiny Dark Detector 
Add instructable to: