What Is Electricity?

If you have done any plumbing at home, electronics won’t be a problem for you to understand. To understand how electricity and electric circuits work, the best way is to use something called the water analogy. Let’s take a simple device, like the battery-powered portable fan shown in Figure 4-3. If you take a fan apart, you will see… Continue reading What Is Electricity?

The Code, Step by Step

At first, you might consider this kind of explanation too unnecessary, a bit like when I was in school and I had to study Dante’s Divina Commedia (every Italian student has to go through that, as well as another book called I promessi sposi, or The Betrothed—oh, the nightmares). For each line of the poems, there were a hundred lines… Continue reading The Code, Step by Step

Arduino Is Not for Quitters

Arduino always expects that you’ve created two functions: one called setup() and one called loop(). setup() is where you put all the code that you want to execute once at the beginning of your program, and loop() contains the core of your program, which is executed over and over again. This is done because Arduino is not like your regular computer—it… Continue reading Arduino Is Not for Quitters

Blinking an LED

The LED blinking sketch is the first program that you should run to test whether your Arduino board is working and is configured correctly. It is also usually the very first programming exercise someone does when learning to program a microcontroller. A light-emitting diode (LED) is a small electronic component that’s a bit like a lightbulb, but… Continue reading Blinking an LED

Sensors and Actuators

Sensors and actuators are electronic components that allow a piece of electronics to interact with the world. As the microcontroller is a very simple computer, it can process only electric signals (a bit like the electric pulses that are sent between neurons in our brains). For it to sense light, temperature, or other physical quantities,… Continue reading Sensors and Actuators

Anatomy of an Interactive Device

All of the objects we will build using Arduino follow a very simple pattern that we call the interactive device. The interactive device is an electronic circuit that is able to sense the environment by using sensors (electronic components that convert real-world measurements into electrical signals). The device processes the information it gets from the sensors with behaviour… Continue reading Anatomy of an Interactive Device

Port Identification: Linux

Invoke the Arduino IDE by typing: From the Tools menu in the Arduino IDE, select Serial Port. You will see one or more serial ports with names like /dev/tty. One of the ports will say Arduino/Genuino Uno following the port name. This is the one to select. Once you’ve figured out the serial port assignment,… Continue reading Port Identification: Linux