What PWM looks like on an oscilloscope. PWM is Pulse Width Modulation which can be used to change the brightness of an LED. This article and video shows PWM on an oscilloscope by using the Fade example sketch or program from the Arduino IDE. An LED and series resistor is connected to an Arduino Uno pin and the Arduino sketch continually adjusts the brightness of the LED by using PWM on the pin.
Video Showing PWM on an Oscilloscope
The following video shows PWM on an oscilloscope that is continually changing in order to change the brightness of the LED. Both the LED and Arduino Uno can be seen in the inset video. PicoScope is a PC based oscilloscope that connects to the USB port of a computer. Software running on the computer acts as the oscilloscope screen and control panel and can be seen in the video.
Hardware and Software for the PWM Demo
Find the Fade sketch in the Arduino IDE under File → Examples → 01.Basics → Fade from the top menu. The oscilloscope GND is connected to the Arduino GND. Pin 9 of the Arduino is used as the measurement point to measure the PWM waveform on the oscilloscope. The image below shows how the LED and series resistor are connected to the Arduino Uno. For more information, see the related Fade tutorial on the Arduino website.
Fade Arduino Example used to Show PWM on an Oscilloscope
How PWM Works
PWM changes the duty cycle of a square wave, which means that it changes the ratio of its on time to its off time. When the square wave is on, or at 5V, for longer than it is off, the LED will burn brighter. If the square wave is off, or at GND, for longer than it is on, the LED will burn dimmer.
Duty cycle of a PWM waveform is usually given as a percentage. If the duty cycle is 80%, then the on cycle of the square wave is on for 80% of the time and off for 20% of the time. A square wave with a 50% duty cycle has an equal on and off time.
In this blog post we look at how beginners wanting to start with Arduino can choose an Arduino board. Help is provided for beginners choosing an Arduino. The difference between an Arduino and AVR ATmega microcontroller is also covered.
Choosing an Arduino for Beginners
The recommended Arduino for beginners is usually the Arduino Uno. On the Starting Electronics website, the article on choosing an Arduino for beginners provides more information on which Arduino to choose when starting to learn about Arduino and writing sketches.
Difference Between Arduino and AVR
Many Arduino beginners are confused about the difference between Arduino and AVR, or Arduino and ATmega. Difference between Arduino and ATmega328 explains what the ATmega328 microcontroller is and how it relates to the Arduino Uno. The article also explains more about the AVR microcontroller found on most Arduino boards.
A list of easy to build Arduino projects for beginners and kids. These projects use easy to obtain components and can be built on an electronics breadboard. Suitable for use with an Arduino Uno or similar board.
Arduino projects for absolute beginners below list very easy projects for first time Arduino users. The section that follows lists projects for beginners who have learned the basics of how to use an Arduino.
This easy Arduino project for beginners can be built on an electronic breadboard and uses only four LEDs and four series resistors to make a moving light display. The Arduino sketch for the project can be modified to change the rate at which the pattern on the LEDs is updated. The patterns to display on the LEDs can also be changed.
Moving Light Display Arduino Project for Beginners
Details of this Arduino Project for Beginners
A breadboard is used to connect four LEDs with series resistors to an Arduino which can be an Arduino Uno or other Arduino. Four wire links connect the LEDs to four of the Arduino pins which are set as outputs. A common GND wire from the Arduino is connected to the breadboard which connects the other side of each of the series resistors to GND. This completes the circuit and enables the LEDs to be switched on by the sketch running on the Arduino.
Arduino Internet voltage monitoring can be achieved in several ways. The Arduino can be set up as a client or a server in order to display measured voltage on a web page. In this article an Arduino is set up as web server that hosts a web page stored on SD card. The web page displays the voltage measured on Arduino analog pin A2 in near real-time. The web server also interacts with ThingSpeak, a Internet of Things (IoT) service which logs voltage over time. Voltage is displayed on the hosted web page on a gauge and in a ThingSpeak generated graph or chart.
Arduino Internet Voltage Monitoring
How Arduino Internet Voltage Monitoring Works in this Project
Voltage Update Timing