| Electronics > Projects, Designs, and Technical Stuff |
| LED logic sequence circuit question |
| (1/1) |
| mp:
I would like to build an electronic circuit that would consist of a magnetic contact switch on a window, wired to a compact sized, low battery drain electronic circuit to control an LED and a relay switch (or similar) to connect a high voltage light, following this logic sequence: Window closed LED off & relay switch open circuit -> Window opened LED immediately turns on & relay switches to closed circuit -> Window closed LED remains on & relay returns to open circuit -> Window opened LED remains on & relay switches to closed circuit -> Window closed LED turns off & relay returns to open circuit -> Cycle repeats... Hopefully low current draining components are available and components that allow the logic sequence to be easily reconfigured in a different way. Also, a push button sequence reset function would be good. |
| mariush:
Any Arduino or PIC microcontroller can do what you want, and can run on a 4 rechargeable AA batteries (4x1.3v max = 5.2v) for months. Technically, they could run on a 3v CR2032 battery but the relay needs a lot of current to switch states so a single coin cell battery would not do. Configured at 1-4 Mhz, such a microcontroller will use mA worth of current, very little. You can use ADC or i2c or whatever to monitor the change in magnetic field at the window (when window opens, magnet on window moves away from sensor so the reading changes and the microcontroller reads that change and does the job) You can use a 5v bi-stable relay to do the job, and you can power it directly from batteries. You switch states by sending 5v through a relay pin for a few seconds Here's an example of 5v dual latching relay : https://www.digikey.com/product-detail/en/omron-electronics-inc-emc-div/G5RL-K1-E-DC5/Z4395-ND/4947136 Send 5v for more than 30ms and it switches on and then uses no power to remain on. Send 5v for more than 30ms on another pin and it resets. |
| Navigation |
| Message Index |