Maker Pro
Maker Pro

LDR/BC550 as switch - Darkness threshold.

steenamaroo

Apr 11, 2022
9
Joined
Apr 11, 2022
Messages
9
Hello all,
New member here, hoping someone might be able to help me with a 'simple' 5V LDR switch circuit.
I want the circuit to be able to toggle a 5VDC relay coil which measures approx 50ohm.

I've set up a 5k pot, LDR, and BC550 as a basic switch and that works well but the issue is that this isn't a dark sensor, it's a slightly-less-bright sensor.
The switching threshold is too bright for my application as I want something to switch after dusk/before dawn.

The LDR that I had was reading around 1.5meg at the kind of darkness I'd like to have as a threshold, but I have ordered some LDRs which max out at around 200k thinking that might help.
That means I don't have an exact value, for now, but the desired LDR threshold resistance will be somewhere close to, but less than, 200k ohm.

Presumably there'll be greater consumption when the relay is held open so, ideally, I'd like the circuit to do that during lower LDR resistance - I.E. during the day. (I'll be solar charging)

I've read a few relevant threads on these forums, looking at darlington suggestions, but I don't fully understand them, if I'm honest.

I'd like to keep it as simple, and as low consumption, as possible.
If it's helpful at all, I do have iCircuit for basic simulations.

Grateful to anyone who may be able to help!
 

Alec_t

Jul 7, 2015
3,650
Joined
Jul 7, 2015
Messages
3,650
Welcome to EP!
as low consumption, as possible
A 50 Ohm relay isn't going to be 'low consumption' if energised for a long period.
Have you considered using a latching relay? That requires a brief current pulse to switch it 'on' and a second brief current pulse (which might need to be of opposite polarity to the first one) to switch it 'off'.
As for a well-defined light/dark threshold, a 'comparator with hysteresis' would provide that.
I suggest you do a search for 'chicken coop door circuits'.
 

steenamaroo

Apr 11, 2022
9
Joined
Apr 11, 2022
Messages
9
Thank you for the reply!
I'm not against using a latching relay although it seemed like perhaps the triggering circuit for that might be much more complicated?
I'm googling comparator with hysteresis and really wouldn't know where to start.
 

steenamaroo

Apr 11, 2022
9
Joined
Apr 11, 2022
Messages
9
Thank you for that @Bluejets
I had seen that and it would have been perfect, but the output is rated 15mA max, which my relay coil would exceed.
 

Alec_t

Jul 7, 2015
3,650
Joined
Jul 7, 2015
Messages
3,650
What load will your relay switch? (You might not need a relay).
 

steenamaroo

Apr 11, 2022
9
Joined
Apr 11, 2022
Messages
9
It is a door opener/closer, with 12V motor and DPDT relay wired for polarity switch when coil is high/low.
If the sensor that Bluejets linked is sensitive to change at much lower light levels, I think that, plus a transistor for greater current capability, should work. :)
 

Bluejets

Oct 5, 2014
7,059
Joined
Oct 5, 2014
Messages
7,059
Mosfet might be easier if the current requirements are around 1A or so.
 

steenamaroo

Apr 11, 2022
9
Joined
Apr 11, 2022
Messages
9
The ebay item you suggested would be used with a transistor to power relay coil - That's more like 100mA.
Think I'm sorted, folks. Thank you.
I'll update here either way.
 

Bluejets

Oct 5, 2014
7,059
Joined
Oct 5, 2014
Messages
7,059
In most cases, the mosfet I quoted would eliminate the need for the relay....just saying.
 

steenamaroo

Apr 11, 2022
9
Joined
Apr 11, 2022
Messages
9
I don't follow.
The motor is 12V and the DPDT relay is there to allow me to reverse polarity.
 

Alec_t

Jul 7, 2015
3,650
Joined
Jul 7, 2015
Messages
3,650
It is a door opener/closer
For animal or human building? Regardless, there will be safety issues to consider, to prevent damage/overload if the door is obstructed.
How will your system cope with unwanted activation due to e.g clouds passing, insect on sensor, etc?
Does your opener/closer include internal limit switches?
 

steenamaroo

Apr 11, 2022
9
Joined
Apr 11, 2022
Messages
9
Chicken coop^.
Yeah, it's got physical limit switches.
I'm not too concerned about there being no obstruction detection as it's a sideways sliding door, moved in and out by turning a long threaded bar. Door's going to move at something like 1cm per second for that reason.

I'm hopeful false positives wont be a big deal as I'm not reacting to direct sunlight - rather after sunset/before sunrise, but I'm making this for my Brother and did explain it could be an issue.
It's a short term solution as the area where the coop is will most likely have mains power within a year.
At that point there'll be a Rpi + web-interface to control garden lighting, so the coop's going to be controlled by that, based on sunrise/sunset API calls.

If the short term solution means he doesn't have to get up at 3/4 am through the coming summer, he'll be happy enough. :D
 

Bluejets

Oct 5, 2014
7,059
Joined
Oct 5, 2014
Messages
7,059
Wile E Coyote used to use a couple of pulleys and a piece of rope from Acme.:D:D
 
Top