Showing posts with label Arduino projects online. Show all posts
Showing posts with label Arduino projects online. Show all posts

Sunday, June 13, 2021

Arduino Simulator examples - "Playing tones on multiple output" 🎼🎷

Arduino "Playing tones on multiple output" on Arduino simulator

 Summary

Arduino "Playing tones on multiple output" Program creates tone on three connected buzzers. They are connected to pin 6, 7, and 8 of the Arduino.

Wokwi Arduino simulator is used here as it is free and easy to use online. 

Wokwi Arduino Simulator - Playing multiple tones on Arduino simulator
Wokwi Arduino Simulator - Playing multiple tones on Arduino simulator

 

You can do following things with the Arduino Simulator example

  • Can you come up with a known tone and play it here?

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 Example - "Simple Keyboard using tone() function" πŸͺ•πŸŽΆ

Arduino "Simple Keyboard using tone() function" on Arduino simulator

 Summary

Arduino "Simple Keyboard using tone() function" Program creates different tone based on which button is pressed. In this case, we have three buttons connected to the the UNO board. You can find more helpful information on Arduino official website. Let us get started.

Three buttons are connected to three analog port pins - A0, A1, A2. Here we have connected three potentiometers. if the value read by the analog read function is higher than the set 'threshold', the tone will be activated. Goahad and make your own version out of it!

Wokwi Arduino simulator is used here as it is free and easy to use online. 

Wokwi Arduino Simulator - Simple keyboard using tone() function
Wokwi Arduino Simulator - Simple keyboard using tone() function

 

You can do following things with the Arduino Simulator example

  • Just have one potentiometer connected. Vary the tone based on the value read by the Analog input.

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. 

Saturday, June 12, 2021

Arduino Simulator examples - Blink without delay ⏳

Arduino "Blink without delay" on Arduino simulator

 Summary

Arduino "Bink without delay" Program blinks the connected LED, but without using the standard delay function. This will help you to spend time with the tasks.  Instead of simply waiting for 500 ms or 1000 ms to change the state of the LED, you can do other tasks, while checking intermittently the time elapsed between last state change.

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 - Blink an LED
Wokwi Arduino Simulator - Blink an LED

 Tip✅: The LED needs a resistor in series in practical circuits. 

You can do following things with the Arduino Simulator example

  • Blink an LED connected to pin 13 every 1 second, and another LED connected to pin 12 every 100 ms.

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 - "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 - "LED fading" -using AnalogWrite() πŸ“‰

Arduino "Fade an LED" on Arduino simulator

 Summary

Arduino "Fade an LED" Program fades an LED. The LED in this example is connected to pin 9 of the Arduino UNO. The fading is achieved by driving the LED at a constant PWM frequency but variable Duty cycle. The example is taken from standard builtin Arduino 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. 

Warning🚨: Make sure you connect a resistor in series when you connect an LED to a real board. If not, you may damage the LED or the Board or worse, both!  

LED fading - Wokwi Arduino Simulator
Wokwi Arduino Simulator - AnalogWrite() function for LED fading

 

Tip✅: Red LEDs will have lower forward voltage compared to blue or white LEDs. Hence, Red LEDs need a higher value of resistor in series compared to a white LED for the same brightness.

You can do following things with the Arduino Simulator example

  • Add one more LED on pin 10 and make both LEDs fade together

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 - "Blink an LED" πŸ’‘

Arduino "Blink an LED" on Arduino simulator

 Summary

Arduino "Blink an LED" Program blinks an LED. The LED in this example is connected to pin 13 of the Arduino UNO. There is also an onboard LED. You, to try this example on real board/simulator you don't have to really connect an LED externally. 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 - Blink an LED
Wokwi Arduino Simulator - Blink an LED

 

Warning🚨: Make sure you connect a resistor in series when you connect an LED to a real board. If not, you may damage the LED or the Board or worse, both!  

Tip✅: Red LEDs will have lower forward voltage compared to blue or white LEDs. Hence, Red LEDs need a higher value of resistor in series compared to a white LED for the same brightness.

You can do following things with the Arduino Simulator example

  • Change the LED blinking frequency to 10 Hz
  • Change the color of the LED
  • Add one more LED on pin 12 and make both LEDs blink together
  • Change one of the LED to a different color and blink the two LEDs alternatively. 

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. 

Friday, June 11, 2021

Arduino simulator examples - "Serial Transmission of data" πŸ“Ί

Arduino "Serial transmission" on Arduino simulator

 Summary

Arduino "Serial transmission" Program prints the text "Arduino simulator" on the serial terminal in a loop. 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 transmission of data
Wokwi Arduino simulator - serial transmission of data example

 

You can do following things with the Arduino Simulator example

  • Print your name along with a counter value which increments for every counter 
  • Can you generate nice patterns using symbols = *, $ and #?
  • Can you again delete "ln" from the "Serial.print" command and see what 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. 

2

Arduino IR simulator projects - "simple receiver"

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