PASSERELLE NRF24 / ETHERNET

PASSERELLE NRF24 / ETHERNET
ORIGINAL POST
By ZeSanglier
details

NrfGateway.jpg

Many of the projects presented on this blog use an nrf24l01+ module for wireless data transmission… that’s good, you still need something at the other end to receive them. The goal of today’s post is to build a two-way gateway between an Ethernet network and nrf24l01+ modules. The packet transmitted by a sensor can thus be sent to an API hosted on a NAS or on an internet server via a box connected to the network. Conversely, a web page can call the gateway API to send a packet to a sensor.

Principle of operation

List of materials used

  • An amplified Nrf24l01+ module with SMA connector for the antenna (model E01 ML01DP5)
  • A W5500 module
  • A 128X64 I2C SSD1306 0.96″ OLED display
  • An aluminum box 100x75x36mm
W5500 and NRF24L01+ module

Circuit diagram

The microcontroller this time is an ATMega1284P which has more RAM than the ATMega328P often used on other posts. There are few other components, the W5500 module and the NRF24 module are both connected to the SPI bus, the screen on the I2C. Three outputs for LEDs were planned but ultimately they are not used. A regulator provides the 3.3V necessary for the NRF24 from the 5V of the power supply. Although powered at 3.3V, the NRF24 and the W5500 have 5V compatible I/Os.

Plan

 

U4W5500 module (with 2×5 female support)
D41×2 female pin header (optional, provided for an adapter for another wireless module such as Lora, RFM69, etc.)
U3nRF24L01+ module (with 2×4 female support)
D1Jack DC
U2ATMEGA1284P-PU + Bracket
C1470µF
C4,C5,C8,C2,C10100nF (SMD 0805)
C6,C722pF (SMD 0805)
J2Pin header 1×4 (screen)
R1,R2,R3560Ω
R410kΩ
R5,R64.7kΩ
Y116MHz
D31×4 pin header (unused LEDs)
P1Pin header 1×4 (serial port programming)
C3,C910uF
U1LM1117-3.3 or AMS1117-3.3 or equivalent

 

Artwork files for the printed circuit with the solder mask, be careful it’s a double sided!

 

The box

The case is composed of an aluminum body (Enclosure Electronic Project Case 100x76x35mm), a front face and a back face made with a 3D printer in black PLA. Inside, a support also printed holds the printed circuit, the RJ45 socket and the screen. It is made with OpenScad.

Enclosure sources: Nrf24Gateway_Enclosure.zip

circuit support

 

Front and back side

 

Assembly

The program

To program the ATmega1284P, you must first install the MightyCore library ( https://github.com/MCUdude/MightyCore ) by following the instructions, which allows you to add this microcontroller as an Arduino board in the editor.

Download Firmware: Nrf24Gateway

Libraries used:

 

Functioning

On the screen on the front there is:

  • The radio module used (here RF24, but the gateway can be adapted for another radio module🙂
  • The gateway id
  • The radio channel used
  • IP address
  • The NRF24 address
  • The number of packets transmitted/received successfully and in error.

Send data

Via une requête GET (oui c’est mal niveau REST) ​​: http://192.168.1.100/send?recipient=0120212325&data=0100000000FF55D00700000112FF00D007000001000000000000000000000000 ou recipient est l’adresse du nrf24 destinataire en hexadécimal, et data le paquet de 32 octets en hexadécimal also.

POST /send HTTP/1.1
Host: 192.168.1.100:80
content-type: application/x-www-form-urlencoded
recipient=0120212325&data=0100000000FF55D00700000112FF00D007000001000000000000000000000000 

Receive data

The gateway automatically receives radio messages and sends them via a POST request in json to the server address configured in the firmware:

{
  "data": "1C00535412FF55D00700000112FF00D007000001000000000000000000000000",
  "gatewayId": 3
}

NrfGateway.jpg

Many of the projects presented on this blog use an nrf24l01+ module for wireless data transmission… that’s good, you still need something at the other end to receive them. The goal of today’s post is to build a two-way gateway between an Ethernet network and nrf24l01+ modules. The packet transmitted by a sensor can thus be sent to an API hosted on a NAS or on an internet server via a box connected to the network. Conversely, a web page can call the gateway API to send a packet to a sensor.

Principle of operation

List of materials used

  • An amplified Nrf24l01+ module with SMA connector for the antenna (model E01 ML01DP5)
  • A W5500 module
  • A 128X64 I2C SSD1306 0.96″ OLED display
  • An aluminum box 100x75x36mm
W5500 and NRF24L01+ module

Circuit diagram

The microcontroller this time is an ATMega1284P which has more RAM than the ATMega328P often used on other posts. There are few other components, the W5500 module and the NRF24 module are both connected to the SPI bus, the screen on the I2C. Three outputs for LEDs were planned but ultimately they are not used. A regulator provides the 3.3V necessary for the NRF24 from the 5V of the power supply. Although powered at 3.3V, the NRF24 and the W5500 have 5V compatible I/Os.

Plan

 

U4W5500 module (with 2×5 female support)
D41×2 female pin header (optional, provided for an adapter for another wireless module such as Lora, RFM69, etc.)
U3nRF24L01+ module (with 2×4 female support)
D1Jack DC
U2ATMEGA1284P-PU + Bracket
C1470µF
C4,C5,C8,C2,C10100nF (SMD 0805)
C6,C722pF (SMD 0805)
J2Pin header 1×4 (screen)
R1,R2,R3560Ω
R410kΩ
R5,R64.7kΩ
Y116MHz
D31×4 pin header (unused LEDs)
P1Pin header 1×4 (serial port programming)
C3,C910uF
U1LM1117-3.3 or AMS1117-3.3 or equivalent

 

Artwork files for the printed circuit with the solder mask, be careful it’s a double sided!

 

The box

The case is composed of an aluminum body (Enclosure Electronic Project Case 100x76x35mm), a front face and a back face made with a 3D printer in black PLA. Inside, a support also printed holds the printed circuit, the RJ45 socket and the screen. It is made with OpenScad.

Enclosure sources: Nrf24Gateway_Enclosure.zip

circuit support

 

Front and back side

 

Assembly

The program

To program the ATmega1284P, you must first install the MightyCore library ( https://github.com/MCUdude/MightyCore ) by following the instructions, which allows you to add this microcontroller as an Arduino board in the editor.

Download Firmware: Nrf24Gateway

Libraries used:

 

Functioning

On the screen on the front there is:

  • The radio module used (here RF24, but the gateway can be adapted for another radio module🙂
  • The gateway id
  • The radio channel used
  • IP address
  • The NRF24 address
  • The number of packets transmitted/received successfully and in error.

Send data

Via une requête GET (oui c’est mal niveau REST) ​​: http://192.168.1.100/send?recipient=0120212325&data=0100000000FF55D00700000112FF00D007000001000000000000000000000000 ou recipient est l’adresse du nrf24 destinataire en hexadécimal, et data le paquet de 32 octets en hexadécimal also.

POST /send HTTP/1.1
Host: 192.168.1.100:80
content-type: application/x-www-form-urlencoded
recipient=0120212325&data=0100000000FF55D00700000112FF00D007000001000000000000000000000000 

Receive data

The gateway automatically receives radio messages and sends them via a POST request in json to the server address configured in the firmware:

{
  "data": "1C00535412FF55D00700000112FF00D007000001000000000000000000000000",
  "gatewayId": 3
}

COMMENTS

Please Login to comment
  Subscribe  
Notify of
POSTED BY
Reusable S/W