Go Down

Topic: Incorrect analogread readings (Read 772 times) previous topic - next topic

JimboZA

Quote
It's a 60Hz signal so a run of 100 samples at 9000Hz will only see part of one cycle.


Yes, but you don't know where it started, so "part of one cycle" doesn't mean all on the same slope
Arduino ethernet server here.... http://jimboza.gotdns.com:8085/

No PMs for help please

holmes4

But it does mean 100 reading taken over part of one cycle.

Mark

NickPatey

Actually i think it would be pretty easy to incorporate a peak detection aspect into my sketch, that would detect the positive peak, start streaming data, then restart the stream at the next positive peak (might have to have it detect the first positive peak, then the following trough, and THEN the end peak though).

Im still not fully sure WHY i need this synchronization though, unless the phase of the AC signal is shifting aroung, which might be what you guys are getting at.

holmes4

Try 700 readings in a burst not just 100.

Mark

NickPatey

Holy sweet mother of god, 700 give me a perfectly cyclic stream of data, i dont know how to thank you man, this saved me.

ALTHOUGH, the upper range on my data is still above the correct value by around 0.5V which baffles me honestly.

retrolefty


Holy sweet mother of god, 700 give me a perfectly cyclic stream of data, i dont know how to thank you man, this saved me.

ALTHOUGH, the upper range on my data is still above the correct value by around 0.5V which baffles me honestly.


Well if you lack or fail to understand the fundementals involved in waveform sampling, you may stumble across something that works but you will not have learned anything worth remembering. But again it's your project and your goals. ;)

Lefty

NickPatey

The sad part is im a 3rd year electronics student hahaha.

I think i may know why my upperrange values are off, i have to go to class now but i will post later to report if my theory was correct.

PeterH


I think i may know why my upperrange values are off


I would suspect that either your analog reference is inaccurate, or your arithmetic is flawed (perhaps a rounding error).

I suggest you connect a known constant DC voltage and see whether the analog reading give you the correct value and then whether your arithmetic produces the correct voltage for that input value.
I only provide help via the forum - please do not contact me for private consultancy.

Go Up