Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

*psssssst* anyone know how to convert one long pulse into lots of little ones?

Status
Not open for further replies.

dazzlepecs

New Member
I shouldnt ask this because im in 4th year Electrical eng lol






but i have one long pulse from a sonar output (pulse length = wait before sonar trigger and echo IE range).. I cant count this in real time with my K8055 board using software (too slow AFAIK) so i want to use this HIGH signal to enable an oscillator or suchlike, and obviously it goes LOW when output pulse from sonar output is LOW, so i can count the oscillations while the output pulse is HIGH with the K8055 pulse counter and work out the range




any simple ideas how i can do this? As simple as feasibly possible?




thanks for any help or tips
 
Last edited:
I don't understand what you mean by your software is too slow to measure the echo pulse because the speed of sound is very slow compared to an MCU. Usually the problem is that the MCU is too fast and requires too large a counter register to easily measure something as slow as an ultrasonic echo. You could just tie several registers together. And every time a smaller register maxes out, it resets and increments the next largest register.

But the type of device you are describing...wouldn't it simply be a fixed frequency oscillator that is using the echo pulse as an enable/disable. An oscillator that has an integrated enable/disable can do this (obviously). But if said oscillator takes too long to start up after being enabled, then a regular (always running) oscillator can simply be fed into one input of an AND gate and the echo pulse fed into the other input of the AND gate. The result is that the AND gate passes the oscillator value whenever the echo pulse is HI, allowing it to serve as an enable.

EDIT: I just noticed you already described your device in terms of an oscillator using the pulse echo as an enable signal...well if the oscillator does not have an integrated enable, then using an AND gate like I described is the way to do it.
 
Last edited:
I don't understand what you mean by your software is too slow to measure the echo pulse because the speed of sound is very slow compared to an MCU. Usually the problem is that the MCU is too fast and requires too large a counter register to easily measure something as slow as an ultrasonic echo. You could just tie several registers together. And every time a smaller register maxes out, it resets and increments the next largest register.

But the type of device you are describing...wouldn't it simply be a fixed frequency oscillator that is using the echo pulse as an enable/disable. An oscillator that has an integrated enable/disable can do this (obviously). But if said oscillator takes too long to start up after being enabled, then a regular (always running) oscillator can simply be fed into one input of an AND gate and the echo pulse fed into the other input of the AND gate. The result is that the AND gate passes the oscillator value whenever the echo pulse is HI, allowing it to serve as an enable.

EDIT: I just noticed you already described your device in terms of an oscillator using the pulse echo as an enable signal...well if the oscillator does not have an integrated enable, then using an AND gate like I described is the way to do it.

as far as i can tell the software (VIsual basic) has to go through the mscomm then through the USB then into the K8055 then test the pulsecounter for a change and it just will not give me a good resolution.. the pulsecountertest and digitalin function is only good for about 45 hertz



your idea with the AND gate is excellent :D I wish i could think like that!!

many thanks
 
Last edited:
One thing to take into consideration is if your inputs to the gate are asyncronous, then you will likely get small glitches on the leading and/or trailing chain of pulses at the gate output.
 
One thing to take into consideration is if your inputs to the gate are asyncronous, then you will likely get small glitches on the leading and/or trailing chain of pulses at the gate output.

you mean runt pulses? Good point. I can just throw in a data syncer i guess
 
Here is an "AND" composed of two gated oscillator circuits. If EN1 is high both oscillators start working at different frequencies The second ENABLE is controlled by the first output.

The frequency pattern is drawn in the schematic. Frequencies are 290 and 1447Hz.

Boncuk
 

Attachments

  • GATED.gif
    GATED.gif
    7.3 KB · Views: 143
Last edited:
That will work well and is fine unless you're bothered about the number of pulses per pule.

If you need exactly four pulses then you're stuck because the component tolerances will mean it could be three pulses or five pulses.

Try simulating it again with the some of the resistors out by 5% and some of the capacitors out by 10% and you'll se what I mean.
 
Here is an "AND" composed of two gated oscillator circuits. If EN1 is high both oscillators start working at different frequencies The second ENABLE is controlled by the first output.

The frequency pattern is drawn in the schematic. Frequencies are 290 and 1447Hz.

Boncuk

wow thats impressive man.. I will have to study it for a while to try and understand exactly what its up to

That will work well and is fine unless you're bothered about the number of pulses per pule.

If you need exactly four pulses then you're stuck because the component tolerances will mean it could be three pulses or five pulses.

Try simulating it again with the some of the resistors out by 5% and some of the capacitors out by 10% and you'll se what I mean.

as its a range finder it can just be calibrated to 1 foot = however many pulses?
 
Status
Not open for further replies.

Latest threads

Back
Top