Python RF Development Kit: Instructables

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

instructables

Python RF Development Kit

by unixb0y

First of all, I would like to give a little introduction on The CC1101 antennas from Texas Instruments are a
how I got into RF stuff and why I am working on this great choice for small but capable RF transceivers
project. that are also very cheap. People have built great
things with them, like DIY SDRs and stuff like that.
As a computer science student with an affinity to
hardware, I started attending some courses that deal Another thing that I wanted to address with this topic
with wireless signals and security in wireless was CircuitPython. It's a new programming language
communications in October 2018. I quickly started from microcontrollers that I've heard a lot of good stuff
experimenting with RTL-SDR and HackRF software- about so I wanted to try it. It turned out that I do enjoy
defined radios and with off-the-shelf Arduino RF it a lot, especially coupled with Adafruit's Feather M4
modules. Express board which I also use in this project. It's
very easy to debug as you don't need to compile
The issue is: SDRs are not portable enough for my custom firmwares every time you try a small change
purposes (always need to carry a laptop, antennas in your code, you get a REPL console and your code
etc.) and the cheap Arduino RF modules aren't also stays on the microcontroller itself which means
capable enough in terms of signal strength, you can carry it around, plug it into various computers
customisability, frequency ranges and automation. and you'll always be able to do changes on the go.

Python RF Development Kit: Page 1


Python RF Development Kit: Page 2
Step 1: Hardware Components

What you'll need to replicate this project:

Adafruit Feather M4 Express


2x Texas Instruments CC1101 Transceiver + Antenna
Adafruit FeatherWing OLED
3.7V LiPo

Essentially this is all you need to have a pretty compact and capable RF transceiver, but as you can see in the
image it's not going to be very reliable and tidy with all those jumper wires.

So I designed a custom PCB using https://easyeda.com/ and ordered it from JLCPCB.com (very cheap and great
quality!) to connect everything together. This also allowed to easily integrate 3 buttons and LEDs for user input and
status outputs.

And finally, I 3D printed a little cover for the back of the PCB so it won't short out against anything and sit flat on
the table.

If you are new to Electronics and PCB design, I would recommend to check out these Instructables: Basic Electro
nics, Circuit Board Design Class!

In the attachments you can find the Gerber files for my PCB. If you decide to have it manufactured, you will need a
couple of extra components which I personally ordered from LCSC, since they are associated to JLCPCB so they
offer to ship everything together which saves a little bit of shipping costs and the components are also just very
cheap there. See the BOM for the detailed list. I intentionally chose the large package size of 0805 for the SMD
components so everybody can hand-solder them onto the PCB!

Download
https://www.instructables.com/ORIG/F52/Y07K/JREUBWKF/F52Y07KJREUBWKF.xlsx

Download
https://www.instructables.com/ORIG/FHB/45SR/JREUBWKG/FHB45SRJREUBWKG.zip

Python RF Development Kit: Page 3


Step 2: Building the Board

In the first image we can see the PCBs without any resistors and LEDs first, then the buttons second and
"modifications" done - they come like this from the the headers in the end. This way you can always use
factory. Very clean cuts (no v-groove, completely the table to push against the component from the
routed) and nice vias on all of the THT holes. bottom and solder from the top (PCB flipped upside
down).
If you want to use the LEDs you will have to solder
them on as well as the SMD resistors. The resistors After soldering everything on, you can just plug in the
are usually hidden under the microcontroller but Feather M4 and one or two antennas and the
visible in the second picture that shows the hardware is ready! Since we don't solder on these
completely soldered board. If you don't have a lot of components, we can always take them off the board
experience with soldering, it could be a bit tricky to and use them for another project which is great!
solder SMD, but it's kind of optional and all of the
core components are THT. I always like to Please note that in the third picture I have the regular,
recommend Dave (EEVblog)'s videos and actually short male headers on the Feather so I couldn't stack
watched this one myself: EEVblog #186 - Soldering T the OLED on top. I had to desolder them and add Fea
utorial Part 3 - Surface Mount. It's pretty long but ther stacking headers. If you want to use the OLED,
worth it if you are new to this stuff! get the stacking headers right away, honestly :D
Desoldering is just a pain.
He mentions this as well, but: take care to solder the

Python RF Development Kit: Page 4


Step 3: Software

With the hardware done, let's talk about software. and receive ASK-encoded data on any frequency
easily. I was able to communicate with RF-controlled
As mentioned in the introduction, the M4 runs Python wall sockets as well as with my family's car by using
code, but obviously no library for CC1101 did exist in this library.
the Python language. So I did what DIYers do and
wrote my own. You can find it here: http://git.io/fhubQ. I may quite probably continue working on it and if you
have any questions, feature requests or want to
It doesn't support everything that the great TI contribute to the development, feel free to contact me!
transceivers are capable of but it's enough to send

Python RF Development Kit: Page 5


Step 4: Capabilities and Features

Since I designed this device to use double antennas modes to choose from and a frequency setting view
and the highly configurable TI CC1101 transceivers, etc.
you have a ton of possibilities, especially out in the
field where you don't want to have to carry anything It might even come in hand for some home
more than a smartphone-sized device. automation! Like I mentioned, I have been able to
communicate with power outlets successfully
You can for example capture signals of (capture the original signals once and replay them
communications in the 433MHz band and send them whenever you need it) and if you do a little bit of
back to your home station with the secondary research on the Internet you will quickly find how
antenna operating on 868MHz. many devices also operate on these frequencies with
never-changing codes. Even some garages' codes
Or if you want to study and experiment with reactive could be recorded and saved with this device and
jamming, you can have a listening and a jamming then used whenever you need to open or close your
antenna that sends its own signals as soon as a garage. So this can become a universal remote for all
transmission is detected, without doing the "traditional of your RF devices!
method" of trying to switch between RX and TX as
fast as possible. I personally replicated the RollJam attack with this
device as well, but won't release the code since
Another very cool thing about the Feather M4 is that it jamming is illegal in most places so if you attempt
comes with an onboard LiPo charging circuit so you anything like this, consult your local laws ;-)
just plug in your battery and are ready to go. In my
case, with one antenna in constant RX mode, Since the board shows up as a USB disk when you
listening for transmissions and the OLED screen on, plug it in and CircuitPython offers such a feature, you
the device would run for almost 20 hours on a 1000 can also have the device record RF transmissions
mAh LiPo. and save the demodulated data (oh yes, the
transceivers do this automatically!) to a text file which
Using the OLED screen - but also possible without it, you can later copy to your PC and analyse for
e.g. using the three status LEDs - you can have science purposes like reverse engineering of
multiple programs and select which one you want to transmissions.
run with the buttons on the bottom of the board. I
personally even implemented a whole menu with

Step 5: Final Result

Any feedback, suggestions and contributions to this project are welcome and feel free to ask questions if you have
any!

Happy Hacking,
Dave

Python RF Development Kit: Page 6


Great first instructable. Do you have any more pictures of the assembly process?

Thank you very much! Do you mean the assembly of the device (soldering everything onto the
PCB)? I do have images from that and can definitely add them later :-)

Python RF Development Kit: Page 7

You might also like