The Arduino Alphabet

In the preceding chapters, you learned the basics of Arduino and the fundamental building blocks available to you. Let’s go over what makes up the “Arduino Alphabet”: Digital output We used it to control an LED but, with the proper circuit, it can be used to control motors, make sounds, and a lot more. Analogue… Continue reading The Arduino Alphabet

Complex Sensors

We define complex sensors as those that provide their information in a way that can’t be read with digitalRead() or analogRead() alone. These sensors usually have a whole circuit inside them, possibly with their own microcontroller. Some examples of complex sensors are digital temperature sensors, ultrasonic rangers, infrared rangers, and accelerometers. One reason for this complexity might be to… Continue reading Complex Sensors

Serial Communication

The Arduino has a USB connection that is used by the IDE to upload code into the microcontroller. The good news is that after a sketch is uploaded and is running, the sketch can use this same connection to send messages to or receive messages from from your computer. The way we do this from… Continue reading Serial Communication

Try Other Analogue Sensors

The light-dependent resistor is a very useful sensor, but Arduino cannot directly read resistance. The circuit of Figure 5-6 takes the resistance of the LDR and converts it to a voltage that Arduino can read. This same circuit works for any resistive sensor, and there are many different types of resistive sensors, such as sensors that measure force,… Continue reading Try Other Analogue Sensors

Analogue Input

As you learned in the previous section, Arduino is able to detect whether there is a voltage applied to one of its pins and report it through the digitalRead() function. This kind of either/or response is fine in a lot of applications, but the light sensor that we just used is able to tell us not only… Continue reading Analogue Input

Use a Light Sensor Instead of the Pushbutton

Now we’re going to try an interesting experiment using a light sensor2, like the one pictured in Figure 5-5.  As its name suggests, the light-dependent resistor (LDR) is some sort of resistor that depends on light. In darkness, the resistance of an LDR is quite high, but when you shine some light at it, the resistance quickly drops and… Continue reading Use a Light Sensor Instead of the Pushbutton