Author Topic: LED logic sequence circuit question  (Read 576 times)

0 Members and 1 Guest are viewing this topic.

Offline mpTopic starter

  • Newbie
  • Posts: 4
  • Country: gb
LED logic sequence circuit question
« on: June 07, 2019, 05:25:14 pm »
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.

 

Offline mariush

  • Super Contributor
  • ***
  • Posts: 5170
  • Country: ro
  • .
Re: LED logic sequence circuit question
« Reply #1 on: June 07, 2019, 11:09:27 pm »
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.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf