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

MisterBill2

Joined Jan 23, 2018
18,477
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.
View attachment 204826

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.
It is not that there are wrong connections, but that there is room for improvement in a number of places. Of course I have designed a lot of boards over the years and experience is very useful.
And following a diagnostic procedure based on system function is the way to make money on fixed price servicing. So I can share what I learned over a bunch of tears on that aspect.
And I am relieved that no parts were damaged by the reversed polarity.
 

RAMBO999

Joined Feb 26, 2018
259
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
The time constant of a 470uF / 100 kOhm RC combo at 9 volts is 47 seconds (235 seconds = 2m 55s) to reach 9 volts). If you are relying on that to determine how long the LEDs stay ON for then that's a problem. It's a lot longer than 10 seconds. In short, I would be looking at the time constants of your RC combos. You could also check the voltage drop across them to make sure the caps are energising sufficently. Particularly if you are relying on them to trigger some device like a 555 timer.
 

MisterBill2

Joined Jan 23, 2018
18,477
The time constant of a 470uF / 100 kOhm RC combo at 9 volts is 47 seconds (235 seconds = 2m 55s) to reach 9 volts). If you are relying on that to determine how long the LEDs stay ON for then that's a problem. It's a lot longer than 10 seconds. In short, I would be looking at the time constants of your RC combos. You could also check the voltage drop across them to make sure the caps are energising sufficently. Particularly if you are relying on them to trigger some device like a 555 timer.
For a quick experiment try a 47Mfd cap instead of 470 Mfd.
 

MisterBill2

Joined Jan 23, 2018
18,477
That will just divide everything by 10.
Dividing by 10 is my intent! That will get the on time close to what was the original goal, and in addition will show the effect of capacitor leakage current, if there is any. And I did call it an experiment, not a final fix. And 47Mfd is a common value likely to be in an experimenter's stock.
 

RAMBO999

Joined Feb 26, 2018
259
Dividing by 10 is my intent! That will get the on time close to what was the original goal, and in addition will show the effect of capacitor leakage current, if there is any. And I did call it an experiment, not a final fix. And 47Mfd is a common value likely to be in an experimenter's stock.
Have a play with this. Enter Voltage, Resistance and Capacitance in the left boxes and click the Redraw Chart button.

When you have done that if you want to know how long it takes to reach a certain voltage you can enter
that required voltage in the left hand box above the chart area an click the Redraw Chart button again.
The time appears in the right hand box above the chart area.

http://smegateway.co.uk/CapacitorChargingProfile/
 

Thread Starter

allenpitts

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

Getting close to moving the results of this thread to the completed projects board.
I got the multi-level PCBs from OshPark, the manufacturer, and they work well.
Breadboard_to_3_layer_PCB_composite_200423_800_x_600.JPG
This composite sort of shows the evolution of the project. At the top is the breadboard. Beneath the big breadboard, on the left is the prototype board. To the right of the prototype is a purple single layer PCB which drives seven LEDs on a breadboard.
Finally, there is the multi level purple PCB, about an inch square, which drives five LEDs on a prototype board.

So there is no question, just thanks for the help.

The next step is to apply the electronics to the application.

staircase_design_200423.gif

The layout was done from bottom to top so sensor S1 turns on LEDs L1.1,L1.2 and L1.3. Sensor S2 turns on LEDs L2.1,L2.2 and L2.3 and so on . The idea is, instead turning on all of the lights at once, movement up the stairs turns on three sets of lights at a time. I think it would be a cool effect and take advantage of the feedback from the motion detectors. The problem is, on the way down one would want S8 to operate lights L7.1, L7.2 and sensor S7 to turn on the L6 lights etc. The thought is that L7 lights would have an 'OR' switch so that the sensors just above and below the S7 lights, Sensors S8 and S6, could activate the L7 LEDs. Sort of like the switches at either end of a hall light that both can turn the overhead light on.

Still working on that.

Thanks again.

Allen in Dallas
 

MisterBill2

Joined Jan 23, 2018
18,477
To get the system to work from both directions will certainly require a bit more logic. Can you be certain that a person entering the stairway will always trigger the first sensor? The solution is to always determine which LEDs come on next is using the state of the led switched on prior to that. Such a scheme would be able to work with two people, one going up and the other coming down. THAT would be the coolest of all. Triggering the next lights based on the state of the previous lights. Then every controller could be the same. That would simplify a lot of things.
 

ElectricSpidey

Joined Dec 2, 2017
2,776
I don't think I would want lights to come on in a sequence when using the stairs, I believe this could possibly cause some disorientation, but hey, that's only my personal opinion.
 

MisterBill2

Joined Jan 23, 2018
18,477
To get the system to work from both directions will certainly require a bit more logic. Can you be certain that a person entering the stairway will always trigger the first sensor? The solution is to always determine which LEDs come on next is using the state of the led switched on prior to that. Such a scheme would be able to work with two people, one going up and the other coming down. THAT would be the coolest of all. Triggering the next lights based on the state of the previous lights. Then every controller could be the same. That would simplify a lot of things.
My concept was thinking of one sensor per step. That would work with every kind of user. And probably only need a multiple input OR gate for each.
 

