Initially we started this project by setting up the Arduino Pro Mini boards. For this we made use of the CP2102 USB to UART module. This is a serial module converter that updates the RS232 signal into USB. We need this module to upload programs to the Arduino PRO mini board series from the computer. The drivers for the CP2102 module can be downloaded here.
After setting up the boards and the CP2102 module, we ran the Arduino software and installed the correct drivers for it (these should be installed on every computer after downloading the Arduino software on it). After these drivers are successfully installed, we are making one more stop to download the libraries for nRF24L01 two sites: first site and this other site for the test programs. Once the downloads are done, unzip the file to the Arduino libraries. If the Arduino Software was open while setting up this new library, you will have to restart Arduino in order to see the library.
To access the test programs go to the File tab then Examples>RF24Networkmaster. In that extension we initially see two programs which are: helloworld_rx and helloworld_tx. As shown in the picture above, the slave node will be the transmitting node therefore, we are loading the helloworld_tx program to it. On the other hand, the master node will be the node receiving the readings therefore we will be loading the helloworld_rx to this board.
This is the initial phase to make sure that our Arduino boards, module and nRF24 shields are properly working. For the master node we can omit wiring the potentiometer and the capacitor since this is wired up to read the battery capacity from the slave node.
We are making some modifications to the coding. After the RF libraries are called, we will change the pins used in the line:
RF24 radio(9,10);
to
RF24 radio(9,8);
This change should be done in the RX and TX programs. After upload, the slave node will be transmitting packets of data to the master node. The serial monitor of the master node will notify the packets received and the time in seconds when these packets were received. When communication is established between master and slave, then our nRF24L01 is working properly. To know more about this module click here.
Phase II: Temperature and humidity sensor
The next step after phase I will be to start collecting data from a slave node and transmit that data to the master node.
The values sent will come from a temperature sensor connected to the slave node. The temperature and humidity sensor we will be using is the DHT11 sensor. Even though there are four pins in this sensor, pin 3 does not need to be connected .
The library to be installed is detailed below. We advise to change the name of the main folder to dht11 because Arduino will show an error reading the library due to especial characters in the name of the main folder.
In the wiring below, we are feeding data collected from the temperature sensor in digital pin 2 or D2. As observed we wired up the Radio Frequency shield, we will make use of this shield once we make sure our temperature sensor is up and running.
Leave a Reply