Arduino Uno: Output for "digitalWrite(pin, HIGH)" is a sine wave

Hi,

I'm having some very unexpected trouble with my arduino uno (actually a SparkFun Redboard). Basically there seems to be a sine wave superimposed on all of my output signals for all of the output pins. When I just set a pin to HIGH, what comes out is a ~4V pk-pk ~120 Hz sine wave centered around ground. When I set a pin to a frequency using the tone function, I get a square wave of the correct frequency "centered around" the same sine wave (if that makes sense -- can't take pictures atm).

I could not seem to find any information on this issue online. Is my arduino broken? It was working a few days ago, and this issue seems to have come out of nowhere.

Thanks.

It sounds to me like a power supply problem. If you're powering it via the USB port, try using a different USB outlet, such as a phone charging block or another computer. Try powering it from 7 to 12 volts through the Vin pin or DC barrel jack. Try powering it from 3 AA batteries via the 5V pin. See how the sine wave thing goes in those 3 different scenarios. You can also try disconnecting any sensors or wiring external of the Redboard.

Sounds like you're picking up noise from the power line somehow....

How do you know that there is a sine wave superimposed on the output?
Are you using an oscilloscope to detect/measure this?

If so, I think you might have neglected to connect the ground clip on the oscilloscope probe to the Arduino GND pin.

Sounds more like a measurement error than hardware issue.

+1

I agree you haven't connected scope's ground to the ground of Arduino board or the ground wire of the probe is broken.