Automatic Hallway Light [Suggestions/Advice]

Thread Starter

Arausio

Joined Jun 18, 2015
41
Hello Experts. I need your help with the Automatic Hallway Light project I am ready to start building. At a first glance, (before I purchase parts) I would like to ask a few questions:

1. The way I understand the schematic, the X3-1, X3-2, X4-1, X4-2, X5-1, and X5-2 circles are points where I am supposed to be connecting the infrared devices? Please correct me if I am wrong.

2. If I build this circuit and place the receiver/transmitter in the hallway of width approximately 36”, my ceiling fixture lighting can be turned ON/OFF automatically. Please confirm.

3. IR_LED1 and IR_LED2 have ‘X’ as connection points. Why there is only one X4-1 red next to the IR_LED2 and one X4-2 black next to IR_LED1? Shouldn’t each ‘X’ point be marked?

4. How are we connecting the two unmarked ‘X’ points between IR_Q1 and IR_Q2?

Please see the attached pdf file of the Nuts and Volts magazine (December 2015) and the schematic of the subject circuit. Thank you all for your help.

Copyright protected magazine article removed by moderator..
 
Last edited by a moderator:

Thread Starter

Arausio

Joined Jun 18, 2015
41
Hi Eric,

Thanks for your reply. In terms of the IR_LED1 and IR_LED2. You are connecting the two together with the green and blue wires. Is that right?

Now, one question in terms of the capabilities I will have from this project:
Will the ceiling light in my corridor turn ON/OFF automatically as I walk across? Please correct me.
 

ericgibbs

Joined Jan 29, 2010
18,767
hi,
I would say the two IR emitters are in parallel [ obviously at different locations in the hallway ie: in/out]
The fact that they each have a series resistor suggests a parallel connection.
Added d/sclip
AA1 08-Dec-18 15.07.gif
ie: parallel.

The connection of the photo detectors, could be series or parallel, if the series connection does not give the required sensitivity , try them in parallel.

Do you have a datasheet for the emitters that you could post.?
E

EDIT:

Downloaded the d/s, the diodes in the parts list are op298, high current diodes
 
Last edited:

ericgibbs

Joined Jan 29, 2010
18,767
hi,
Ref the Light On/Off part, checking the circuit all it appears to be doing is to toggle the last JK flip/flop [bistable] alternately as each beam is broken.
In theory as you enter the hall the 1st beam is broken, the light comes On, as you leave the hall the 2nd beam is broken so the light goes Off.
The 555 is wired as a monostable, creating clean pulse for the JK flip/flop.
E

I use a standard indoor PIR in my hallway, which triggers a timing circuit and lighting control using a SSR, works OK.
You can buy ready made PIR/Hall LED Lights.
 

spinnaker

Joined Oct 29, 2009
7,830
If you want to do this project just for fun then fine go ahead and build it but just know there are PLENTY of solutions commercially available that will be more attractive, safer (most important) and do a far better job.. IHMO breaking an infrared beam is the wrong way to go. It is going to be a major PITA to line things up and get it working at a usable distance.

Switching house current with a relay isn't the best or safest option either.

Sorry but I wouldn't be switching lights (or anything else for that matter.) on an off in my home using a project that I found on the internet. Might be difficult to explain that one to the insurance company after the fire. ;)
 

Thread Starter

Arausio

Joined Jun 18, 2015
41
Thanks for the replies. My intent from this project is to learn electronics using a ‘hands-on’ approach. The turning ON/OFF lights would be a nice add-on to my home though. Frankly speaking, I am somewhat lost, recent EE graduate, looking for projects which can open doors to truly understanding electronics. For example, if I look at the internal schematic of the 555 timer, or any complex electronic circuit, it is difficult for me to understand what is happening. My interests are in the power distribution field, however without understanding electronics/power electronics I think it would be difficult to grow experience.
If you know of any source for intermediate level electronics projects, please point me to it. I would very appreciate it.
 

Thread Starter

Arausio

Joined Jun 18, 2015
41
Eric, Spinnaker,

Do you have any suggestions/resources for 'healthy' projects? Any advise to growing experience?

P.S. I have built circuits from - Electronics from the Ground Up and I wasn't thrilled with the explanations or with the instructions. The results, after I had built the circuit and verified it with other members on an electronics forum, did not match to that of the author.
 
Last edited:

spinnaker

Joined Oct 29, 2009
7,830
Eric, Spinnaker,

Do you have any suggestions/resources for 'healthy' projects? Any advise to growing experience?

P.S. I have built circuits from - Electronics from the Ground Up and I wasn't thrilled with the explanations or with the instructions. The results, after I had built the circuit and verified it with other members on an electronics forum, did not match to that of the author.
Same project. Just turn on an LED instead of your lights. You can use a logic level MOSFET or transistor in place of the realy.

There are tons of other safe projects you can do. I think there is a thread here about project ideas.
 

Thread Starter

Arausio

