Pages: 1 [2]   Go Down
Author Topic: Incorrect analogread readings  (Read 601 times)
0 Members and 1 Guest are viewing this topic.
Johannesburg UTC+2
Offline Offline
Faraday Member
**
Karma: 60
Posts: 3242
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Have you looked for answers in the Learning, Reference, Products and Playground tabs on http://arduino.cc/en/ ?
Look here http://electronicsclub.info/ for basic electronics

Poole, Dorset, UK
Offline Offline
Edison Member
*
Karma: 25
Posts: 1872
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Mark
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 29
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Poole, Dorset, UK
Offline Offline
Edison Member
*
Karma: 25
Posts: 1872
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Try 700 readings in a burst not just 100.

Mark
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 29
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 331
Posts: 16459
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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. smiley-wink

Lefty
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 29
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

UK
Offline Offline
Shannon Member
****
Karma: 183
Posts: 11114
-
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

I only provide help via the forum - please do not contact me for private consultancy.

Pages: 1 [2]   Go Up
Jump to: