element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Arduino
  • Products
  • More
Arduino
Arduino Forum Problem with arduino analog input, not a pure sine wave signal
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Arduino to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Suggested Answer
  • Replies 8 replies
  • Answers 4 answers
  • Subscribers 391 subscribers
  • Views 2386 views
  • Users 0 members are here
  • arduino uno
  • sinewave
  • labview
  • analog inputs arduino
Related

Problem with arduino analog input, not a pure sine wave signal

exzibit
exzibit over 8 years ago

Hello everyone,

I've searched the web for about a week trying to find a solution for my problem.

As the title says I am trying to read an AC 50Hz sine wave from the analog input pins, and display it on my computer by using LabView, problem is that I can't get a normal sine wave signal, I'll upload pictures that show my sine wave, and my program (vi) in LabView. Does anyone know how to get a pure sine wave? Thank you in advance.

 

image

imageimage

  • Sign in to reply
  • Cancel

Top Replies

  • jc2048
    jc2048 over 8 years ago in reply to Jan Cumps +3 suggested
    As another possibility, could it be down to the Arduino A/D being ratiometric, with the supply as the reference? Poor layout and decoupling, which is a very likely difference between the two, would put…
  • dougw
    dougw over 8 years ago +2 suggested
    Hi, The waveform may look "jerky" but probably only has 1 or 2 % distortion. It looks like the signal is noisy. Note how it is less apparent where the signal is steep. It looks to me like the noise is…
  • exzibit
    exzibit over 8 years ago in reply to exzibit +2
    I have found a cause of my problem. The arduino that I was using wasn't an original arduino, and when I replaced it with an original one it worked perfectly. Thank you Douglas Wong for your help.
Parents
  • dougw
    0 dougw over 8 years ago

    Hi,

    The waveform may look "jerky" but probably only has 1 or 2 % distortion.

    It looks like the signal is noisy. Note how it is less apparent where the signal is steep. It looks to me like the noise is at a higher frequency than your sampling frequency, which makes it hard to see the noise frequency.

    What kind of signal conditioning circuit are you using?

    Do you have a transformer? Is there a low-pass filter? Are there large value resistors in the circuit? Are the wire leads separated and long?

    Can you post a picture of the setup?

    If you take samples at a much faster rate, (or look at it with an oscilloscope) you may be able to see the frequency of the noise.

    It should be fairly easy to implement a low-pass filter on the signal to attenuate the noise. You could even implement a digital filter in software.

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • exzibit
    0 exzibit over 8 years ago in reply to dougw

    Hello,

    I do have a transformer, it's a 230V prim, and 6V sek, 1.5VA , but I don't have a filter, my circuit is just a transformer with a voltage divider, and an arduino Uno, I'll upload a picture of my setup, and a schematic which shows resistors values. As you can see I don't have an original arduino, but so far it has worked perfectly.

     

    Thank you for the reply.

    image

    image

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • exzibit
    0 exzibit over 8 years ago in reply to exzibit

    I have found a cause of my problem. The arduino that I was using wasn't an original arduino, and when I replaced it with an original one it worked perfectly. Thank you Douglas Wong for your help.

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Jan Cumps
    0 Jan Cumps over 8 years ago in reply to exzibit

    That's a strange cause. Your non-original has the same microcontroller (=the same ADC) and is also xtal clocked.

     

    Looking at your LabVIEW screen, It looks like sampling jitter more than ADC errors (although the controller shouldn't have jitter issues with a 50-60 Hz signal).

    The xtal on your clone has to be very bad to cause this type of sample artifacts.

     

    The other thing that could cause this is the UART implementation on the clone, or different baud settings when switching between clone and genuine.

    You're using serial comms to exchange data with the PC. If that doesn't go fast enough, it can explain the jitter.

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • jc2048
    0 jc2048 over 8 years ago in reply to Jan Cumps

    As another possibility, could it be down to the Arduino A/D being ratiometric, with the supply as the reference? Poor layout and decoupling, which is a very likely difference between the two, would put the poster in the situation where they were measuring the reference variations (supply noise) as well as the signal.

    • Cancel
    • Vote Up +3 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • Jan Cumps
    0 Jan Cumps over 8 years ago in reply to jc2048

    I was thinking about noise too, but with the approx. 11K load between analog in and GND, the noise has to be fairly strong to impact the signal that much.

     

    edit: if I recall my theory well, the input impedance is less than 1K and not approx. 11K, because impedance-wise, the resistance between 3V3 and GND is close to 0 ohm. It would be good to correct me if I'm off here...

     

    edit 2: I'm not sure what the role is of the lower 10K resistor. It doesn't play a role in the voltage divider because it's a load between the fixed 3V3 and GND.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • exzibit
    0 exzibit over 8 years ago in reply to Jan Cumps

    The 10k resistor between a 3.3v port, and a GND port is to prevent any current flow towards the ground. The arduino that i bought was pretty cheap so that might explain my previous problem.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Reply
  • exzibit
    0 exzibit over 8 years ago in reply to Jan Cumps

    The 10k resistor between a 3.3v port, and a GND port is to prevent any current flow towards the ground. The arduino that i bought was pretty cheap so that might explain my previous problem.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Children
No Data
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube