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

Thread Starter

allenpitts

Joined Feb 26, 2011
163
Hello MIsterBill2 and the AAC forum,

MisterBill2 thanks for your thoughtful reply.

Not sure what a
simplest possible circuit, a 3 input OR gate
is. Sorry but your dealing with a self taught weekend warrior.
Perhaps if a schematic exists somewhere and could be seen.

'3 input OR gate' was Googled with result
https://www.allaboutcircuits.com/textbook/digital/chpt-3/multiple-input-gates/
The Multiple-input Gates exposition was read and understood, sort of,
but at a fairly abstract level.
What is not understood is:
1. Which one of the gates applies to the requirement at hand?
Requirement restated:
Use Case One (going up): When sensor S6 is triggered the LEDS above (LED L7.1 and L7.2) are turned on
if LEDs below (L5.1 and L5.2) are on.
Use Case Two (going down): When sensor S6 is triggered the LEDS below (LED L5.1 and L5.2) are turned on
if LEDs above (L7.1 and L7.2) are on.
2. Having decided which type of gate applies to the issue, how does one make that gate into a circuit?

But instead of answering those complex questions the solution can be both simplified and made more concrete by considering a device that is understood, the transistor.
The transistor says if a voltage/current is sensed at my base I allow current to flow (for NPN) from the collector to the emitter. Is there a device that says if I sense a current at my base I don't allow current to flow? The name for this
device is not known so I will call it currneg device.

In Use Case One (going up) S6 is triggered and sends signals to the transistors operating both LEDS L7 and L5.
But the currneg device sits in the trace from the S6 PIR and L5, and if L5 is on, the currneg blocks the PIR signal from going to the transistor operating the L5 LEDs.

In Use Case Two (going down) S6 is triggered and sends signals to the transistors operating both LEDS L7 and L5.
But the currneg device sits in the trace from the S6 PIR and L7, if L7 is on, the currneg blocks the PIR signal from going to the transistor operating the L7 LEDs.

Does this makes sense?

If so is there a discreet component that, if it senses a current opens the circuit and prevents a signal from being sent?

Thanks,

Allen in Dallas
 

MisterBill2

Joined Jan 23, 2018
18,590
An OR gate gives you an output when a voltage is present at any of the inputs. A "CD4075" IC contains three of the three input devices, while a CD4072 contains two of the 4-input OR gates. The functional descriptions of those devices are available online in many places. In your application the gate would need to be between the motion sensor and the transistor, with both of the gates isolated by signal diodes pointing to the transistor. That is cheaper than two transistors, each driven by one gate, for the separate up and down arrangement.
The signal going to the above and below steps will need to come directly from the output of the motion detector, otherwise there will be an unintended chain reaction and the first step will switch them all on. If we are fortunate then somebody with a cad system can draw out the circuit for you.
 

eetech00

Joined Jun 8, 2013
3,960
Hi

Questions:
1. Is only one person allowed to use the stairs at a time?
2. Is a person allowed to reverse motion on the stairs?

eT
 

MisterBill2

Joined Jan 23, 2018
18,590
Hi

Questions:
1. Is only one person allowed to use the stairs at a time?
2. Is a person allowed to reverse motion on the stairs?

eT
As many people as there are steps, at one time. Reversing would work with no problems because the control scheme is not a state machine, but sm "IF->Then" arrangement. If motion is detected Then lights on. Very simple logic.
 

eetech00

Joined Jun 8, 2013
3,960
As many people as there are steps, at one time. Reversing would work with no problems because the control scheme is not a state machine, but sm "IF->Then" arrangement. If motion is detected Then lights on. Very simple logic.
Trying to imagine the lights operating under those conditions. Seems like no real purpose?
 

Bernard

Joined Aug 7, 2008
5,784
currneg = non inverting amplifier, or 2 transistors.
If timing is 10 sec. then all leading or trailing LEDs will still be on when top or bottom is reached.
 

MisterBill2

