$ 7 radio modem

  • Tutorial
Good time of day!
I’ll tell you how you can assemble a radio modem with a capacity of 100mW at 433MHz, at a cost of about 6-7 dollars. A powerful radio modem for 200 rubles - is it tempting? Then let's start.
Requires soldering skills slightly above average and experience ordering in online stores.

How it all began
I wanted myself telemetry on a copter. But to buy a ready-made 3DRadio radio modem - the toad strangled, because a couple costs $ 39. It was decided to make a functional analogue, but not so expensive. On occasion, I bought RFM22B radio modules, and tested the OpenBee open source project on them. It turned out around $ 22 a couple (google on request "openbee 433 MHz"). Having obtained a satisfactory result, it was decided to further reduce the cost of the design, using instead of expensive RFM22 their cheap analogues Si4432.


The modem consists of the Si4432 radio module and its controller based on ATMega8 / 168/328. Any will do. If you use older versions (168 and 328) - the modem parameters configurator will be a bit more beautiful. The radio module is powered by 3.3 volts through the AMS1117-3.3 stabilizer. The processor is powered by 5 volts, and runs at 16 MHz, the frequency is stabilized by quartz. The communication lines with the radio module are matched by voltage level using zener diodes.
Component Specification
Si4432 - 100mW 433MHz radio module manufactured by Silabs.
ATMega8 is either ATMega168 or ATMega328
Quartz Murata CSTCE16M0V53-R0 16MHz. In principle, output quartz is also suitable, but it will be necessary to install it on the reverse side of the board, and capacitors to the ground will be needed.
AMS1117-3.3 (LM1117)
VD1-VD3 - BZV55C3V3 - 3.3V zener diode, without
VD4 terminals - LL4148 (DL4148) - rectifier diode, also without
C1 - 1000pF terminals (size 0805). You can not bet.
C2, C3 - 4.7 ... 25 uF tantalum (size 1210)
C4 - 0.1uF (0.01 ... 0.2uF)
R1-R3 - 470 Ohm (470 ... 510)
R4, R5 - 4.7 K (4.7 .. .10K)
R6, R7 - 1K (0 ... 2K)
R8, R9 - 330 Ohm (220 ... 680)
R0 - 0 Ohm - jumper
All resistors of size 0805, the possible range of values ​​is indicated in brackets, however, it is better to adhere to the indicated ones.
LED1, LED2 - SMD LEDs, size 0805, different colors.

Also, besides the components of the modem itself, you will need to repeat it: ISP programmer and FTDI adapter (I didn’t buy the device from the link, but it looks interesting - supposedly it has ISP). You can do it exclusively with an ISP programmer.
An attentive reader will immediately notice, saying, “which modem is for 7 bucks, if only the 328th mega costs 200 rubles?” And also notes that all the links in the specification lead to online stores. Unfortunately, if you buy components in Russia, the modem will turn out to be gold (as, incidentally, is everything that is produced in Russia). Therefore, in order to achieve the minimum cost, you have to order radio components in China. The negative point is that you have to wait for the parcels to arrive. However, Si4432 is ordered in Asia anyway, so you still have to wait. Often a batch of 10 pieces, the same ATMega328, is priced at the same price as a batch of 5 pieces. It is necessary to monitor prices and look for a suitable option.
So after all, where does the $ 7 come from? We consider:
Si4432 - 4 $
ATMega8 - 0.8 $ (only a lot of 10 pcs.)
AMS1117 - $ 1 (actually it’s 10 stabilizers ($ 0.1) in a batch of 20 pcs)
Creep - LEDs 2x5 rubles, resistors-capacitors - 10x0.3 + 4x4 rubles (of course, if you buy not in chip type)
If we We categorically do not want to buy radio parts in batches - well, then the modem will rise in price by a dollar due to the price of mega.
The fee - free of charge or 10 rubles, an etching solution, a soldering iron, solder, etc. - I do not take into account, because these are not disposable things, and someone probably already has them.

Circuit and board

The schematic diagram of the device is shown in the figure below: The
circuit board was wired in Sprint Layout in 2 versions: for a spiral antenna, and for installing an SMA type RF connector. Both options are optimized for LUT. If you do not like the mesh fill (better for LUT) - you can enable solid in the editor.

Board assembly

