Tilt Switch and Transistor without Microcontroller
Posted: Sat Aug 18, 2018 5:57 pm
Hello, I am at a beginner level with circuits and have a basic question I'm having trouble finding an answer to related to a project I'm working on.
I'm making a very small sculptural object that is basically a Lightbox that I want to turn on when tilted in one direction. Right now I have an ATTINY85 powered by a 3v cell battery. The ATTINY powers a tilt sensor/switch from one pin and takes a reading from another pin. A third pin is connected to an NPN transistor. The transistor switches a 9V circuit with 16 LEDs in series/parallel (led -> led -> 150 ohm resistor). Currently this all works correctly. However, the project area is very small and I'd like to reduce the space required by components.
I'm wondering if the ATTINY is actually necessary or if I could achieve the same result with something like a voltage divider. I've watched and read a number of tutorials on transistors, circuits in general, and resistors as voltage dividers, but can't seem to figure it out. I've read that voltage dividers should not be used to power a load, but what I'm not sure is whether this particular configuration would cause a problem. Two photo links below show the current setup with the ATTINY and a potential new version. Any feedback/suggestions for how to safely and reliably remove the micro controller form the equation would be very much appreciated.
Components in V1:
3v cell battery
ATTINY 85
NPN 2N2222 A transistor
Base resistor 3.3k ohm
tilt sensor/switch (https://www.amazon.com/gp/product/B00R2 ... UTF8&psc=1)
resistor on tilt sensor/switch 10k ohm
16 LEDs 20 mA 3.3v, total 160mA
9v (3 x 3v cell batteries in series)
Sketches of circuits:
https://www.flickr.com/photos/156061440 ... ed-public/
https://www.flickr.com/photos/156061440 ... ed-public/
I'm making a very small sculptural object that is basically a Lightbox that I want to turn on when tilted in one direction. Right now I have an ATTINY85 powered by a 3v cell battery. The ATTINY powers a tilt sensor/switch from one pin and takes a reading from another pin. A third pin is connected to an NPN transistor. The transistor switches a 9V circuit with 16 LEDs in series/parallel (led -> led -> 150 ohm resistor). Currently this all works correctly. However, the project area is very small and I'd like to reduce the space required by components.
I'm wondering if the ATTINY is actually necessary or if I could achieve the same result with something like a voltage divider. I've watched and read a number of tutorials on transistors, circuits in general, and resistors as voltage dividers, but can't seem to figure it out. I've read that voltage dividers should not be used to power a load, but what I'm not sure is whether this particular configuration would cause a problem. Two photo links below show the current setup with the ATTINY and a potential new version. Any feedback/suggestions for how to safely and reliably remove the micro controller form the equation would be very much appreciated.
Components in V1:
3v cell battery
ATTINY 85
NPN 2N2222 A transistor
Base resistor 3.3k ohm
tilt sensor/switch (https://www.amazon.com/gp/product/B00R2 ... UTF8&psc=1)
resistor on tilt sensor/switch 10k ohm
16 LEDs 20 mA 3.3v, total 160mA
9v (3 x 3v cell batteries in series)
Sketches of circuits:
https://www.flickr.com/photos/156061440 ... ed-public/
https://www.flickr.com/photos/156061440 ... ed-public/