Joined Jan 23, 2018
18,590
It is important to keep in mind that this is the answer to the TS question and a created a functional circuit that provides the requested result.
This is not a forum for arguing other folks tastes.
 

Bernard

Joined Aug 7, 2008
5,784
A short example of diode OR gating. Steps are re numbered 1-16 with a PIR-driver at steps
1,4, 7, 10, 13, & 16. Not included is inhibiting of trailing LEDs per MrBill2, Post # 30. Note that the step under a PIR is also illuminated from either direction with its own 2 diode OR gate, D 1&2
Select diodes to match LED requirements, maybe 1N5817, Shottky, 1A, 20V , or 1N400x ?
Scan.jpg
 
Last edited:

MisterBill2

Joined Jan 23, 2018
18,590
A short example of diode OR gating. Steps are re numbered 1-16 with a PIR-driver at steps
1,4, 7, 10, 13, & 16. Not included is inhibiting of trailing LEDs per MrBill2, Post # 30. Note that the step under a PIR is also illuminated from either direction with its own 2 diode OR gate, D 1&2
Select diodes to match LED requirements, maybe 1N5817, Shottky, 1A, 20V , or 1N400x ?
View attachment 205541
Probably close, except that I had suggested OR gates as I think that they would take less space. AND I was thinking a sensor on each step. Kind of much, possibly "over the edge", but it was fun thinking it out.
 

Bernard

Joined Aug 7, 2008
5,784
As shown , the circuit operates from a pos. signal, but can be inverted for a neg. signal like from new PCB with transistor output. Having last LED on and hoping that PIR sees me before I step into a black hole might make some nervous. Maybe have whole next group of LEDs light up or just tight up whole stairway?
 

Thread Starter

allenpitts

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

Special thanks to Bernard for the thoughtful reply with the schematic.

Was visiting with a friend who is an EE and asked him about the
staircase project. He said with eight inputs and seven groups of lights
an Arduino might be an answer. I have done several projects with
Arduinos and am familiar with the programming:
Arduino to Maxim 7219 daisy chain
He also mention a 4013 Flip Flop which is a bit similar to Bernard's
idea in that it uses discreet components.

Research on the 4013 Flip Flop led to
How to Build a D flip flop Circuit with a 4013 Chip

The system should work differently depending on whether the walker is going up the stairs
or down the stairs. Or stated more formally:
System Requirements:
Use Case One (going up): When sensor S6 is triggered the LEDS above (LED L7.1 and L7.2) are turned on
if LEDs below (L5.1 and L5.2) are on.
Use Case Two (going down): When sensor S6 is triggered the LEDS below (LED L5.1 and L5.2) are turned on
if LEDs above (L7.1 and L7.2) are on.
Sensor S6 is used in the requirements as an example to illustrate that the lights below a sensor would
be activated by movement down the stairs and lights above above a sensor would be activated by movement up
the staircase. The exception is sensors S1 and S8. There are no lights below S1 or above S8 and so S1
has no sensitivity to another set of lights. S1 simply turns on LEDs L1.1, L1.2 and L1.3. And similar for S8.
NOTE: 'Q2' is used as a substitute for Q with a hyphen above it because there is
no way of putting a hyphen above a Q using the characters on a standard keyboard.)

In Use Case One (going up)
S1 is triggered and the PIR
- Sends a signal to the P5L operating LEDs L1 and turns L1 LEDs on
S2 is then triggered
- Sends a signal to 4013.1 pin 4 (R) which makes Q1 = 1 and Q2 = 0. Q1 sends a high signal to L2 LEDs and a low or no signal to L1 LEDs
S3 is then triggered
- Sends a signal to 4013.2 pin 4 (R) which makes Q1 = 1 and Q2 = 0. Q1 sends a high signal to L3 LEDs and a low or no signal to L2 LEDs
S4 is then triggered .......

In Use Case Two (going down)
S8 is triggered and the PIR
- Sends a signal to the P5L operating LEDs L7 and turns L7 LEDs on
S7 is then triggered
- Sends a signal to 4013.6 pin 4 (R) which makes Q1 = 1 and Q2 = 0. Q1 sends a high signal to L6 LEDs and a low or no signal to L7 LEDs
S6 is then triggered
- Sends a signal to 4013.5 pin 4 (R) which makes Q1 = 1 and Q2 = 0. Q1 sends a high signal to L5 LEDs and a low or no signal to L6 LEDs
S5 is then triggered .....
Three questions:
1. Is this the best way to use the flip flops?
2. Is the clock an oscilator like a 555 timer? If there are six 4013s can they all be run from one 555?
3. I am familiar with a positive signal coming from, say, the PIR sensor which sends a 3 volt
signal. And at the Arduino send a HIGH signal with the statement 'lc.setLed(0,0,0,true)'.
And it is assumed that the three volt signal from the PIR to a pin on the 4013 would be
intepreteted as value of 1. But how does one send a signal to the pin of value zero?
Thanks.
Allen in Dallas
 

MisterBill2

Joined Jan 23, 2018
18,590
Hello MisterBill2 and Bernard and the AAC forum,

Special thanks to Bernard for the thoughtful reply with the schematic.

Was visiting with a friend who is an EE and asked him about the
staircase project. He said with eight inputs and seven groups of lights
an Arduino might be an answer. I have done several projects with
Arduinos and am familiar with the programming:
Arduino to Maxim 7219 daisy chain
He also mention a 4013 Flip Flop which is a bit similar to Bernard's
idea in that it uses discreet components.

Research on the 4013 Flip Flop led to
How to Build a D flip flop Circuit with a 4013 Chip

The system should work differently depending on whether the walker is going up the stairs
or down the stairs. Or stated more formally:
System Requirements:
Use Case One (going up): When sensor S6 is triggered the LEDS above (LED L7.1 and L7.2) are turned on
if LEDs below (L5.1 and L5.2) are on.
Use Case Two (going down): When sensor S6 is triggered the LEDS below (LED L5.1 and L5.2) are turned on
if LEDs above (L7.1 and L7.2) are on.
Sensor S6 is used in the requirements as an example to illustrate that the lights below a sensor would
be activated by movement down the stairs and lights above above a sensor would be activated by movement up
the staircase. The exception is sensors S1 and S8. There are no lights below S1 or above S8 and so S1
has no sensitivity to another set of lights. S1 simply turns on LEDs L1.1, L1.2 and L1.3. And similar for S8.
NOTE: 'Q2' is used as a substitute for Q with a hyphen above it because there is
no way of putting a hyphen above a Q using the characters on a standard keyboard.)

In Use Case One (going up)
S1 is triggered and the PIR
- Sends a signal to the P5L operating LEDs L1 and turns L1 LEDs on
S2 is then triggered
- Sends a signal to 4013.1 pin 4 (R) which makes Q1 = 1 and Q2 = 0. Q1 sends a high signal to L2 LEDs and a low or no signal to L1 LEDs
S3 is then triggered
- Sends a signal to 4013.2 pin 4 (R) which makes Q1 = 1 and Q2 = 0. Q1 sends a high signal to L3 LEDs and a low or no signal to L2 LEDs
S4 is then triggered .......

In Use Case Two (going down)
S8 is triggered and the PIR
- Sends a signal to the P5L operating LEDs L7 and turns L7 LEDs on
S7 is then triggered
- Sends a signal to 4013.6 pin 4 (R) which makes Q1 = 1 and Q2 = 0. Q1 sends a high signal to L6 LEDs and a low or no signal to L7 LEDs
S6 is then triggered
- Sends a signal to 4013.5 pin 4 (R) which makes Q1 = 1 and Q2 = 0. Q1 sends a high signal to L5 LEDs and a low or no signal to L6 LEDs
S5 is then triggered .....
Three questions:
1. Is this the best way to use the flip flops?
2. Is the clock an oscilator like a 555 timer? If there are six 4013s can they all be run from one 555?
3. I am familiar with a positive signal coming from, say, the PIR sensor which sends a 3 volt
signal. And at the Arduino send a HIGH signal with the statement 'lc.setLed(0,0,0,true)'.
And it is assumed that the three volt signal from the PIR to a pin on the 4013 would be
intepreteted as value of 1. But how does one send a signal to the pin of value zero?
Thanks.
Allen in Dallas
With an arduino you will need a whole lot more wiring than with the OR gate solution. Plus it will need a program loaded, plus it will need to be packaged some place. So an arduino will take aboyt ten times the material and 20 times as much wire, plus another power supply. AND none of that includes the I/O needed to connect it to all those sensors and drive all those LEDs. Also, that triple 3-input OR gate IC costs less than $1 in single unit quantities, and is available from quite a few different manufacturers.
 

eetech00

Joined Jun 8, 2013
3,960
Hello MisterBill2 and Bernard and the AAC forum,

Special thanks to Bernard for the thoughtful reply with the schematic.

Was visiting with a friend who is an EE and asked him about the
staircase project. He said with eight inputs and seven groups of lights
an Arduino might be an answer. I have done several projects with
Arduinos and am familiar with the programming:
Arduino to Maxim 7219 daisy chain
He also mention a 4013 Flip Flop which is a bit similar to Bernard's
idea in that it uses discreet components.

Research on the 4013 Flip Flop led to
How to Build a D flip flop Circuit with a 4013 Chip

The system should work differently depending on whether the walker is going up the stairs
or down the stairs. Or stated more formally:
System Requirements:
Use Case One (going up): When sensor S6 is triggered the LEDS above (LED L7.1 and L7.2) are turned on
if LEDs below (L5.1 and L5.2) are on.
Use Case Two (going down): When sensor S6 is triggered the LEDS below (LED L5.1 and L5.2) are turned on
if LEDs above (L7.1 and L7.2) are on.
Sensor S6 is used in the requirements as an example to illustrate that the lights below a sensor would
be activated by movement down the stairs and lights above above a sensor would be activated by movement up
the staircase. The exception is sensors S1 and S8. There are no lights below S1 or above S8 and so S1
has no sensitivity to another set of lights. S1 simply turns on LEDs L1.1, L1.2 and L1.3. And similar for S8.
NOTE: 'Q2' is used as a substitute for Q with a hyphen above it because there is
no way of putting a hyphen above a Q using the characters on a standard keyboard.)

In Use Case One (going up)
S1 is triggered and the PIR
- Sends a signal to the P5L operating LEDs L1 and turns L1 LEDs on
S2 is then triggered
- Sends a signal to 4013.1 pin 4 (R) which makes Q1 = 1 and Q2 = 0. Q1 sends a high signal to L2 LEDs and a low or no signal to L1 LEDs
S3 is then triggered
- Sends a signal to 4013.2 pin 4 (R) which makes Q1 = 1 and Q2 = 0. Q1 sends a high signal to L3 LEDs and a low or no signal to L2 LEDs
S4 is then triggered .......

In Use Case Two (going down)
S8 is triggered and the PIR
- Sends a signal to the P5L operating LEDs L7 and turns L7 LEDs on
S7 is then triggered
- Sends a signal to 4013.6 pin 4 (R) which makes Q1 = 1 and Q2 = 0. Q1 sends a high signal to L6 LEDs and a low or no signal to L7 LEDs
S6 is then triggered
- Sends a signal to 4013.5 pin 4 (R) which makes Q1 = 1 and Q2 = 0. Q1 sends a high signal to L5 LEDs and a low or no signal to L6 LEDs
S5 is then triggered .....
Three questions:
1. Is this the best way to use the flip flops?
2. Is the clock an oscilator like a 555 timer? If there are six 4013s can they all be run from one 555?
3. I am familiar with a positive signal coming from, say, the PIR sensor which sends a 3 volt
signal. And at the Arduino send a HIGH signal with the statement 'lc.setLed(0,0,0,true)'.
And it is assumed that the three volt signal from the PIR to a pin on the 4013 would be
intepreteted as value of 1. But how does one send a signal to the pin of value zero?
Thanks.
Allen in Dallas
Using a uC is is a good choice. You shouldn’t need hardware flip flops.
If you set a gpio output port high it won’t change unless you command it to. That basically how a flip flop behaves (except a D flip flop uses a clock input).
 

