Hello all,
I've got some basic electronics experience and this is my first project using ICs. I'm posting here in the Arduino forum because I'm using an Arduino Uno to program an ATtiny85 to make this work.
Background on my project: I'm an ex-smoker and have been "vaping" (e-cigs) instead; it really helps, I haven't had an analog cig in 6 months - cold turkey!). Sorry for the digression. I'm trying to make my own e-cig with a little "bling" by adding/requiring a few "features":
- I want a Full Color LED to illuminate when I press the button and would like to change the color based on the battery voltage remaining in the battery (an IMR 18650). By this, I want the LED to illuminate Green when the battery is full-ish: from 4.2v down to about 3.7v; Yellow between 3.7v and 3.4v; and Red from 3.4v to 3.2v.
- Once the battery falls below 3.2v, I want to flash the LED (red) for a few seconds and prevent the atomizer from firing so the battery doesn't fall below the minimum voltage and damage the battery.
- Power the circuit using the battery itself.
- Run it via an ATtiny85 so it's small and can fit into a box about the same size as an Altoids tin along with an IMR 18650 battery and all wiring.
I've got the first two goals finished in an Arduino sketch (sans debugging/testing - attached to the post), but I'm skeptical that I have a correct hardware design, and... putting that hardware together using an ATtiny85. My questions are:
- Does this schematic look like it would work as I expect it to? I'm using the N-channel mosfet to either allow or prevent the voltage flowing to the atomizer connector (510 connector).
- Should I add some sort of overload protection so when the button is released the circuit won't get damaged or fried? If so, suggestions on how or what to put in place.
Finally, any suggestions or obvious missing components are more than welcome!
Cheers!
Randy
BatteryLife.ino (1.36 KB)