Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

filtering sinusoidal digital signal in arduino

Status
Not open for further replies.

adezie

Newbie level 4
Joined
May 10, 2020
Messages
6
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
58
greetings, i have designed my own ZMPT101B to detect AC voltage, but I got some problem with reading the signal, here's the waveform using arduino plotter aa.JPG
does any one of you know how to only detect VPP of the signal ?bb.JPG
 

Hi,

Read a lot of samples.
* check for min value
* check for max value

Klaus
 

Use an analogue peak detector and you can sample at low speed.

Something likes this:
peak.jpg
 
  • Like
Reactions: adezie

    adezie

    Points: 2
    Helpful Answer Positive Rating
By evaluating the min and max value as Klaus suggested should usually do the job. Unfortunatly your signal can be interpreted as two sinewaves ("two channels") with an offset.

I'm more curious why your signal doesn't looks as it should, namely a sinewave. What's the signal frequency? I think the maximum arduino (uno) ADC sample frequency is 125 kHz. Do you acquire a whole array (set of samples) at once befor they are sent to the PC?

greets

- - - Updated - - -

Ok, by using analogRead() the arduino ADC sample rate is even lower:

On ATmega based boards (UNO, Nano, Mini, Mega), it takes about 100 microseconds (0.0001 s) to read an analog input, so the maximum reading rate is about 10,000 times a second.
 
  • Like
Reactions: adezie

    adezie

    Points: 2
    Helpful Answer Positive Rating
Your bit time appears to be ~ 100 uS, but the sig riding on top of sine is ~ 22x faster, maybe 200 Khz ?

You can either sample faster, at least 2x the 5 uS, or average. Latter causes latency to detection.

There are processors out here with SARs on them that can handle 1 Msps easily, just a thought.


Regards, Dana.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top