Pulse detector

) is

de and capacitor

n a peak

ative rail.

t software find the valid pulse measurements and you are done.

uring the pulses, but still, not sure what that implies. Does he want data to be sent to another computer? Does this need to drive a display? Is he looking for real time updates of each pulse? An average of some sort? Is the pulse height varying? Sounds like he wants window comparisons to prod uce a decision of some sort? All of the above is very easy to do in the sa me $0.60 MCU that is taking the measurement. It can send an output via RS-

232, TTL signals, RF pulses or an amplitude modulated audio tone. It can e ven provide the universally hated output, a blinking LED.

to solve".

Don't need to count pulses. I know there will be 1000 pulses per second. just need to know the signal voltage level, in order to drive some switches . The ideal diode (driven by op-amp) should be good enough. Too much trou ble to program micro, if a few passive parts can do the job.

Reply to
edward.ming.lee
Loading thread data ...

Yes. Like a simple 8 bit 8 pin micro to detect both at once if size is an issue. Capture-Compare and A/D if the part has that capability

Then some way to output that information.

Reply to
boB

Using micro, there are software programming effort and production programming effort. Furthermore, there are voltage level shifting from/to 12V. Running 12V passive and/or op-amp might be easier.

Reply to
edward.ming.lee

es) is

iode and capacitor

hen a peak

egative rail.

y

let software find the valid pulse measurements and you are done.

asuring the pulses, but still, not sure what that implies. Does he want da ta to be sent to another computer? Does this need to drive a display? Is he looking for real time updates of each pulse? An average of some sort? Is the pulse height varying? Sounds like he wants window comparisons to pr oduce a decision of some sort? All of the above is very easy to do in the same $0.60 MCU that is taking the measurement. It can send an output via R S-232, TTL signals, RF pulses or an amplitude modulated audio tone. It can even provide the universally hated output, a blinking LED.

ng to solve".

just need to know the signal voltage level, in order to drive some switch es. The ideal diode (driven by op-amp) should be good enough. Too much tr ouble to program micro, if a few passive parts can do the job.

I'm the other way. I would never use so many passive parts when a single M CU and a bit of simple programming could do the job. If there is any volum e to the job you can buy the parts preprogrammed.

BTW, I wasn't thinking of any pulse counting. The passive solution will us e some six to ten times the board space and might cost two or three times a s much and potentially be sensitive to manufacturing variations or other fa ctors. There's more than one reason why so much analog has been replaced b y digital.

Some years ago (maybe 20) I was talking with a girl friend about potential stocks to buy (who was no dummy at all, but not familiar with electronics). I mentioned Analog Devices might be a good pick for that time (might have been the post .com bubble recovery). Her response was, wouldn't they be g oing out of business...? analog you know. I had to explain to her that in some ways analog would never go away, just more and more encroached upon. Besides, they do a lot of digital too, they've been in business a long tim e (for electronics).

This is one of those "encroachments" that I think the digital solution is p rime for. You already spent significant time putzing around looking for a proper circuit. The program could have been written by now. Let's see if I remember my C, I program in Forth and VHDL these days.

#include #include #include // include your device specific libraries

void init_adc( int value ) { --lib_func--( value ); // lib code } unsigned int read_sample( void ) { return ADC_Sample( AD12_CH0 ); // lib code }

void init_timer( int value ) { --lib_func--( value ); // lib code } void wait_timer( ) { --lib_func--( ); // lib code } unsigned sample_input (unsigned maxval, minval, *maxval_new, *minval_new ) { unsigned sample; wait_timer( ); sample = read_sample( void ); if ( sample > maxval ) { maxval_new = sample; } else if ( sample < minval ) { minval_new = sample; } return (sample); }

// stuff to control outputs based on the pulse amplitude. void cntl_outputs ( unsigned maxval, minval ) { user code goes here! };

const unsigned mid_adc = 2048; // 12 bit ADC const unsigned 90pct_cnt = 90; // 100 smpls/pulse per const unsigned 110pct_cnt = 110; // 100 smpls/pulse per

int main () { int time; unsigned sample; unsigned threshold = mid_adc; unsigned maxval = mid_adc; unsigned minval = mid_adc; unsigned maxval_new = mid_adc; unsigned minval_new = mid_adc;

init_adc( 1 );

init_timer( 10 ); // 10 us, 10 per pulse time, 100 per cycle

while ( 1 ) { // Measure the pulse peak for ( time = 0; time < 90pct_cnt; time++ ) { sample = sample_input (maxval, minval, &maxval_new, &minval_new ); }

do { // Sync to the falling edge of the pulse time++; sample = sample_input (maxval, minval, &maxval_new, &minval_new ); } while ( (sample > threshold) and (time < 110pct_cnt) );

// update data from prior pulse threshold = ((maxval - minval) / 2); maxval = maxval_new; minval = minval_new; maxval_new = threshold; minval_new = threshold;

cntl_outputs ( maxval, minval ); } }

This algorithm may take a few cycles to get aligned to the pulse high and l ow levels. You can add a bit of logic at the end to keep the output contro ls safe until the threshold is not defining either level and it is aligned to the pulse. I have no info on what the output controls will need to do.

I'm not sure this took me an hour to write and most of that was trying to r emember the details of C.

--

  Rick C. 

  +- Get 1,000 miles of free Supercharging 
  +- Tesla referral code - https://ts.la/richard11209
Reply to
Ricky C

Yes, all true...

How you get this done also depends on time to get it done, which even with a micro could be quick AND space requirements.

Also, is it for production ? A few or a lot ? You can get micros programmed from the distributer as well. Getting 12V down to 3.3V or

5.0V is pretty easy and cheap.

How about repeatability ? A bunch of analog circuitry can be harder to debug if you don't havve good techs. Using zeners and comparators will not always be perfect. Maybe use a TL431 or two to get the compare levels.

All compromises. You know which ones are important for your application of course.

Good luck and we'll be waiting to see what you end up with and if it works well.

Reply to
boB

rote:

m

waveform.

:

ltmeter/

the peak DC voltage of an

et, or do you want to

very descriptive.

signal.

ouple of examples.

-detector/

an R-C

the

ead of "pulse detector". It's just a simple sample and hold of the input, then using several comparators to trigger on the voltage level.

e chip, as small as 8 pins.

ming effort. Furthermore, there are voltage level shifting from/to 12V. R unning 12V passive and/or op-amp might be easier.

You mean the pulse is 12 volts??? Isn't that completely trivial? Two resi stors and you are done. If you mean the power supply, a simple three termi nal regulator in a SOT-23 gives you the voltage you need, there's another $

0.40.

I've already given you the code and the "production programming" is trivial . If you have a low volume production run it takes a very simple connectio n which can be done without a connector even. Or program the chip before a ssembly. For higher volumes you can buy the chips with your program in the m. The maker will do the programming.

If you think any of this is hard or complicated or expensive, I just don't think you are really trying.

--

  Rick C. 

  ++ Get 1,000 miles of free Supercharging 
  ++ Tesla referral code - https://ts.la/richard11209
Reply to
Ricky C

amming effort. Furthermore, there are voltage level shifting from/to 12V. Running 12V passive and/or op-amp might be easier.

Input is 6V to 12V. Also need to drive upto 12V output.

ean the power supply, a simple three terminal regulator in a SOT-23 gives y ou the voltage you need, there's another $0.40.

al. If you have a low volume production run it takes a very simple connect ion which can be done without a connector even. Or program the chip before assembly. For higher volumes you can buy the chips with your program in t hem. The maker will do the programming.

Volume not big enough for pre-programming.

t think you are really trying.

It's not difficult for me, but lots of hand holding for a small factory mak ing them. I have done it before, for more complicated device. But this dev ice is simple enough for discrete and passive.

Reply to
edward.ming.lee

ze

ty

gramming effort. Furthermore, there are voltage level shifting from/to 12V . Running 12V passive and/or op-amp might be easier.

mean the power supply, a simple three terminal regulator in a SOT-23 gives you the voltage you need, there's another $0.40.

vial. If you have a low volume production run it takes a very simple conne ction which can be done without a connector even. Or program the chip befo re assembly. For higher volumes you can buy the chips with your program in them. The maker will do the programming.

Then self programming can't be that big a deal. I looked into pre-assembly programming an FPGA and found it was practical even at lower volumes. But I didn't want to commit to a firmware design and we have no problem progra mming as part of board test. My device takes up to 30 seconds for the prog ramming and verification. That's time the worker spends on adding the seri al number. The total test time is around 3 minutes when there are no failu res. We have a semi-automated test fixture, the user has to press a key to say OK and touch a test point with a jumper wire for a test that wasn't de signed in.

n't think you are really trying.

aking them. I have done it before, for more complicated device. But this d evice is simple enough for discrete and passive.

Ok. Factories shouldn't have any trouble programming a device these days. Even if you don't buy the parts pre-programmed, you should be able to pre- program them yourself. Are you using surface mount or DIPs?

--

  Rick C. 

  --- Get 1,000 miles of free Supercharging 
  --- Tesla referral code - https://ts.la/richard11209
Reply to
Ricky C

om

e waveform.

V:

oltmeter/

?

the peak DC voltage of an

set, or do you want to

very descriptive.

e signal.

couple of examples.

k-detector/

an R-C

the

tead of "pulse detector". It's just a simple sample and hold of the input, then using several comparators to trigger on the voltage level.

le chip, as small as 8 pins.

mming effort. Furthermore, there are voltage level shifting from/to 12V. Running 12V passive and/or op-amp might be easier.

I will have to double check, but the accuracy might not be too important. Perhaps +/- 5% at 6V and 9V. I might not even need the op amp, but a Darin gton pair buffer to isolate the input. None of the RC values are too criti cal either. So, perhaps: QQDRC-CC-RRRR. Namely, two transistors feeding a diode than RC, then compare with four resistor voltage divider (9V, 6V and

3V).
Reply to
edward.ming.lee

.com

e:

3rd wrote:

cle waveform.

12V:

-voltmeter/

po?

ld the peak DC voltage of an

reset, or do you want to

ot very descriptive.

cle signal.

a couple of examples.

eak-detector/

be an R-C

en the

nstead of "pulse detector". It's just a simple sample and hold of the inpu t, then using several comparators to trigger on the voltage level.

ngle chip, as small as 8 pins.

e
y

ramming effort. Furthermore, there are voltage level shifting from/to 12V. Running 12V passive and/or op-amp might be easier.

Perhaps +/- 5% at 6V and 9V. I might not even need the op amp, but a Dar ington pair buffer to isolate the input. None of the RC values are too cri tical either. So, perhaps: QQDRC-CC-RRRR. Namely, two transistors feeding a diode than RC, then compare with four resistor voltage divider (9V, 6V an d 3V).

So you need to distinguish four voltage levels with some number of outputs? That will require at least three comparators and some amount of logic unl ess it happens that your outputs match thermometer outputs.

You say the volume is low so the design costs would trump the unit costs. The MCU still seems like the cheap road, but if you don't have any MCU fami liarity then not so much.

Do I misunderstand your outputs?

--

  Rick C. 

  --+ Get 1,000 miles of free Supercharging 
  --+ Tesla referral code - https://ts.la/richard11209
Reply to
Ricky C

il.com

ote:

cycle waveform.

h 12V:

se-voltmeter/

typo?

hold the peak DC voltage of an

u reset, or do you want to

not very descriptive.

cycle signal.

e a couple of examples.

-peak-detector/

aybe an R-C

to

when the

instead of "pulse detector". It's just a simple sample and hold of the in put, then using several comparators to trigger on the voltage level.

single chip, as small as 8 pins.

ize

ity

ogramming effort. Furthermore, there are voltage level shifting from/to 12 V. Running 12V passive and/or op-amp might be easier.

t. Perhaps +/- 5% at 6V and 9V. I might not even need the op amp, but a D arington pair buffer to isolate the input. None of the RC values are too c ritical either. So, perhaps: QQDRC-CC-RRRR. Namely, two transistors feedin g a diode than RC, then compare with four resistor voltage divider (9V, 6V and 3V).

s? That will require at least three comparators and some amount of logic u nless it happens that your outputs match thermometer outputs.

Yes, mostly just 9V and 6V.

Reply to
edward.ming.lee

What you have shown is a peak-grabber. It's simple and may do what you wan t, but it isn't a particularly good or safe solution.

You probably ought to reformulate your problem as a sampling question - you need to think about sampling your 1kHz 10% duty cycle waveform during the time when it is high.

Shannon says this means sampling at at least 20kHz. This would guarantee th at at least one in twenty of your samples was squarely in the high period o f the waveform. Mostly you'd get two, but there would be occasions where yo u'd sample in the rising edge and the falling edge and only get one good sa mple in between.

The fact that you are sampling means that you have to synchronise your samp ling process to the waveform.

Twenty samples per cycle would give you enough information to set up a phas e-locked loop to do that.

At 20kHz you could do all the processing in a cheap single chip microproces sor, which will usually offer a built-in A/D converter to do the sampling.

If you wanted to avoid using a microprocessor, and can live with a bulkier and more expensive solution, you could use a CD4046 to set up the 20kHz clo ck, which you'd have to divide down by 20 in some digital logic to get the

1kHz signal that you'd lock to your 1kHz waveform.

You can then decode the counter to generate a 1kHz sampling pulse (50 usec wide) which you could use to drive a sample and hold amplifier. The LF398 w ould do the job

formatting link
.pdf

but you could also set up a CD4066 transmission gate to do the sampling, an d pretty much any op amp to buffer the output and hold it between samples.

Hope this helps.

--
Bill Sloman, Sydney
Reply to
Bill Sloman

old germainium transistors... ick.

do you want peak to peak, or peak to ground?

--
  Jasen.
Reply to
Jasen Betts

maybe just feed the pulses to a voltage doubling rectifier with an offset ground and use the scaled output to drive an amitter follower. -+-- +12 |/ in -||----. +------10K---------+----| | | | |e +12---10K----+-->|-+-->|--+--||--+--10K---|

Reply to
Jasen Betts

Rather than analog peak hold followed by comparators have you considered having the comparators first and then latching their outputs?

piglet

Reply to
piglet

Measure the average and multiply by 10.

--

John Larkin         Highland Technology, Inc 

Science teaches us to doubt. 

  Claude Bernard
Reply to
jlarkin

The average what? This isn't specific enough to be in any way helpful.

--
Bill Sloman, Sydney
Reply to
Bill Sloman

What is the benefit of such arrangement? Instead of:

OpAmp(D),RC -> Comp-(10V),Comp+(8V) -> OpenCollectorDriver

Reply to
edward.ming.lee

It's not likely, but possible to have different duty cycles. So, it would get confused with 10% 9V and 15% 6v.

Reply to
edward.ming.lee

An analog approach could also get confused by small spikes in the signal unless you include filtering of the input signal. Or you can implement this in a digital approach with very little work and still a

Reply to
Ricky C

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.