Pages: [1]   Go Down
Author Topic: SOLVED arduino signal != CRO signal;  (Read 521 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello guys,

I have a serious issue here. I have a signal (5V)  as shown


If I zoom to 5ns/div, then we can see some tiny noises between 4.9V and 5.0V or so as shown


Note that these pictures are given when I connect the signal to an oscilloscope.

Now the interesting part!
If I connect this signal to the digital port and load the example sketch DigitalReadSignal (File>Examples>01.Basics>DigitalReadSignal), then I get a series of zeroes and ones as the output (Actual Output: 1 0 0 0 1 1 1 0 0 0 0 0 1 1 1 0 0 0 1 1 0 0 0 1 0 1). Founding this bizarre, I connected the signal to the analog port and then I loaded the arduinoscope sketch. I got the following result


Now if I use the 5V line from the arduino, then I get the correct 5V reading on the serial monitor. The same goes for GND. But when I connect my signal, everything is a total mess in the arduino!!!

What I did to try to rectify this which I failed miserably and as a last resort, I posted here:
1. Change interface from Linux to Windows. In linux, I am using Arduino 1.0.2 version while in windows I am using 1.0.3 version.
2. Change from Arduino Uno to Arduino Uno R3
3. Change USB cable
4. Tried to search this forum for hints


Can someone guide me on this? Also, I hope this post is in the correct forum. If not, please change it accordingly.

Thanks
« Last Edit: January 22, 2013, 11:04:56 am by zaftheman » Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 601
Posts: 48543
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
If I connect this signal to the digital port and load the example sketch DigitalReadSignal (File>Examples>01.Basics>DigitalReadSignal), then I get a series of zeroes and ones as the output (Actual Output: 1 0 0 0 1 1 1 0 0 0 0 0 1 1 1 0 0 0 1 1 0 0 0 1 0 1). Founding this bizarre
What code? What is generating this signal? Did you connect the grounds, too?

I don't find the output bizarre, if you didn't connect the grounds, or set the pin mode correctly, or a number of other possible problems.

Logged

0
Offline Offline
Shannon Member
****
Karma: 200
Posts: 11718
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'd also vote for a lack of common grounds - you don't have a circuit if you don't connect ground as well, a circuit needs two wires.

When you connect only one wire you are using one circuit as an antenna for the other.  Typically you will pick up mains interference.
Logged

[ I won't respond to messages, use the forum please ]

Manchester (England England)
Online Online
Brattain Member
*****
Karma: 603
Posts: 33397
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

It also looks like you are trying tool okay a signal too fast for your scope, or at least the settings you have on the scope.
Logged

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

I checked the grounds again and it is brilliantly working now.

Thanks for the help!!!
Logged

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

What code? What is generating this signal? Did you connect the grounds, too?

I don't find the output bizarre, if you didn't connect the grounds, or set the pin mode correctly, or a number of other possible problems.

Your answer was top notch PaulS.

Thank you!!!
Logged

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

I'd also vote for a lack of common grounds - you don't have a circuit if you don't connect ground as well, a circuit needs two wires.

When you connect only one wire you are using one circuit as an antenna for the other.  Typically you will pick up mains interference.

Exactly what I was picking: mains interference!

Thanks for your help!
Logged

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

It also looks like you are trying tool okay a signal too fast for your scope, or at least the settings you have on the scope.

I was thinking along that line at first. I used a better scope after and nothing changed.

It was a ground issue after all.

Thanks for reminding about the speed of scopes.
Logged

Pages: [1]   Go Up
Jump to: