Hardware Reference
In-Depth Information
The 1-wire has one main thing you must keep in mind. You need to have direct hardware access. On a lot of
other platforms like common computers, the 1-wire bus is controlled via the serial port. It's not a serial protocol in
that sense. The 1-wire functionality makes use of the serial port and runs its own communication protocol over the
underlying hardware. The 1-wire protocol pretty much hijacks the underlying hardware on your system. Lucky for
you, the Raspberry Pi comes with the GPIO headers. Linux has a kernel module for the 1-wire protocol over GPIO.
You just need to set it up and scan the micro LAN for devices.
By now I would have assumed that you can see the DS1820B has been the better solution for you under Linux. It's
cheap, it's easy to run, and it's well supported within the Linux kernel. In this chapter I will mostly focus on setting up
the 1-wire bus and the DS1820B. I will show you how you can use the DHT11 as well, just in case you have one lying
around with no use. Let's get started with your first hardware project. I promise it will be simpler than you expect.
Building the Sensors
Here are the parts you are going to need:
One DS1820B temperature sensor
One 1K ohm resistor
One 10K ohm resistor (only for the DHT11 section)
One DHT11 sensor (only for the DHT11 section)
Jumper and hook-up wire
Breadboard
Let me show the sensors you will be dealing with first. In Figure 3-6 , you can see the small little black DS1820B
and the blue square DHT11.
Figure 3-6. The DS1820B and DHT11 side by side. Fight!
 
Search WWH ::




Custom Search