Add a wireless sensor

You can increase the capabilities of the project by using wireless sensors. It is possible to have up to 5 wireless sensors connected to the arduino Yun, and you can set (one of) them as master node too.

Hardware needed

For the arduino Yun, you will need a transceiver (the NRF24L01) and  8 wires: 3 female- female, and 5 male-female.

For each remote sensor, you will need: an Arduino Leonardo, a temperature sensor (the DS18B20), a transceiver (the NRF24L01): 7 male-female wires, 3 female-female wires, and a usb wire to power the Leonardo.

 

 

Basado en Arduino Leonardo, sensor de temperatura ds18b20 y transceptor NRF24L01

In the picture above you can see An Arduino Leonardo, a ds18b20 temperature sensor (up-right), the NRF20L01 transceiver (up-left), and the needed wires. We will not use a breadboard this time.

Connecting the temperature sensor to each Leonardo:

The connections are the already known ones:

  • Pin gnd from the sensor, with the pin gnd from the Leonardo.
  • Pin vcc from the sensor, with the pin 5V from the Leonardo.
  • Pin S from the sensor, with the digital pin 2 from the Leonardo.

 

Incorpora un pequeño led que brilla tenuemente mientras se carga e energía y parpadea en rojo al realizar una lectura

Connecting the transceiver:nrf24l01

This connection requires 8 wires: 3 female- female, and 5 male-female.

  • A pin VCC in the transceiver, with the 3.3V power ping from the Leonardo.
  • A GND pin in the transceiver, with the GND in the Leonardo.
  • The pin CE in the transceiver, with the digital pin 9 in the Leonardo.
  • The pin CSN in the transceiver, with the pin digital 10 in the Leonardo.

If you ARE NOT using and Arduino Leonardo as remote sensor,

then the remaining connections for the pins MISO, MOSI and SCK, are the following:

  • pin SCK in the transceiver, with dital pin 13 in the arduino.
  • pin MISO in the transceiver with the digital pin 12 in the arduino.
  • pin MOSI in the transceiver with the digital pin 11 in the arduino.

If you are using an Arduino Leonardo or for the connection from the transceiver to the Arduino Yun, then you have to use the ICSP bus:

Detalle de los conectores ICSP del Leonardo
ICSP bus

Detalle del conector ICSPTherefore, the connections for the yun and/or the leonardo, are the following:

  • MISO pin in the transceiver, with the MISO pin in the ICSP bus.
  • MOSI pin in the transceiver, with the MOSI pin in the ICSP bus.
  • SCK pin in the transceiver, with the SCK pin in the ICSP bus.

Of course, you have to connect one transceiver to the Arduino Yun, and one transceiver to the each of the arduino Leonardo that you use as wireless sensor.

The last step, is to upload the sketch to the arduino Leonardo. You can found the sketch in this page.

The only modification that you have to do in the sketch, is to assign a diferente address for each one of your wireless sensors (up to 5). With luck, the Arduino Yun will receive the transmissions from the Leonardos, after a couple of minutes you will see them in the app.

If you have problems, questions, or doubts, don hesitate and ask in the forum.

leonardo_NRF24L01_ds18b20