Maker Pro

Trying to get a PIR activation to increment a 7 segment display correctly

Any advice?

  • solution

    Votes: 0 0.0%
  • change

    Votes: 0 0.0%

  • Total voters
    0

Phil Dee

Oct 12, 2017
2
Joined
Oct 12, 2017
Messages
2
I am new to hobbyist electronics. I have followed a pir circuit and been able to activate a linear reed relay that will operate a new different circuit; pir activates and starts a dashcam recording. The problem I have now is that I want to count how many times the pir activates. I have followed a circuit for a 7 segment display that will increment the display one digit at a time (more times than not) as a single digit and a two digit circuit, with a reset button. I am now trying to mix the two circuits together to get an accurate count of the activations. The problem is, the pulse that comes from the first circuit is not quick enough to give one increment on the display. Obviously I am not understanding the word PULSE, I am trying to get each TRIGGERING to act as one pulse, if you catch my drift, and this is the limit of my knowledge, please educate me a little in order for this old man, 68, to complete a project, thanks. I have attached a drawing (in a fashion) of both circuits and the connection point that I am trying to use. Please keep it simple like me.BothCircuits.png
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,722
Joined
Nov 17, 2011
Messages
13,722
the pulse that comes from the first circuit is not quick enough to give one increment on the display.
Next to impossible. A relay is muuuuuuch slower than a CMOS counter. Your problem is elsewhere.

  1. Is the relay activated? You should hear it click when the pir sensor becomes active.
  2. If so, does the signal from the relay arrive at the counter IC? You can check this easily by using e.g. 470 Ω for the resistor from pin 1 of the 4026 to 0 V and putting an LED in series with this resistor. You should now see the LED off when the relay is off, the LED on when the relay is on.
  3. The next issue you'll encounter is contact bounce. The relay contact will give more than one clock pulse to the 4026 when opening or closing. If you don't want to add a complete debounce circuit, try at least a small capacitor (e.g. 10 nF) from pin 1 of the 4026) to 0 V. You may need to experiment with capacitor values.
    If this doesn't work out, you'll have to add a debounce circuit using e.g. a Schmitt-Trigger gate as shown on the web page I linked.
Unrelated to the issue of counting: using a single current limiting resistor in the ground line of the 7 segment display is not a good idea. Brightness of teh display will vary with the number of active segments as they need to share the current throughthis resistor. Rather connect GND of the display to 0 V and use a single current limiting resistor fpr each segment. Observe the max. current each output can drive acoording to the datasheet.
 

hevans1944

Hop - AC8NS
Jun 21, 2012
4,880
Joined
Jun 21, 2012
Messages
4,880
Ah, the "fun" of interfacing high-speed CMOS logic with the real world. I was gonna respond to this thread, but Harald beat me to it with a very good explanation. ALWAYS de-bounce mechanical switch contacts before attempting to use the contacts to create clocking events. There are many ways to do this, but for slowly changing contact states (people counter, for example) I favor the re-triggerable one-shot multivibrator. Set the interval long enough to include all possible contact bounce transitions that occur for each event you want to count. When the one-shot eventually times out and is no longer being re-triggered by switch contact bounce, it will complete the clock transition necessary to generate a single clock event for the counter.
 

Phil Dee

Oct 12, 2017
2
Joined
Oct 12, 2017
Messages
2
Hi Guys,
Thanks for the response, it has been really helpful, and I have been able to solve the problem, in a fashion; now with the alterations, as shown below, I can get a "clean" single pulse to increment the display by 1 at a time, albeit after the activation i.e. when the pir resets. which is absolutely fine as it accurately counts each activation as required.
Regards from Phil.BothCircuitsModified.png
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,722
Joined
Nov 17, 2011
Messages
13,722
Nice work.
Note that the 1 µF capacitor on the clock line is too large. Together with the series resistors it will create a rather slow 'edge' on the clock line. This will incerase sensitivity of the 4026's clock input to noise. I suggest you try a smaller value for this capacitor, e.g. 100 nF only. If it doesn't work due to heavy contact bounce, you can always revert to 1 µF.
 
Top