Audioguru again

Joined Oct 21, 2019
6,690
I just realized that I almost always go up the stairs 2 stairs at a time and I am not a giant and not young.
Automatic motion-detected stairlights? Why? My wife and I rarely use the stairs in the middle of the night, in the winter when mornings and evenings are dark then the lights are turned on anyway.
 

MisterBill2

Joined Jan 23, 2018
18,477
I just realized that I almost always go up the stairs 2 stairs at a time and I am not a giant and not young.
Automatic motion-detected stairlights? Why? My wife and I rarely use the stairs in the middle of the night, in the winter when mornings and evenings are dark then the lights are turned on anyway.
Some folks use the stairs a whole lot, day and night.I am one of those types. When a living space is split between floors that is what happens. Quite different from places where everything is on one level.
At one job my office was up 15 steps, on a mezzanine, and that kept me in good shape. Production was on the main level, as well as the lunchroom, coffee pot, and the restrooms. Also the rest of the team.
Not everybody has a single level world.
 

MisterBill2

Joined Jan 23, 2018
18,477
Maybe 3 steps advancing & 3 steps trailing from each sensor then up or down the same ?
That is what I was thinking of. so each sensor set would also include a dual 3-input OR gate to accept triggers fron 3 steps above or three steps below. So the switch transistor will need to change to an MPSA13 so that it can reliably trigger off of a CMOS gate IC output. But now wiring these becomes a lot more complicated. but every step triggered would also light the two steps in front of it.
 
Last edited:

Thread Starter

allenpitts

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

Because the circuit is solved and the focus is now deployment and because this thread has become
quite long, will move the new post to a new thread with name 'LEDs at Staircase.

Thanks.

Allen
 

Thread Starter

allenpitts

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

Have moved this post to a new thread because the old one at
PIR Sensor (Motion detector) to 555 timer to LED array
has thirty_seven posts and the basic logic of the circuit, sensor to timer to LEDs,
(what was christened 'P5L' [PIR sensor to 555 timer to LEDs]) is solved. A new investigation is underway.
But in case you are new to the project the the old thread solved the circuit that would use a
low voltage (9 volts) and allow a PIR sensor (motion detector) to trigger a 555 timer turn on six LEDs.

The domain is now how deploy the P5L circuits on the staircase to light two or three treads at a time so the
the system reacts to the motion of the person going up or down the stairs.
staircase_design_200423.gif
Making the system work only in one direction, either up or down is fairly trivial. In the diagram titled
Staircase Application of P5L... dated 200423, the user is going down. Sensor S8 activates lights
L7.3, L7.2, and L7.3 and when the user gets to L7.1 sensor S7 would activate lights L6.2 and L6.1. and so on
down the stairs. Conversely, sensor S1 would turn on the lowest three lights and movement at the sensor just above
L1.3 would trigger S2 to turn on the second set of LEDs.

The issue is then when the user comes to, say, S6 if she is going up S6 should turn on L6.1 and L6.2. But if she
is going down motion near S6 should turn L5.1 and L5.2. But the circuits don't know which direction the user is moving.
Movement in either direction could be solved by having
a sensor light treads both above and below the sensor. But that would cause power to go arrays of LEDs from two
different activators at the same time.

Bernard offered
'That is what I was thinking of. so each sensor set would also include a dual 3-input OR gate
to accept triggers fron 3 steps above or three steps below. So the switch that it can reliably trigger off
of a CMOS gate IC output.'
Sorry guys, but I am
a computer programmer not an EE, so that went way over my head. If the system included an Arduino I could
write an If statement, but the intent is to keep things small by using discreet components instead of microcontrollers.

So is there away, using transistors or other small components, to turn on LEDs below a sensor only if the
LEDs above the sensor or on. And conversely, the sensor would only send juice to an LED array above the
sensor only if the LEDs below the sensor are lit.

A photo resistor comes to mind. That is, send power to LEDs above and below each sensor but have a photo
resistor block the signal to the LEDs if the adjacent LEDs are on. It was hoped that more sensors could be
avoided and TTL logic or other circuit logic could keep the system smaller.

Is there a more elegant solution that uses circuit logic to solve the deployment?

Thanks.

Allen in Dallas
 

MisterBill2

Joined Jan 23, 2018
18,477
The functionality that I described uses about the simplest possible circuit, a 3 input OR gate. Implementing that i an arduino would be a lot like chrome plating a lilly flower. One 14 pin IC that sells for less than a dollar, and two transistors at about $1.50 each. Then every step would light up not only that one but the next two, going up or going down. Eventually I may work up the logic statements expressing in in something like BASIC, or some other language.It would be a set of "IF -Then" functions. But the actual implementation would be in hard logic.
 
Top