Using Inhaos RF-2400 Radio Modules

    An article about radio modules was recently published on a hub ; in my opinion, it is unfairly deprived of attention of 2.4 GHz devices with SPI interface in it. They attract at the price of two or three bucks apiece, and with a ready-made communication protocol, including addressing, CRC, sending confirmation and other amenities.


    Modules RF-2400R from Inhaos built on the chip BK2421 , which seems pinched from Nordic NRF24L01 . Therefore, to work with them, you can use the Mirf library , written under Nordic.

    The problem that I solved was to organize the exchange of data between several modules, so the logic of work used in Mirf and built on the interaction between a pair of modules was not very convenient. Instead, a virtual piece of memory was organized, synchronized via the radio interface, which was used by several devices simultaneously. The result is such a library for arduino.


    In addition to the RF-2400P modules, Inhaos offers a very nice USB “whistle” RF-2410U built on the same BK2421 but already in conjunction with the C8051F321 microcontroller , which comes with a stitched bootloader and can be programmed via USB using the supplied bootloader.

    In my opinion, it turns out a very affordable and interesting solution for a system such as “smart home” - a bunch of cheap radio modules that, thanks to the price, can even be integrated into light bulbs and a compact control interface in the form of a “whistle” that can be plugged into any computer without bothering with additional wires and serial port availability.

    RF- 2400 Demo


    To simplify the process of getting to know these devices and illustrate their joint work, the following demo is presented to your attention.

    Iron

    1. Client device - Arduino + RF-2400P
    2. Server Device - Arduino + RF-2400P
    3. Observer - Windows PC + RF-2410U

    In principle, one can do without (1) or (3).

    Software

    1. RFSync library and arduino scripts for client and server parts.
    2. Firmware for RF-2410U, and drivers for it.
    3. Windows client application RF-2410U.


    Work logic


    1. On the client ardun board, the current time is written to the synchronized array at address 0.
    2. On the server board, after synchronization, the data read but at address 0 are duplicated at address 5.
    3. After synchronization is completed, the value at address 5 is read on the client board and calculated, the time spent on synchronization.
    4. All this circus synchronization process is observed on a Windows machine with a connected RF-2410U module using a client application.


    Launch

    1. Connect the RF-2400P modules to the Arduino boards as follows:
    ModuleArduino
    Miso12
    MOSIeleven
    SCKthirteen
    CE8
    CSN7
    3.3 V3.3 V
    GNDGND

    2. Copy the library code to the arduino folder and flash the client and server scripts.

    3. We observe the exchange of data through a serial interface.


    4. Download the firmware to the RF-2410U.
    • make sure the module is not connected to the computer
    • run the firmware application .
    • select firmware, click “Download”
    • insert the RF-2410U module into the USB port
    • wait for the message Download Succeed



    5. When connected, the RF-2410U will ask for the driver, give them to him .

    6. It remains to download the client application, press the start button and observe the synchronization process in real time.


    Also popular now: