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 snipped-for-privacy@nrk.com & no one will talk to a host that's close.......................... Unless the host (that isn't close).........................pob 1433 is busy, hung or dead....................................20915-1433
Didn't find your answer? Ask the community — no account required.
L
Lasse Langwadt Christensen
why not use the Mega2560 to measure the period?
D
David Lesher
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..........................
Unless the host (that isn't close).........................pob 1433
is busy, hung or dead....................................20915-1433
E
edward.ming.lee
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.
L
Les Cargill
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.
formatting link
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.
formatting link
8x oversampling for 60Hz is 960Hz - a very long time @ 16MHz. That should satisfy Nyquist although the duty cycle might be off. You'll have to consider the time to output to the USB serial port....
Les Cargill
Join the Discussion
Have something to add? Share your thoughts — no account required.
Didn't find your answer?
Ask the community — no account required
Report Content
You are reporting this content to the moderators. They will look at it
ASAP.