Joined Jun 18, 2015
41
Hello experts. I need your help in troubleshooting the circuit that was introduced above. I have wired the circuit (images attached) with using a white LED instead of a residential light as my load. However, I cannot get it to come on when the beam of light is broken. I would like to break this circuit down into pieces in order to understand what is happening. Please point me in the right direction.

Theory.

1. Two infrared diodes (emitters) are used to send infrared rays toward the receivers (IR_Q1 and IR_Q2).

Note: On pg. 5 author mentions that you should connect one receiver at a time across X5-1 and X5-2 while performing the set-up making sure the receiver and emitter are aimed at each other.

2. Author explains on pg. 2 the following: The output of this is fed through R6 to the base of Q3 — a small signal NPN transistor which is tied to the junction of a voltage divider formed by R8 and R9. With the beam unbroken, this junction is held low by Q3. However, once the beam breaks, Q3 is turned off, and R8 brings this junction high.

By the statement - “this junction is held low by Q3” I understand 0 volts. Why exactly does this junction is held low by Q3 and why when the beam breaks, Q3 stops conducting? Could someone show how the current will flow through Q3.

3. What is the purpose of the 2nd 555 timer?

4. I am lost in these words as well: “therefore, this signal is fed through R10 to Q4 — another small signal NPN. R15 holds the input of 1C2 high until the beam is broken which places a positive signal on the base of Q4, bringing the input of the 555 to ground.”

5. How exactly does Q5 toggle relay K1?

Practical.

Presently, I have made a jumper between pins 1 and 2 on ‘JP1’ and have connected only one receiver across X5-1 and X5-2. When aiming the emitter at the receiver I get LED1 (red light) to illuminate. See video link below.

If I change the location of the jumper to pins 2 and 3 instead as stated by author on pg. 6, I get the red LED1 always lit and green LED2 to only illuminate when emitter and receiver are not aimed at each other (or beam is broken by my finger). See video link below. However, I cannot get relay ‘K1’ to energize so that its contacts can close and white LED can illuminate and extinguish. In fact, I have isolated the relay and the white LED from the rest of the circuit to test them. The relay does energize, contacts close and white LED comes on. When working with the entire circuit, the relay coil does not energize. To add a note: The white LED has two 1.5V batteries in its circuit for power. Please help me resolve this situation.

Video Link (Jumper on pins 1 and 2 of JP1):
Video Link (Jumper on pins 2 and 3 of JP1):
 

Attachments

Last edited:

AnalogKid

Joined Aug 1, 2013
10,990
Surprisingly bad documentation for a N&V article. Usually their editors clean up the writing.

I agree with EG, the two emitters are in parallel and the two receivers are in series. The two receivers form an AND gate. As long as both beams are intact, the output is high (both transistors are saturated, a closed circuit). When either beam is broken, the string opens up and the base of Q1 is pulled low by R4, turning off Q1.

Q1 is a 5 amp, 100 V power darlington, massive overkill for its function. My guess is that he needed the gain of a darlington and had these in stock. I would do the same for a personal one-off, but *never* for someone else, let alone a mass audience. Tsk.

Q3 is a high-gain amplifier acting as a saturated switch and comparator or detector. When the signal at the Q1 emitter is greater than 0.6 V, Q3 switches on. The R8-R9-R10 part is overly complex, but not a problem.

The idea is that when both beams are intact, the signal at the Q1 emitter is high enough to hold Q3 turned on. As a saturated switch, the Q3 collector is down around 0.1 V or less above GND. This shunts the current from R8 away from Q4. None of it goes into the Q4 base because Q4 needs at least 0.6 V to begin conduction. When the beam is broken, the signal at the Q1 emitter falls below 0.6 V. This turns off Q3, and no current goes through its collector to GND. This allows the voltage at R8-R9-R10 to increase to 4.55 V (91% of Vcc) This is above 0.6 V, so Q4 turns on and pulls IC2 pin 2 down to GND (again, around 0.1 V). This triggers the 555 to make an output pulse.

Walking through a light beam does not produce a nice crisp on/off signal. Depending on the receiver circuit, each transition might in fact be two short bursts of very rapid on/off signals, one when the front of you enters the beam and one when the back of you exits. Also, you might be walking quickly or slowly, so the signal out of the receivers can be long or short and have two noise bursts. Not good.

To clean up this mess, U2 takes the first edge of the burst and produces a nice, clean, fat on/off pulse. The time constant shown is approx. 1 second. The pulse stays high for one second minimum (ignoring the retriggers caused by the first noise burst), and/or one second longer than you are in the beam (no matter how long that is) (ignoring retriggers caused by the second noise burst). This is a form of a "de-bouncing" circuit used to clean up the signal from a mechanical switch.

Q5 does not toggle the relay. It is simply a power amplifier, needed because the output of IC4 cannot switch enough current to activate the relay. IC4 toggles the relay. If is a flipflop configured as a toggle flipflop (that is its real name). With each successive clock input, the output toggles back and forth between the high and low states. Walking down the hallway, when you break the first beam the ff turns on the relay; when you break the second beam the ff turns off the relay.

