Dimmer using an Arduino

Dimmer using an Arduino

This example shows how to send data from a personal computer to an Arduino board to control the brightness of an LED. The data is sent in individual bytes, each of which ranges in value from 0 to 255. Arduino reads these bytes and uses them to set the brightness of the LED. You can […]

Arduino circuit 1

ASCII Table using Arduino

Demonstrates the advanced serial printing functions by generating a table of characters and their ASCII values in decimal, hexadecimal, octal, and binary. For more on ASCII, see asciitable.com Circuit image developed using Fritzing. For more circuit examples, see the Fritzing project page None, but the Arduino has to be connected to the computer. Code /* ASCII table Prints […]

Read ASCII String using Arduino

Read ASCII String using Arduino

This sketch uses the Serial.parseInt() function to locate values separated by a non-alphanumeric character. Often people use a comma to indicate different pieces of information (this format is commonly referred to as comma-separated-values), but other characters like a space or a period will work too. The values are parsed into ints and used to determine the color […]

Fading using an Arduino

Fading using an Arduino

Demonstrates the use of analog output (Pulse Width Modulation (PWM)) to fade an LED. PWM is a technique for getting an analog-like behavior from a digital output by switching it off and on very fast. Circuit An LED connected to digital output pin 9 through a 220-ohm resistor. Schematic image developed using Fritzing. For more circuit […]

Arduino Calibration

Calibrating sensor input using Arduino

This example demonstrates one techinque for calibrating sensor input. The Arduino takes sensor readings for five seconds during the startup, and tracks the highest and lowest values it gets. These sensor readings during the first five seconds of the sketch execution define the minimum and maximum of expected values for the readings taken during the […]

Arduino Analog Write with 12 LEDs

Analog Write with 12 LEDs on an Arduino Mega

This example fades 12 LEDs up and the down, one by one, on an Arduino Mega board. Circuit image developed using Fritzing. For more circuit examples, see the Fritzing project page Connect the longer, positive legs of (anodes) 12 LEDs to digital pins 2-13 through 220 ohm current limiting resistors. Connect the shorter, negative legs (cathodes) to ground. Schematic Code In […]

Arduino Analog Input

Analog Input using Arduino

A potentiometer is a simple knob that provides a variable resistance, which you can read into the Arduino board as an analog value. In this example, you’ll connect a poterntiometer to one of the Arduino’s analog inputs to control the rate at which the built-in LED on pin 13 blinks. Circuit image developed using Fritzing. For […]

Arduino tones on Multiple outputs

SPlaying tones on Multiple outputs using the tone() function with Arduino

This example shows how to use the tone() command to play different notes on multiple outputs. The tone() command works by taking over one of the Atmega’s internal timers, setting it to the frequency you want, and using the timer to pulse an output pin. Since it’s only using one timer, you can only play […]

Arduino Simple keyboard

Simple keyboard using the tone() function using Arduino

This example shows how to use the tone() command to generate different pitches depending on which sensor is pressed.   Circuit Connect one terminal of your speaker to digital pin 8 through a 100 ohm resistor, and its other terminal to ground. Power your three FSRs (or any other analog sensor) with 5V in parallel. Connect each […]

Arduino Play a Melody

Play a Melody using the tone() function with Arduino

This example shows how to use the tone() command to generate notes. It plays a little melody you may have heard before. Circuit image developed using Fritzing. For more circuit examples, see the Fritzing project page Connect one terminal of your speaker to digital pin 8 through a 100 ohm resistor. Connect the other terminal to ground. […]

Use Arduino for Projects

Free Arduino projects, circuits, code and tutorials. Pick a board, pick a sensor, build something.

Scroll to Top