This repository contains a Tinkercad simulation of a simple Arduino-based oscilloscope. The project reads analog input values and outputs them via the serial monitor, mimicking the functionality of an oscilloscope. View the Project on Tinkercad
This repository contains a Tinkercad simulation of a simple Arduino-based oscilloscope. The project reads analog input values and outputs them via the serial monitor, mimicking the functionality of an oscilloscope.
- Arduino UNO
- Function Generator
- 2 Equal Resistors
- The analog signal is connected to A0.
- Power lines are connected to 5V and GND.
- Output is shown via Serial Monitor.
const float R1 = 100000.0;
const float R2 = 100000.0;
const float Vref = 5.0;
const float scale = (R1 + R2) / R2;
void setup() {
Serial.begin(115200);
}
void loop() {
int raw = analogRead(A0);
float voltage5 = raw * (Vref / 1023.0);
float voltage10 = voltage5 * scale;
Serial.println(voltage10, 3);
delay(1);
}