Author Topic: How can I count the number of middle pulses from the given signal  (Read 1917 times)

0 Members and 1 Guest are viewing this topic.

Offline KerimF

  • Regular Contributor
  • *
  • Posts: 193
  • Country: sy
Re: How can I count the number of middle pulses from the given signal
« Reply #25 on: July 12, 2024, 05:11:40 pm »
If it is my project, I would simply take advantage of the water’s conductance (assuming it is not pure).

I mean, two electrodes and a small MOSFET can interrupt the MCU at each drop.
The power consumption of such a counter is the lowest, I guess.

Kerim
A philosopher: A living thing has no choice but to execute its pre-programmed instructions embedded in it (known as instincts).
Therefore, the only freedom, a human may have, is his ability to oppose or not his natural robotic nature.
But, by opposing it, such a human becomes no more of this world.
 

Online PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 1843
  • Country: au
Re: How can I count the number of middle pulses from the given signal
« Reply #26 on: July 12, 2024, 09:03:17 pm »

3rd photo:
I've recently tried to modulate the IR LED.
Here I'm doing 1kHz at 20% duty.
Highlighted is the signal pattern on there is a water droplet passing by.
In this case the average current is within my power budget.
However, I'm not really sure if I can count the drops using this approach.

As long as you have a clear change in signal, you can certainly sense and count.

You should repeat the captures for all expected ambient light conditions, as unwanted light will certainly affect this, and some mounting apertures would help reject stray light.

It would help to have the LED and Photo transistor part numbers.

Addit : if you need more immunity from lighting, you could also look at the IR receivers designed for Code Learning (or IR repeaters, they look similar)

https://www.vishay.com/en/ir-receiver-modules/

Those have wider bandwidth/faster response than the data burst IR receivers, and their shorter range of ~ 1.8m is still well above your target distance.
Their Icc of 350uA gives you a reference point for your Photo transistor too.

« Last Edit: July 13, 2024, 05:56:13 am by PCB.Wiz »
 

Offline Benta

  • Super Contributor
  • ***
  • Posts: 6221
  • Country: de
Re: How can I count the number of middle pulses from the given signal
« Reply #27 on: July 12, 2024, 09:43:01 pm »
Simple solution:
1: square up the signal (comparator, Schmitt trigger, whatever...)
2: use a NON-retriggerable, positive-edge, monostable multivibrator (eg, 74HC221) and set the time to be longer than the spike and the following positive edge.

Done.

 

Online PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 1843
  • Country: au
Re: How can I count the number of middle pulses from the given signal
« Reply #28 on: July 13, 2024, 05:54:30 am »
I found the part I remembered - the Sharp IS471Fx - that's a IR Receiver, similar to any remote control RX, but with a couple of tweaks.

  • Sharp add a 4th pin to drive a LED with narrow duty pulses. ~ 8kHz
  • The RX side includes a sync detector that gives high ambient light immunity.

https://www.sharpsde.com/products/optoelectronic-components/model/is471fe/


The Icc is not great, but you could use some to test with, to compare results.
 

Offline ledtester

  • Super Contributor
  • ***
  • Posts: 3249
  • Country: us
Re: How can I count the number of middle pulses from the given signal
« Reply #29 on: July 14, 2024, 03:57:54 am »
Another approach to eliminate the variation due to ambient light:

https://forums.parallax.com/discussion/comment/794922/#Comment_794922

Quote
It is possible to use an optical (ir led/phototransistor) to detect transparent materials as pointed out previously. A drop or stream of liquid will refract the beam and produce a signal on the output. This type of detector has been used to detect clear plastic test tubes on a conveyor with very good results. It was done by having an op amp control the current to the emitter so that the output from the detector was at approximately 50% of the supply voltage, and using another op amp as a comparator to detect fluctuations when a tube refracted the beam.

And in a follow-up reply...

https://forums.parallax.com/discussion/comment/795031/#Comment_795031

Quote
The circuit is fairly simple. The first op amp and transistors Q1, Q2 maintain the current through the LED (CR1) at a value that produces 2.5V across the resistor on the detectors (Q10) emitter. Capacitors C1 and C2 (250uF) act as a low pass filter.
The second op amp is used as a comparator and provides a positive pulse to the base of Q3 when the voltage on the emitter of Q10 drops below 2.25V.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf