I'm building a motion activated nightlight. I got it working on a breadboard with an arduino board, but will be programming an ATTINY85 chip to use with it instead of the Arduino (http://hlt.media.mit.edu/?p=1695)
My original post with schematics in case anyone is wanting to build something similar is at Motion & Light Activated Night-light (lights up if it's dark & there is motion) - #3 by system - Project Guidance - Arduino Forum
(I haven't yet decided on what kind of enclosure I will use yet.)
Anyway, I'm at the point of needing to figure out battery power. I am hoping to use something small like a CR2032 battery (http://search.digikey.com/us/en/products/CR2032/N189-ND/704858)
This is listed as 3v , I'm not sure if that will be good enough or even if it powers everything how long this battery will last.
These are parts I will be using:
- ATTINY85 - http://search.digikey.com/us/en/products/ATTINY85-20PU/ATTINY85-20PU-ND/735469
- 5mm LED w/ 100 Ohm resistor (I may decide to use 2-3 LED's instead, not sure yet)
- Photoresistor - VT935G-B https://www.parallax.com/desktopmodules/catalookstore/ProductDetails.aspx?ProductID=175
- 18k Ohm resistor for Photoresistor
- PIR Sensor (Rev B) https://www.parallax.com/desktopmodules/catalookstore/ProductDetails.aspx?ProductID=83
Will a CR2032 battery be enough to power this (for at least a couple of months?) or should I consider a 9V battery?
If I use a 3v CR2032 battery, do I need a resistor of some kind (to the ATTINY85 chip)? The chip is rated as below so I believe I will be ok, and the PIR and Photosensor already have resistors (but this setup is currently working on 5v from the Arduino...)
The ATTINY85 is rated as:
Voltage - Supply (Vcc/Vdd): 2.7 V ~ 5.5 V
If I use a 9v battery I'm sure I will need something to bring down the voltage, I'm just trying to grasp OHMs law, based on my notes I have these forumulas:
Voltage: V = IR
Current: I = V/R
Resistance: R = V/I
PowerP = VI or P = V2/R or P = I2R
But I'm not sure if V = 9 (for 9v battery), or if V = 5 (say, if I wanted to replicate the 5v my Arduino is providing now)
Once I confirm what I should set "V" to in the formulas, I need to find resistance, but not sure what the current is on a 9V battery?
Any advice or guidance on this would be much appreciated.
Thanks