Book Image

Arduino BLINK Blueprints

By : Utsav Shah
Book Image

Arduino BLINK Blueprints

By: Utsav Shah

Overview of this book

Arduino is an open-source prototyping platform based on easy-to-use hardware and software. Arduino has been used in thousands of different projects and applications by a wide range of programmers and artists, and their contributions have added up to an incredible amount of accessible knowledge that can be of great help to novices and experts alike. Want to build exciting LED projects with Arduino? This book will be your companion to bring out the creative genius in you. To begin with, you will get introduced to the maker movement and the open source hardware development Arduino boards. You will then move on to develop a mood lamp and a remote-controlled TV backlight. As you progress through the book, you will develop an LED cube and will learn to use sound visualization to develop a sound-controlled LED Christmas tree. You will then move on to build a persistence of vision wand. At the end of each chapter, you’ll see some common problems, their solutions, and some workarounds.
Table of Contents (14 chapters)

Controlling multiple LEDs


In the embedded world, controlling a single LED is "Hello World" code, which we learned in first chapter. Now, as we are familiar with the concepts of LED, we can start to control multiple LEDs with Arduino. Here, we will start by making a simple traffic light module.

Simple traffic light controller

As we all know, a traffic light is made up of three LEDs: red, yellow, and green. To make this project, we need red, green, and yellow LEDs, strip wires, and a few 255 Ω resistors.

In the previous chapter, in our "Hello World" program, we connected an LED directly with pin 13. Here, we will connect red, yellow, and green LEDs with pins 9, 10, and 11 respectively. In the case of pin 13, it has an in-built pull up resistor. Pull up resistors are used to limit the current supplied to an LED. We can't give current of more than a few mA to LEDs. But, with pin 13, current is itself limited in Arduino by the internal pull up resistor. If we want to connect to pins other than 13...