Showing posts with label Arduino Serial plotter. Show all posts
Showing posts with label Arduino Serial plotter. Show all posts

Saturday, June 12, 2021

Arduino Simulator Examples - "Read Analog Voltage" 📈

Arduino "Read analog voltage" on Arduino simulator

 Summary

Arduino "Read analog voltage" Program reads the value of the ADC for the selected channel. The Potentiometer is an easy to use device to generate analog voltages from 0 V up to 5V. The Analog input A0 is used on the UNO for this specific example.

You can click on Run button in the simulator below to see the Arduino simulator in action. Wokwi Arduino simulator is used here as it is free and easy to use online. 

Wokwi Arduino Simulator - Read Analog voltage
Wokwi Arduino Simulator - Analog read voltage

 

Tip✅: The ADC resolution is set to 10 bit by default to match UNO. Other Arduino boards have different (higher) resolution. You have dedicated functions to set the desired ADC resolution.

You can do following things with the Arduino Simulator example

  • Blink the LED (on board LED, pin 13) whenver the ADC value is higher than 2.5 V

Arduino Simulation

 In the section below, you can also modify the code and see the results instantly. You can change the code and recompile it by clicking on rerun/Run button. For more help, please visit Discord channel of the Wokwi Arduino Simulator. 

Arduino Simulator Examples - "Serial Plotter" 📊

Arduino "Serial Plotter" on Arduino simulator

 Summary

Arduino "Serial Plotter" Program plots the data given on a horizontal axis. It helps a lot to use this feature while working with microphone, potentiometers or analog sensors to visualize the data. You can click on Run button in the simulator below to see the Arduino simulator in action. Wokwi Arduino simulator is used here as it is free and easy to use online. 

Wokwi Arduino Simulator - Serial plotter
Wokwi Arduino Simulator - Serial plotter

 

The X axis in the serial plotter represent time and each unit presents how fast the serial print was called in the code. The Y axis in the Arduino serial plotter  represents amplitude and it will scale automatically based on the value being printed. 


Tip: Click on the plotter button above on the serial monitor window

You can do following things with the Arduino Simulator example

  • Change the wave to sine wave (Tip: uncomment the particular code line in the example)
  • Change the speed at which the plot happens

Arduino Simulation

 In the section below, you can also modify the code and see the results instantly. You can change the code and recompile it by clicking on rerun/Run button. For more help, please visit Discord channel of the Wokwi Arduino Simulator. 

Arduino IR simulator projects - "simple receiver"

Arduino "IR simple receiver" on Arduino simulator - IR remote project  Summary Arduino "simple receiver" is an Arduino p...