Keeping an LED on after the power has gone.

Thread Starter

C01000110010011110101100

Joined Jan 19, 2020
10
I am trying to find a way to keep an LED permanently on after a momentary switch has been used to operate a solenoid. This switch will only switch on the solenoid for a short time, 100 to a few thousand milliseconds and may be switched on several times in quick succession or over several hours. I need an LED to be powered as soon as the solenoid is first triggered, then perhaps stay on for 12 hours or so.

I'm a total novice regarding electronics so I apologize if my question is stupidly simple. I'm sure there is a very easy solution to this, maybe even a small circuit board for sale somewhere, I just can't find one.

This is a diagram of my pathetically simple circuit, I did have transformers and relays in the big blank area but I removed them as I couldn't get the diagram to show a power supply to an LED whilst not powering the solenoid, if the solenoid could stay on this would be easy for me to work out, but I don't want to burn out the solenoid, or waste electric... Any ideas are greatly appreciated.LEDS.gif
 

djsfantasi

Joined Apr 11, 2010
7,700
When do you want the LED to turn off?

There are several problems. One is converting 240VAC to low voltage DC (like 5-6V). To run the LED. You could use a transformer to reduce the voltage, a bridge rectifier to convert AC to DC and a linear regulator or a switching power supply. Or a pre-built power adapter. You could use this power adapter

Then, how does the LED stay on with only a momentary pulse. One way is to use a toggle circuit. You could build one with 240V relays. Or use the low voltage to power a toggle flip flop circuit, like using a CD4013 IC. or again, use a pre-built module. Like this. I’m not sure about this one, but link to it as an example.

And now we’re back to my original question. When do you want the LED to turn off?
 

Thread Starter

C01000110010011110101100

Joined Jan 19, 2020
10
I could turn the whole thing off at the mains socket each day, but it would be good if I could use a 555 timer circuit to keep the LED lit for 12 hours, long enough for me to find if the solenoid was triggered during the night.
 

Thread Starter

C01000110010011110101100

Joined Jan 19, 2020
10
The flip-flop board looks good, just knowing there is such a thing will help. Will this sort of circuit default to it's flip or flop state when the power is reset, powered down for a short while, and would I need a transformer running all of the time?
 

MisterBill2

Joined Jan 23, 2018
8,809
Given that the intent is for the LED to stay lighted until being manually switched off, a latching relay, or perhaps a bi-stable relay, makes sense. Apparently the system is mains powered and so power draw is not a challenge.
Another question is about sequential operations. If the goal is to know if and how many times the solenoid was operated, another option would be a standard counter device, either mechanical or electronic. A resettable counter would avoid needing to keep track of the previous count value. I created such a system for a co-worker many years ago to konow if his kids were using his computer. It was an XT, which reveals how long ago that was.
 

vu2nan

Joined Sep 11, 2014
169
Thanks, Bertus! I'm sorry, I noticed the error and deleted the post and then found that you have replied. I'll make the correction and post it again.

Nandu.
 

Thread Starter

C01000110010011110101100

Joined Jan 19, 2020
10
This project is for a humane rat trap, this morning I found a blackbird trapped inside, (no worries though, it forms part of my large aviary and the trap part is 3x2x6 feet), the bird went through a 6 inch square mesh flap at the bottom and used the trip wire which closes the flap, he was very happy to leave with a full belly but I don't know how long he was in there, hence needing an LED to stay lit so I can see it from a distance.

I don't need to know how many times the solenoid has been triggered, just that it has so that I am aware something is inside. The time period isn't important, I can easily do without it as long as I can reset the circuit with the press of a button, or by unplugging the whole thing from the mains.

I have come up with this plan using some sort of 12v circuit board showing power on LED and a triggered LED. It looks like it will work, can anyone confirm this before I make it and maybe suggest an appropriate LED latching circuit board for less than $10.
LEDS-2.gif
 

Tonyr1084

Joined Sep 24, 2015
6,000
If I'm to understand your trap and signal; you want to trap an animal and have an indication when the trap has been sprung. Far more simple would be to build your trap and add a microswitch to the trap door. If the door is not fully open then the LED is switched on and stays on until you reset the trap. The trap can be whatever power source you want and the LED can (should) be low voltage.
 

Thread Starter

C01000110010011110101100

Joined Jan 19, 2020
10
Thanks Tonyr1084, I built a great humane rat trap using a trap door and container box, the rats would go on the trap door to eat but would never go close to the switch so never got trapped, it's as if they can sense electric current, so I built this one with all the electrics 6 foot high, the trip wires are string hanging down and across the food, it works great. Maybe the rats would not notice low voltage wires at the entrance, but they might chew them up, they chewed through feather boards and killed/ate all of our quails :{

It's certainly a nice easy answer, I could even use a 5v door switch to fire up a bright light via a relay, food for thought, thanks.
 
You can do it easily with a dual coil latching relay. e.g. https://www.digikey.com/en/products/detail/panasonic-electric-works/TQ2SA-L2-24V-Z/649391 Common voltages are, of course, 5, 12 and 24 DC (these have to be DC).

Not saying that this https://www.wago.com/us/relays-optocouplers/latching-relay-module/p/286-573 is the right one, but they make DIN rail relays which are easy to wire.

Industrial stuff primarily uses 24 VDC. A form C contact is an SPDT contact.

You might want to re-think your solenoid power.

A dual coil latching relay has 2 coils called set and reset. They are both polarity sensitive to work as labeled. Reversing polarity on the set contact, fo instance, makes it a reset input. A magnet holds the relay in position independent of power, The DC pulse gives it a "little kick". The "pulse" can be continuous, but it will be stuck in that position.

Just taking the switch and LED combo. A momentary switch would activate the set coil. That would activate an LED and reset with another momentary PB and the LED would be driven by the relay contact.

So, "almost".

Depending on your switch and it could be anything even an optocoupler or microswitch. Have that switch activate a DPDT relay which in turn activates the SET coil and the solenoid (assuming different voltages). This would assume that your switch pulses which it probably doesn't.

Selec and probably Geya make some cheap timer modules. They would need to generate a pulse for your solenoid.
You would have to check current ratings of the module, so you might need a more approprate relay to activate the solenoid.,

It's now a case of reliability, size and getting the parts to work out.
 

Tonyr1084

Joined Sep 24, 2015
6,000
Since you have the mechanism already designed, built and tested to satisfaction the drawing attached will show how I perceive a door switch to light the LED. As for rats sensing high voltages - that may be. 240VAC is more voltage than I'm accustom to dealing with. Anyway, I use a 240 to 5 volt transformer and a bridge rectifier. You can use a single diode as well, a bridge is not required. There's a filter cap to smooth out the voltage, giving you 7VDC (5V x 1.414). The resistor is one I have in stock so it's not highly common but certainly available. Using a 180Ω resistor and accounting for the forward voltage of the LED, current should be about 22 milli amps.

When the door is fully open the microswitch (NC) contact is open, thus, the LED is NOT lit. When the trap is sprung the (NC) contact closes and switches the LED on. It will stay on until you reset the trap. The circuit is a simple "Door Open" light.

1605631922186.png
 

Audioguru again

Joined Oct 21, 2019
3,208
I have never seen a rat. In my neighborhood there are many squirrels, some racoons and foxes, coyotes and occasionally a deer.
Pest control companies remove racoons that have broken into a home and the rest of the animals are running loose all over the place.
 
Top