The assembly takes place in 2 stages:
In the first, small parts, a stabilizer, and a processor are installed.
After that, it is necessary to flash the processor using the ISP programmer with the Arduino bootloader. This is done to simplify your life - after loading the bootloader, there is no need to poke ISP into the board in order to fill in the new firmware. Test firmware is poured so as not to burn the radio module.
At the second stage, the radio module is installed on the board, after which the “combat” firmware is poured.
Actually, in the image 1 - an etched board, 2 - a little thing is installed, 3 - a test firmware is uploaded, 4 - a radio module is installed, the board is coated with varnish, 5 - a screen is installed from interference, made of tin.


The modem firmware is written in Arduino. There is no programmer from me (I'm an engineer) - that's why the quality of the code is very so-so. Can you tell me where you can improve something - I will be glad.
The program is based on the OpenBee project . Actually, my changes are a tuning mode, which was not made in the original firmware, and a fix for the jamb with clearing the transfer buffer. Also in the original firmware there was a jamb - the frequency was not tuned (there was a define, but then the data was overwritten with data from the EEPROM that were never recorded) and the device’s RFID tag. Now everything is configurable.
The firmware process is as follows:
The bootloader is recorded using the ISP. For a board on mega8 - a bootloader for the board “Arduino NG or older w / ATMega8”. For Mega 168 and 328 boards, “Arduino Pro or Pro mini (5V, 16MHz) w / ATMega 168” and “Arduino Pro or Pro mini (5V, 16MHz) w / ATMega 328”, respectively.
My ISP Way
The method is called "Voodoo", it is easy to guess why =)

The test firmware is recorded. Already directly from Arduino. It initializes the EEPROM, blinks LEDs, and sets all the legs of the processor to High-Z mode.
About pouring in mega 8
When pouring in mega8 there is an unpleasant moment - the bootloader starts for a very long time (about 6 seconds). You may need to force a reboot by locking the Reset to the ground. This must be done at the moment when the inscription “Uploading ...” appears in the arduino (close and immediately release the reset - I did this with tweezers so that my legs are close)

Well, and last but not least, a working firmware is recorded. Also from Arduino.


The modem is configured when the modem is turned on with the “SET” output closed to + 5V.
At the same time, a tuning menu is issued to the port at a speed of 9600 baud, in which you can change the operating frequency, the speed of the serial port and the radio module, etc. RF tag (RF Header), by which modems “interlock” with each other.
Be sure to configure the RFID tag to separate your modems from other devices. The OLRS label is highly discouraged (this is the default label for all Open LRS devices, to which the modem belongs).

Rake Run

For those interested
Naturally, there were some shoals. Having carefully looked at the design of the printed circuit board and the assembled device, it is clear that they are different. The jamb showed up suddenly - the modem sent data, but did not receive anything. It turned out that the leg of the nIRQ radio module was wound up on D2 mega for a reason. It causes an interrupt (which I initially overlooked in the code). Moreover, the interruption is generated only from the legs of D2 or D3. I, for the convenience of wiring, brought nIRQ to D5. I had to re-breed. As a result, nIRQ is wound up on D3. Also, it was a mistake to start the output of the radio module on the MISO atmega. When programming mega with a soldered module - there is a real chance to burn the radio module. Redistributed.

Recording of test and “combat” firmware from Arduino is carried out using a standard USB-UART converter on FTDI. The connector on the modem is not compatible with the standard "Arduino" one, connect RX-TX, TX-RX, DTR-Reset, +5, GND. If there is no FTDI in the household (how so ???) - the firmware can also be uploaded using ISP.
There is an unresolved flaw in the firmware. In theory, the speed of the serial port is limited to 115K. However, because of the record in EEPROM uint - in fact, the speed can be no more than 65535 baud. In this connection, the plug is supplied — if 65534 is exceeded — 57600 is recorded. If you wish, you can disable the configuration from the computer and set the speed in the firmware. However, it doesn’t make much sense to do this, because the maximum speed in the aero channel is 57600.
There is also a restriction on the length of the packet received on the serial port. This is 37 bytes. This restriction was introduced by the authors of the original project, and, apparently, due to the depth of the radio module buffer (64 bytes). Here I did not change anything.

I want to repeat it!

Sources, circuit board drawings, circuit - are in the catalog by reference .

Option for the bad (s)

If 100 mW is not enough for you - there is an option to remake this modem on the RFM23BP module. Its output power is 1 watt.
You must understand that the use of such a thing is illegal in this country.

Based on the comment. I checked the wave impedance of the track to the SMA connector. In principle, everything was good (60 ohms), however, to increase the agreement, I slightly changed the width of the track. Replaced the board file.

Also popular now: