Seeking a packaged line (~~60hz) frequency [or period] counter with I2C or SPI output to feed a Mega2560 box. The goal is to monitor a b/u generator's speed.
Suggestions?
Seeking a packaged line (~~60hz) frequency [or period] counter with I2C or SPI output to feed a Mega2560 box. The goal is to monitor a b/u generator's speed.
Suggestions?
-- A host is a host from coast to coast.................wb8foz@nrk.com & no one will talk to a host that's close..........................
why not use the Mega2560 to measure the period?
That's a possibility we're considering....
-- A host is a host from coast to coast.................wb8foz@nrk.com & no one will talk to a host that's close..........................
Yes, Mega2560 is probably good enough. The question is what you are going to do with the data? I assume you need to send it to a more powerful computer (server) somewhere.
All the "frequency" oriented things I have seen with SPI in the PI universe are pulse train oriented. If you can get the AC waveform down to pulses, that might work. But that's out of the frying pan into the fire.
You might be able to make do with a lesser processor; not sure.
Clip the waveform, use a diode pair after the clipper to feed two PIO - one for up, one for down. Be careful of voltage and current range on the PIO. I'd have to headscratch a bit on the clipper - you want a pretty hi-Z output.
I'd have to think isolation thru on something like this. Might use optos. Dunno yet.
You'd prefer that this turn on and off at pi/4, 3pi/4,
5pi/4 and 7pi/4. That's negotiable through oversampling. For production, I might use digital pots to tune the duty cycle.I'd butch the clipper/diode setup up and watch it on a scope for a while to make sure it's not gonna damage the PIO or itself. Buy enough parts to make three. Again, not being a hardcore analog guy, I'd have to think about isolation and the like.
That gives you up to four time measurements per cycle. The critical design element then becomes choice of filters.
Arduino has a library function called "micros()" that returns a
32 bit upcounter w/ resolution of 4 or 8 microseconds. It rolls over at like 70 seconds @ 16MHz.-- Les Cargill
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.