I have made a small PCB with an STM32F4 microcontroller and a TI CC2520 radio transceiver. There are many mote modules available already, but I wanted one optimized for performance as opposed to power consumption. I also wanted to try making a PCB with some RF-parts since I haven’t done that before.
These are the 2-layer PCBs ordered from OSHPark:
This is the schematic (a PDF can be downloaded here):
Here is one PCB next to my car key for size comparison:
Uploading the program
The PCB has a SWD header with a 2mm-split microJST-connector. The STM32F4 discovery board works fine as a programmer and debugger. Just remove the jumpers from it and connect the SWD pins from the header to the RF-board (see the manual for the discovery board too see which pins are used). NOTE: Do not forget to connect the VCC pin to VDD on the discovery board, otherwise the programming will be un-reliable.
This is the first time I make a PCB with RF-frequencies myself, so I’m sure I made some mistakes. Outdoors, the range was about 150m with 3dBi antennas. According to the datasheet of the CC2520 the range should be up to 400m, so the layout is most likely not perfect, although I tried to copy the reference design.
Update The new 0.8mm boards with the ground plane fixes and a few other fixes work a lot better. The measured output power is about 3.5 to 4.0 dBm, which is what it is supposed to be. I have updated the layout, schematic and production files on this page with these changes, so they should work quite well.
Here is what the front looks like:
Also, one thing I discovered is that the tiny antennas in the pictures above are quite useless.
Update I made a few measurements, and apparently the output power is about 0.5dBm. I have read somewhere that the measured power from TIs reference is about 3dBm, so this layout is not that good. I have ordered new 0.8mm PCBs with more vias and a few ground plane fixes.
I’m planning to make a new version of this board with the CC2591 power amplifier as well. This will hopefully improve the range a bit.
Do you know RF? I would be glad to get some feedback on my design. Is there some obvious mistake that would make the range drop from 400m to 150m?
Update One problem might be that I used 1.6mm PCB thickness, the reference design uses 0.8mm. This changes the impedance of the trace to the SMA connector from 54 ohm to 77 ohm according to my calculation. The PCB trace inductors also change. How much does this matter?
- I have made many improvements in my Contiki port recently. Make sure to use the latest version from gitub. You can find a description of it here.
- I have written a post about a ChibiOS-port for these boards here.
- The 0.8mm boards are assembled and tested. The measured output power was 3.5 to 4.0 dBm. This is what it is supposed to be, so the RF-design seems to be in good shape. The range is also improved compared to the previous boards. NOTE: The design files that are provided above are the ones that worked with the 0.8mm PCBs, so if you want to build something similar you can base your design on them (on your own risk of course).
- I have started to port contiki to these boards, and made some progress. The USB-CDC library is ported and mapped with syscalls, so printf works for debugging. The LEDs also work. I still have to work on the radio part and make a few more tests. I will write a new post about the contiki port when it is done.
- I read that the PCB thickness does matter here and here. My PCBs are 1.6mm thick and the ones in the reference design are 0.8mm. This will probably influence the PCB trace inductors.
- I Changed the layout a bit. The ground plane at the transceiver does not have as many cuts as before as I routed VCC another path. Also, there are more ground vias. The links above are updated, but the new design is not tested yet. I will try to order 0.8mm PCBs somewhere and test.
- I have measured the output power, and it is about 0.5dBm. I have ordered 0.8mm PCBs with the fixes fixes mentioned above. Hopefully this will increase the performance a bit.