Introduction: ATtiny Dark Detector

This little project makes an ATtiny tell you when it is dark or bright. This project is an excellent introduction to 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

Tools

  • 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 other 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 it is 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 programming.

Step 5: Build the Circuit

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

Comments

author
JessicaN21 made it! (author)2017-04-08

I loved this project and edited it for my fabric night lights!

https://medium.com/@volkerwandering/i-love-combining-electronics-and-embroidery-76632a6a0864

20170402_143055.jpg20170402_143136.jpg
author
MsSweetSatisfaction (author)2014-08-16

Nice little project! Thanks for sharing!

author
KyleTheCreator (author)2014-08-15

Cool!

About This Instructable

2,407views

32favorites

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 PotPrograming an Attiny With Arduino IDEATtiny Dark Detector
Add instructable to: