Book Image

Arduino Development Cookbook

By : Cornel M Amariei
Book Image

Arduino Development Cookbook

By: Cornel M Amariei

Overview of this book

Table of Contents (16 chapters)
Arduino Development Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Temperature sensor


Almost all sensors use the same analog interface. Here, we explore a very useful and fun sensor that uses the same. Temperature sensors are useful for obtaining data from the environment. They come in a variety of shapes, sizes, and specifications. We can mount one at the end of a robotic hand and measure the temperature in dangerous liquids. Or we can just build a thermometer.

Here, we will build a small thermometer using the classic LM35 and a bunch of LEDs.

Getting ready

The following are the ingredients required for this recipe:

  • An Arduino board connected to a computer via USB

  • A LM35 temperature sensor

  • A breadboard and jumper wires

  • A bunch of LEDs, different colors for a better effect

  • Some resistors between 220–1,000 ohm

How to do it…

The following are the steps to connect a button without a resistor:

  1. Connect the LEDs next to each other on the breadboard.

  2. Connect all LED negative terminals—the cathodes—together and then connect them to the Arduino GND.

  3. Connect a resistor to each...