Hardware configuration
For the first project of this book, there are only a few hardware connections to make. We simply need to connect the relay module and the DHT11 sensor to the Arduino board.
The following image summarizes the hardware connections for this chapter (with the DHT sensor on the left of the breadboard, and the relay module on the right):
The first thing you need to do is to connect the power from the Arduino board to the power rails on the side of the breadboard. Connect the Arduino 5V pin to the red power rail on the breadboard, and the Arduino GND pin to the blue power rail on the breadboard.
For the DHT11 sensor, you first need to have a look at the pins configuration of the sensor by visiting http://www.rlocman.ru/i/Image/2012/09/06/DHT11_Pins.jpg.
You need to first connect the power supply; the VCC pin goes to the red power rail on the breadboard, and the GND pin goes to the blue power rail. You also need to connect the DATA pin to pin number 7 of the Arduino board. Finally, place the 4.7K Ohm resistor between the VCC and the DATA pin of the sensor.
For the relay module, you have three pins to connect: VCC, GND, and SIG. Connect the VCC pin to the red power rail on the breadboard, GND to the blue power rail, and finally, connect the SIG pin to Arduino pin 8.
The following is an image of the completely assembled project: