PIR Sensor (Motion detector) to 555 timer to LED array

Thread Starter

allenpitts

Joined Feb 26, 2011
129
Hello AAC forum,

Working on a circuite that uses a PIR sensor to turn on some LEDs for about ten seconds.
I bread boarded the schematic
Motion-sensor-light-circuit_200302_w_extension.gif

This circuit works on the bread board.
The circuit was then built on prototype boards.
Motion_sensor_light_circuit_2_boards_200302.gif

When the prototype board is powered the LED above C2 and the five LEDs on right side board come on,
but they never go off.
Except the five LEDs on right side board dim just a little after about 4 seconds, about the time that the
PIR is sending a signal.,

I am pretty sure the problem is in the 470 uf capacitor and the 100k resistor between the power rail and ground.
and how they are controlling (or failing to control) the timer.

This has been driving me nuts for ten days because the breadboard, which was built as a temporary proof of the of the
circuit logic works, but the more permanent implementation, the prototype boards, are killing me.

Any idea where the mistake is in the prototype?

Thanks.

Allen in Dallas
 

Attachments

KeithWalker

Joined Jul 10, 2017
918
The wiring on your circuit board matches the schematic. Make sure that the real one matches the diagram. Check carefully for bad solder joints (use a magnifier). From your comments, it would appear that the timer has it's output stuck high. Measure the voltage across the 100K timing resistor. The voltmeter should have a high enough resistance that it will not effect the timing. The voltage should be changing between about 3 and 6 volts. If it is not, check the polarity of the capacitor C1. If that is OK try replacing it.
 

MisterBill2

Joined Jan 23, 2018
6,105
Hello AAC forum,

Working on a circuite that uses a PIR sensor to turn on some LEDs for about ten seconds.
I bread boarded the schematic
View attachment 200456

This circuit works on the bread board.
The circuit was then built on prototype boards.
View attachment 200458

When the prototype board is powered the LED above C2 and the five LEDs on right side board come on,
but they never go off.
Except the five LEDs on right side board dim just a little after about 4 seconds, about the time that the
PIR is sending a signal.,

I am pretty sure the problem is in the 470 uf capacitor and the 100k resistor between the power rail and ground.
and how they are controlling (or failing to control) the timer.

This has been driving me nuts for ten days because the breadboard, which was built as a temporary proof of the of the
circuit logic works, but the more permanent implementation, the prototype boards, are killing me.

Any idea where the mistake is in the prototype?

Thanks.

Allen in Dallas
First, disconnect the 3.3K resistor to the base of the transistor feeding all those LEDs and see if the rest of the circuit works correctly. And if it really is wired exactly like the circuit schematicmost of the LEDs will stay on because they are not connected to the transistor. And also it looks like the transistor is wired with emitter and collector swapped.
 

LesJones

Joined Jan 8, 2017
2,647
Hi Keith,
The schematic does not match the layout. I think you have seen the schematic as what you expect to see rather than how it is drawn. On the schematic only the left hand LED is switched by the transistor. The other 6 LEDs (With their current limiting resistors.) are connected directly across the power supply as their cathodes are connected to the emitter rather than the collector.

Les.
 

MisterBill2

Joined Jan 23, 2018
6,105
Hi Keith,
The schematic does not match the layout. I think you have seen the schematic as what you expect to see rather than how it is drawn. On the schematic only the left hand LED is switched by the transistor. The other 6 LEDs (With their current limiting resistors.) are connected directly across the power supply as their cathodes are connected to the emitter rather than the collector.

Les.
I stated that in post #3. But it is worth repeating.
 

KeithWalker

Joined Jul 10, 2017
918
You are correct, Les. In the schematic, the left LED is connected to the 555 output, pin 3, through a 470 ohm resistor. Only one of the other LEDs is connected to the collector of the transistor. The rest would be on all the time. In the layout diagram, The left LED is connected through a 470 ohm resistor to pin 3, as in the schematic. The transistor on the right has it's collector at the bottom and the emitter at the top (very small C, B,E labels). All the LEDs are connected to the collector. Either way, the circuit should be functional, but with different results.
Keith
 