MisterBill2

Joined Jan 23, 2018
18,590
With any central computer control block there is a need to connect to the external world, in this case LEDs for each step, and the PIR sensor blocks for at least a third of th steps, or possibly all of them. That is a whole lot of wires that need to be someplace, and go to the correct connection of the I/O expansion area of the central processor system. That could get rather "Hairy", to say the least. I doubt that there is any DURABLE serial external I/O available. Probably such an I/O would need to be created, or purchased.
Considering this, does using a little processor board make any sense at all?
 

MisterBill2

Joined Jan 23, 2018
18,590
The arduino gpio’s can be fitted with drivers if needed. No big deal.

all the logic could be handled in software.
How much of all that interconnecting wiring can be handled in software? All those inputs from each motion sense module and every output to each LED string? The hard part is often the connection between software and the real world, (AKA the physical world.) I count 16 levels, and so 16 sensors, possibly, and at least 16 separate LED groups. THat is 32 I/O minimum, assuming no manual controls. That processor board and it's FRAGILE I/O board and all of those wires and the power supply have to live someplace. That part can not "be handled in software."
That is why the original suggestion of adding one 14 pin IC per PIR module to handle it all made sense.
 

Bernard

Joined Aug 7, 2008
5,784
Eliminating trailing lights involving a FF opens a really big can of worms. As I envision it, each PIR
would have a FF, 2- 3 input ANDs, 2- 2 input ANDs, 2 LED drivers, & 2 blocking diodes. S1 & S8
could turn on a bus line for up & down. Only one person at a time allowed, but if we eliminate the FFs both directional bus lines can be high at the same time allowing both directions & we eliminate 2 ANDs and shrink the other 3 input AND to 2 input. Still a lot of wire. The step with a SW as origionally shown is not illuminated ?
Now I know why we have a DELETE button.
 

eetech00

Joined Jun 8, 2013
3,960
How much of all that interconnecting wiring can be handled in software? All those inputs from each motion sense module and every output to each LED string? The hard part is often the connection between software and the real world, (AKA the physical world.) I count 16 levels, and so 16 sensors, possibly, and at least 16 separate LED groups. THat is 32 I/O minimum, assuming no manual controls. That processor board and it's FRAGILE I/O board and all of those wires and the power supply have to live someplace. That part can not "be handled in software."
That is why the original suggestion of adding one 14 pin IC per PIR module to handle it all made sense.
No one said eliminate all the hardware and put in the arduino. The TS brought up the Arduino...not me. :)
I did mention that a uC would be good for this project and I stand by that. I like working with HW but to me this project has uC written all over it. Obviously, interconnecting wire can't be put in software. But you practically can put most of the rest in software if you really wanted to. All this really depends on how much control over the sensor input and timer/lamp output is desired.
It would be trivial for a uC to handle all the logic.

One thing the TS hasn't clarified is the expected operation under different movement scenario's and for different number of persons occupying the stairs. Until that is known, the design can't be completed.
 

MisterBill2

Joined Jan 23, 2018
18,590
The final circuit as it works, but with one extra IC, a triple 3-input OR gate , and changing the driver transistor to an MPSA13 so that the gate can fully drive it, is all that each step, or group would need. The outputs to link the steps will come direct from the motion detector module, the outside signals will come from the two above and the two below. The the 3 input ORs will feed the third one wired as a two input or gate., and that will feed the transistor to light the local LED. Why make it so complicated??? And if a sort of different mode is wanted then plug in a triple 3 input AND gate, and replace the third gate with a 2-diode OR function..
 
Top