A design flaw is that the author assumes that IC4 always powers up in a particular state. It might, but it is not guaranteed by the chip's internal design. If this is a problem, we can add 1 R and 1 C to the circuit to form a "power-on reset" and force IC4 to a known state.

ak
 
Last edited:

Thread Starter

Arausio

Joined Jun 18, 2015
41
ericgibbs, AnalogKid,

Thank you for your help. I am still trying to process the 'why it works the way it does,' but until then I still cannot get the relay to toggle. I wired the emitters in parallel and the receivers in series and made sure the jumper on JP1 was across pins 2 and 3 as per the author's text. Again, I got the red LED to always be ON and the green LED to come on only when the beam was broken.
I think that is the intended function because LED1 (RED) is directly connected to 5VDC through a current limiting resistor and should always be lit to indicate beam is intact. LED2 (GREEN) only lights up when IC2 outputs a pulse from pin 3 (output) into the IC4 pin 4 (CLK). IC2 outputs a pulse only when the beam has been broken which happens by pulling pin 2 (Trigger) to ground through Q4 (JP1 pins jumpered across 2 & 3). As far as getting an output pulse up to LED2, when the beam is broken, I believe the circuit is wired correctly. Please correct me if I am wrong.

I have several additional considerations:
1) Author uses polarized capacitors whereas all of my capacitors are non-polarized except for C2. I do not believe this will cause a difference but I still wanted to mention it.
2) Pin 6 (Threshold) on IC4 seems to be left floating. Is that by mistake or is it intentional?

AnalogKid,
You mentioned adding 1 resistor and 1 capacitor to this circuit. Where exactly and what values should we pick? Please explain.

'K1' Relay W/White LED:
 
Last edited:

AnalogKid

Joined Aug 1, 2013
10,990
As is, the circuit powers up with the flipflop in a random state. The Q- output could be high (light on) or low (light off), with no way to predict what it will be the next time power to the circuit is interrupted and restored. IF this is a problem, ANDIF you want the system to power up the same way every time, THEN the solution is to use the ff Preset (pin 5) or CLR (pin 1) input to force the Q- output to the same state every time power comes on. This is not a big deal, and has absolutely nothing to do with how the rest of the circuit functions.

ak
 

ericgibbs

Joined Jan 29, 2010
18,767
hi,
Try the test as marked on this circuit image.
Note: when the 555 is trigger On, then LED2 should Flash On.

If you swap the JP1 connection over, then LED1 should be lit when point 'A' is connected and unlit when point 'A' not touching.

Do you follow that OK.?

E.

AA1 07-Dec-18 09.06.gif
 

Thread Starter

Arausio

Joined Jun 18, 2015
41
Eric,

I set the trimmer to 100k (50%) and performed the test without any emitters and receivers connected. The jumper on JP1 was across pins 2 and 3 at first. When I connected the 10 ohm resistor to 5VDC, Q1 and Q3 should be ON and Q4 should be OFF. In this state Q3 is connecting R8 to ground and not allowing base current to flow into Q4. LED1 did illuminate because it has connection to the 5VDC. Now, when I moved the jumper on JP1 to pins 1 and 2 and broke connection with point A, Q4 should come ON because now junction with R8, R10, and R9 is high, current flows into base of Q4. Correct me if I am wrong but LED1 does not illuminate this time because collector current of Q4 flows through pins 2 and 1 and into capacitor C2, not LED1. So, it looks like the circuit passed the test but still the relay does not toggle. The way I see it is IC2 does output a pulse when the beam is broken making LED2 (GREEN) illuminate. So up to that point circuit works as intended. Now, if IC4 does output current into base of Q5 then it should be amplified. The question then why isn’t the relay coil getting its 5V?
Please correct me if my rationale is not correct.

Video of performed test:
 

ericgibbs

Joined Jan 29, 2010
18,767
hi A,
The transistor chain Q1> Q4 appears to be working correctly.

Try this relay operate test:

1. Disconnect R19 from the IC4A pin#7.
Connect the free end of R19 to +5V, the relay should operate.
If it operates OK, then reconnect R19 to pin#7 of the IC4A.

2.Check that IC4A have +5v on pins 5,2,1 & pin#3 is 0V
Disconnect the link from pin#3 of the 555, that connects to IC4A pin #4

Touching the free end of the link to +5V should switch the output pin#7 of the IC4A and operate the relay.
If it operates OK [ it may 'chatter' because of the crude way of touching the +5V with the link]

3. Check that IC2 the 555 has +5V on pins 4,2,8 and that R16 & C5 are correct.
Touching pin#2 of the 555 to 0V should trigger the 555 and operate the relay.

Let me know how this set of tests goes.

E

Note:
When testing the final build, you must allow at least 1.5secs between IR beam breaking, else the relay will remain energised.
 
Last edited:
Top