CC1101 is a cheap, sophisticated and small transceiver which works in different frequencies: 315, 433, 868, and 915 MHz, but can easily be programmed for operation at other frequencies 300-348 MHz, 387-464 MHz and 779-928 MHz. If we compare it with other transceivers in the market, the low cost is enormous.
Mainly, the CC1101 is implemented in Arduino devices to create embedded prototypes, but we can use them with Raspberry Pis as well. To do that, we have to implement the SPI protocol on the Raspberry GPIO.
In this example, I will use the Raspberry Pi SPI0 to connect the CC1101. The SPI0 pins are 19, 21, 23 and 24. Also I will implement the pin 17 for voltage and 20 for ground. Adding the pin 22 for the digital output CC1101’s GD02.
Connecting the CC1101 and Raspberry Pi SPI.
CC1101<->Raspi Vdd - 3.3V (P1-17) SI - MOSI (P1-19) SO - MISO (P1-21) CS - SS (P1-24) SCLK - SCK (P1-23) GDO2 - GPIO (P1-22) GDO0 - not used in this demo GND - P1-20
One of the main wiring problems is the necessity to implement many cables to connect the Raspberry Pi and the CC1101 which could be a mess:
I started designing a prototype to connect both devices easily. As result, we have a PCB that could be a perfect device to plug and play:
First, we need to enable the Raspberry Pi SPI:
pi@raspberrypi:~/CC1101 $ sudo raspi-config
In order to add functionality to the CC1101 and Raspberry Pi, we have to implement a special library: https://github.com/SpaceTeddy/CC1101(Thanks for this amazing code) follow the instructions in the README.md to compile & run the receiver and transmitter.
At the end, we are able to implement the hardware and software very easily:
I forked the original library and added the PCB schematic: https://github.com/salmg/CC1101/tree/master/schematic
Testing both Raspberry Pis TX/RX pic.twitter.com/YyNzdRI3OW
— Salvador Mendoza🇲🇽 (@Netxing) October 3, 2017