Last edited:

Thread Starter

allenpitts

Joined Feb 26, 2011
129
Hello KeithWalker, MisterBill2, EETech00, LesJones, and the AAC forum

Thanks guys. Don't know how I missed the resistor to the transistor base from the PIR.
(Hope I haven't fried the BC-547.)
Also MisterBill2's comment about disconnecting the 3.3k resistor to troubleshoot theBC547-Transistor-Pinout.gif
timer end of the circuit is excellent. Will also check the transistor that has the 3.3k
to make sure the emitter and collector are not swapped.
Forgive me, but I was under the impression that the emitter should go to ground and collector should go
to voltage.
uh oh. Could it be that the 9 volt jumper from near the 100k on the left
should go to the right BC-547 collector. And then the right BC-547 emitter should be
connected to the lowest 470k limiter on the anode side of the LED array. Then
the last LED in the array would have its cathode going directly back to ground.
Right?

(Now I know why the EE types want a schematic and not a pictogram. The
schematic is much better in showing the logic of the circuit. Its so
easy to get lost on the pictogram.)

Unfortunately (or fortunately) I am going to the Texas panhandle
to hunt feral pigs tomorrow so it will be next week before the
circuit and diagram revisions can be posted.

Thanks again. It took me two hours to make these drawings.
But it was worth it. Will revise pictogram and resubmit.

The gods will smile on the man who helps a lost stranger.

You guys rock.

Allen in Dallas
 

MisterBill2

Joined Jan 23, 2018
6,105
Hello KeithWalker, MisterBill2, EETech00, LesJones, and the AAC forum

Thanks guys. Don't know how I missed the resistor to the transistor base from the PIR.
(Hope I haven't fried the BC-547.)
Also MisterBill2's comment about disconnecting the 3.3k resistor to troubleshoot theView attachment 200537
timer end of the circuit is excellent. Will also check the transistor that has the 3.3k
to make sure the emitter and collector are not swapped.
Forgive me, but I was under the impression that the emitter should go to ground and collector should go
to voltage.
uh oh. Could it be that the 9 volt jumper from near the 100k on the left
should go to the right BC-547 collector. And then the right BC-547 emitter should be
connected to the lowest 470k limiter on the anode side of the LED array. Then
the last LED in the array would have its cathode going directly back to ground.
Right?

(Now I know why the EE types want a schematic and not a pictogram. The
schematic is much better in showing the logic of the circuit. Its so
easy to get lost on the pictogram.)

Unfortunately (or fortunately) I am going to the Texas panhandle
to hunt feral pigs tomorrow so it will be next week before the
circuit and diagram revisions can be posted.

Thanks again. It took me two hours to make these drawings.
But it was worth it. Will revise pictogram and resubmit.

The gods will smile on the man who helps a lost stranger.

You guys rock.

Allen in Dallas
I was not trying to say that the circuit was wrong, but that it looked like the transistor was inserted backward. Usually, for a TO-92 package, with the flat surface facing and the leads pointed down, the emitter is to the left, base center, and collector on the right. I think that it looked reversed from that in the one photo. But it was not a clear picture of that area so I may be wrong.
The quick and easy way that I have been showing circuit schematics has recently been a paper sketch, scan to PDF, and then insert the PDF. I still have not been able to reload my cad program to produce great schematic diagrams. Windows makes re-using older programs so difficult, and I can't justify buying a newer version of that one.
 

Bernard

Joined Aug 7, 2008
5,526
If the PIR is like the KC7783 module then the output is active hi- a hard hi - pulled up by a PNP or P ch. FET
to + supply. A base resistor is advised.
Need more inf. on PIR used.
Do you really want 6 LED always on ?
 

Thread Starter

allenpitts

Joined Feb 26, 2011
129
Hello KeithWalker, MisterBill2, EETech00, LesJones, Bernard and the AAC forum

I got it to work, finally.

These are the comments, for which there is much gratitude, that steered me from
ignorance to knowledge.

Keith Walker 'check the polarity of the capacitor C1.'
MisterBill2 'looks like the transistor is wired with emitter and collector swapped.'
LesJone 'The other 6 LEDs (With their current limiting resistors.) are connected directly across the power supply as their cathodes are connected to the emitter rather than the collector.'
MisterBill2 'There is no series base resistor because there is no need for one. Due to the output circuit of the PIR sensor the current out is already limited. It is a voltage output, really.'

Answer to Bernard's question:
The PIR is a HC - SR505 data sheet at
https://components101.com/sites/default/files/component_datasheet/HC-SR505 Datasheet.pdf
The HC-505 is similar but smaller than the HC-501 that has been used on several projects previously.
Besides the size, the 505 does not have the trim pots to adjust the time it stays or the distance from which the sensor will detect changes in the infrared signature. Finally, the 501
has a jumper set that will allow the PIR to operate in either Repeat Trigger or Single Trigger modes.
So they operate similarly but the 501 has more adjustments. The 505 stays on for about ten seconds.

Yes, to say it pithily, the problem was the current to transistor T2, which lights the five LEDs,
was not going thru the transistor.

There was mention that there should be a resistor and at transistor T1. It looks like
eeTech00 is right. Emperical evidence supports the transistor operating fine w/o a resistor.

Finally, Can't believe the rookie mistake. Was sure I had checked and rechecked every
component and jumper wire on the prototype solder.
C1 was reversed. That throws the timer off.
And the second error was in load transistor collector/emitter swap.
Motion_sensor_light_circuit_2_boards_200309.gif
Oh well. Now There is have a good prototype. The next step is the PCB.
Found a good software called Dip Trace.

The bread board takes up twenty square inches.
The protoype boards take up eight square inches
The PCB is estimated at 2.5 square inches.

Thanks for your time and courtesy.

I am and will remain,

Your humble servant,

Allen in Dallas

PIR to 555 to LEDs (P5L 200309), Project Log
200114 Inception: Project scope: Motion detector light for staircase, closets, etc.
200118 Research: PIR sensor to 555
200122 Design: Add transistor from 555 to LED load
200125 Circuit schematic
200101 Build breadboard from schematic
200105 Design prototype on Datak 12-607B PCBs in pencil on graph paper
200208 Build prototype on Datak 12-607B PCBs
200015 Troubleshoot prototype on Datak 12-607B PCBs
200022 Troubleshoot prototype on Datak 12-607B PCBs
200023 Troubleshoot prototype on Datak 12-607B PCBs
200029 Draw prototype on Datak 12-607B
200302 Post at AAC on protoype
200302 Reply from KeithWalker
200303 Reply from MisterBill2, LesJones and eeTech00
200303 Allen replied to AAC
200309 Circuit operates, pictogram corrected,
and posted at AAC forum

Projected
200314 Design PCBs
200315 Check and order PCBs
200411 Takes four weeks for the Chinese to make and ship PCBs
200418 Design LED layout and staircase risers
200425 Test LED layout and staircase risers
200502 Install LED layout and staircase risers
 
Last edited:

jbeng

Joined Sep 10, 2006
74
To get your [bare] printed circuit boards made, I'd consider OSHPark. Their pcbs are high quality and at $5 per sq in, quite inexpensive, considering you get three copies of your board. You'll probably get your boards in 10 days or so, instead of the 4 weeks from China. I've used them for years & have never been disappointed.
oshpark.com
 

Thread Starter

allenpitts

Joined Feb 26, 2011
129
Hello KeithWalker, MisterBill2, EETech00, LesJones, Bernard and the AAC forum

I got it to work, finally.

These are the comments, for which there is much gratitude, that steered me from
ignorance to knowledge.

Keith Walker 'check the polarity of the capacitor C1.'
MisterBill2 'looks like the transistor is wired with emitter and collector swapped.'
LesJone 'The other 6 LEDs (With their current limiting resistors.) are connected directly across the power supply as their cathodes are connected to the emitter rather than the collector.'
MisterBill2 'There is no series base resistor because there is no need for one. Due to the output circuit of the PIR sensor the current out is already limited. It is a voltage output, really.'

Answer to Bernard's question:
The PIR is a HC - SR505 data sheet at
https://components101.com/sites/default/files/component_datasheet/HC-SR505 Datasheet.pdf
The HC-505 is similar but smaller than the HC-501 that has been used on several projects previously.
Besides the size, the 505 does not have the trim pots to adjust the time it stays or the distance from which the sensor will detect changes in the infrared signature. Finally, the 501
has a jumper set that will allow the PIR to operate in either Repeat Trigger or Single Trigger modes.
So they operate similarly but the 501 has more adjustments. The 505 stays on for about ten seconds.

Yes, to say it pithily, the problem was the current to transistor T2, which lights the five LEDs,
was not going thru the transistor.

There was mention that there should be a resistor and at transistor T1. It looks like
eeTech00 is right. Emperical evidence supports the transistor operating fine w/o a resistor.

Finally, Can't believe the rookie mistake. Was sure I had checked and rechecked every
component and jumper wire on the prototype solder.
C1 was reversed. That throws the timer off.
And the second error was in load transistor collector/emitter swap.
View attachment 201096
Oh well. Now There is have a good prototype. The next step is the PCB.
Found a good software called Dip Trace.

The bread board takes up twenty square inches.
The protoype boards take up eight square inches
The PCB is estimated at 2.5 square inches.

Thanks for your time and courtesy.

I am and will remain,

Your humble servant,

Allen in Dallas

PIR to 555 to LEDs (P5L 200309), Project Log
200114 Inception: Project scope: Motion detector light for staircase, closets, etc.
200118 Research: PIR sensor to 555
200122 Design: Add transistor from 555 to LED load
200125 Circuit schematic
200101 Build breadboard from schematic
200105 Design prototype on Datak 12-607B PCBs in pencil on graph paper
200208 Build prototype on Datak 12-607B PCBs
200015 Troubleshoot prototype on Datak 12-607B PCBs
200022 Troubleshoot prototype on Datak 12-607B PCBs
200023 Troubleshoot prototype on Datak 12-607B PCBs
200029 Draw prototype on Datak 12-607B
200302 Post at AAC on protoype
200302 Reply from KeithWalker
200303 Reply from MisterBill2, LesJones and eeTech00
200303 Allen replied to AAC
200309 Circuit operates, pictogram corrected,
and posted at AAC forum

Projected
200314 Design PCBs
200315 Check and order PCBs
200411 Takes four weeks for the Chinese to make and ship PCBs
200418 Design LED layout and staircase risers
200425 Test LED layout and staircase risers
200502 Install LED layout and staircase risers
 

Thread Starter

allenpitts

Joined Feb 26, 2011
129
Hello KeithWalker, MisterBill2, EETech00, LesJones, Bernard and the AAC forum
Got the PCBs from the manufacturer and loaded
one up. No joy.

The diagram of the PCB copied herewith below
is based on the schematic posted above titled
PIR Sensor to 555 Monostable w Extension Transistor
dated 200210. Have breadboarded the schematic
and transitioned the schematic to a prototype board
with good outcome.
P5L_200316_PCB_200331_b.gif
Replaced the 555 IC with known good.
Also swapped out the PIR with one that is working
on the breadboard.
There are a couple mistakes on the PCB. The pad
just above the 'T1' on the board runs to the ground
rail and has no purpose.
Similarly, there is a pad just south of the base
of T1 marked 'b' that is not needed. I don't know why I put
them on the board. But I don't think they would
keep the PCB from working.
There must be some other mistake in the PCB because it
won't light the LED but can't find it.
Thanks.
Allen in Dallas
 

MisterBill2

Joined Jan 23, 2018
6,105
Here is a diagnostic process sequence. First, use a DMM, negative probe connected to the supply negative terminal. and verify that the + supply terminal of the PIR sensor is at the V++ voltage Then verify that the PIR GND terminal is at zero volts. Then verify that the PIR output terminal changes states as it should. Then probe the base of T1 and verify that it changes state as planned. Next observe the collector voltage change.
One unsuspected fault can be a hairline gap in the trace on the board.
Hopefully checking each point in the signal path will lead to a discovery of where the signal stops.
Quitting now, my dinner is ready.
 
The circuit looks OK. I would look at the TRIGGER pin 2 voltage, it has to go low to trigger the 555 timer. One trap is the BC547 has backwards pinout CBE, you have to flip them.
 

MisterBill2

Joined Jan 23, 2018
6,105
Here is a diagnostic process sequence. First, use a DMM, negative probe connected to the supply negative terminal. and verify that the + supply terminal of the PIR sensor is at the V++ voltage Then verify that the PIR GND terminal is at zero volts. Then verify that the PIR output terminal changes states as it should. Then probe the base of T1 and verify that it changes state as planned. Next observe the collector voltage change.
One unsuspected fault can be a hairline gap in the trace on the board.
Hopefully checking each point in the signal path will lead to a discovery of where the signal stops.
Quitting now, my dinner is ready.
OK, I am presuming that the board is supposed to be the same circuit with the same part designations as the only actual schematic diagram I have seen much earlier in this thread. Does the trigger signal, get to pin #2 of the 555 timer? That should be easy to determine and it is important. I do see a flaw in the trace from C2 to the ground connection at pin #1, and also a flaw in the trace from R1 to pin 7. And I do not like at all the way the common trace is run. It should be wider and there should be less of a series connection of common points.
After the trigger is verified as reaching pin 2 the next place to monitor is pin 3. The LED may be reversed, in which case it will not light. Diagnostics based on circuit function are usually the fastest way to find a problem, unless it is very obvious, like a bent pin or a reversed capacitor or diode.
 

Thread Starter

allenpitts

Joined Feb 26, 2011
129
Hello MisterBill2, PrairieMystic, Bernard and the AAC forum,

Thanks guys. I got it to work.

Prairie Mystic,
Thanks for looking at the circuit logic of the schematic versus the
PCB diagram. I checked that several times but sometimes the logical
non sequitur made in the initial evaluation is also made in checking
the work.
MisterBill2,
The tip on diagnostic process sequence was the difference maker.
Using the DMM, the PIR V+ and ground were checked for nine volt potential.
Nope. So went back to the barrel jack.
A different wall wart was used for the PCB than the breadboard.
Once again its a simple thing that trips me up.
The polarity on the wall warts were reversed.
Power_plug_to_barrel_jack_200419.gif
there should be less of a series connection of common points.
Not sure what this refers to but perhaps in the drawing PIR Sensor to 555
to LEDs (P5L)
, above, that the pads above and below J1 should be
eliminated and the trace coming from the cathode of the LED
should go straight to the T2 emitter. Or, extending this idea, the trace going to the
LED cathode should be bifurcated before it gets to the LED cathode
with one side of the fork going to the LED cathode and the other
side of the fork going to the T2 emitter. This would provide
a more direct, less serial, connection to the transistor.
Is that what is meant by 'less of a serial connection'?
If so, are there other instances?
(If this is correct will update the PCB design and repost.)
Thanks.
Allen in Dallas

PS Have reordered the PCB as a three-level board which
will further miniaturize the layout. Will follow up when
that one is loaded up.
 
Top