Hardware Reference
In-Depth Information
Solution
The DS18B20 is an interesting temperature sensor that uses Dallas Semiconductor's 1-wire
interface. The data communication requires only one wire! (However, you still need wires
from ground and 3.3 V.) You can wire it to any GPIO port.
To make this recipe, you will need:
▪ Breadboard and jumper wires (see “Prototyping Equipment” )
▪ 4.7 kΩ resistor (see “Resistors” )
▪ DS18B20 1-wire temperature sensor (see “Integrated Circuits” )
Wire up as shown in Figure 2-20 .
Figure 2-20. Wiring a Dallas 1-Wire temperature sensor 2
Add the code in Example 2-13 to a file called BB-W1-00A0.dts .
Example 2-13. Reading a temperature with a DS18B20 (BB-W1-00A0.dts)
/dts-v1/ ;
/plugin/ ;
/ {
compatible = "ti,beaglebone" , "ti,beaglebone-black" ;
part - number = "BB-W1" ;
version = "00A0" ;
Search WWH ::




Custom Search