Hello, I have been trying to make a limited oscilloscope out of my arduino UNO to read the pulses of a 555 timer in astable mode by following this tutorial (http://www.instructables.com/id/Arduino-Oscilloscope-poor-mans-Oscilloscope/).
This works by connected a "probe" to the analog pin 0 (defined here as INPUT) and to the output of the signal to be tested. The arduino reads on pin A0 and another software takes the information and displays it on the computer screen.
Here is the code to be uploaded on the Arduino UNO :
#define ANALOG_IN 0
void setup() {
Serial.begin(9600);
//Serial.begin(115200);
}
void loop() {
int val = analogRead(ANALOG_IN);
Serial.write( 0xff );
Serial.write( (val >> 8 ) & 0xff );
Serial.write( val & 0xff );
}
My 555 circuit uses two resistors of equal resistance = 47 ohms and a capacitor of 1microF. I am thus expecting a square wave, oscillating between 5 and 0V with a frequency around 10Hz and a 25% duty cycle.
When I connect my 555 output to ground through a "test" LED, this one blinks normally. However, when connected to pin A0, the LED doesn't blink anymore and of course I get no reading on the screen (flat red line).
I suppose that there is something wrong with the way I am using my analog input but I don't understand what it is. Could anyone please help me ?