ELECHOUSE CC1101 Hardware Driver Implementation
Hardware Interface
Connecting the CC1101 to Your Arduino
The CC1101 is a versatile and low-power radio transceiver, but it needs to be wired correctly to your microcontroller to work. The most critical rule to remember is its voltage requirement: the CC1101 is strictly a 3.3V device. Connecting it directly to the 5V power pin of a classic Arduino Uno or Nano will permanently damage the chip.
Always power the CC1101 with 3.3V. Never use a 5V source.
This 3.3V limitation extends beyond just the power supply. The logic signals for communication must also be at 3.3V. Since boards like the Arduino Uno use 5V logic, you need a bridge to translate the voltage levels between the two devices. This is where a comes in. It's a small, essential board that sits between your Arduino and the CC1101, converting the Arduino's 5V signals to a safe 3.3V for the CC1101, and boosting the CC1101's 3.3V signals back up to 5V for the Arduino.
For microcontrollers that already operate at 3.3V, like the ESP32 or an Arduino Due, you can skip the logic level shifter and connect the pins directly. This simplifies the wiring significantly.
Pinout and SPI Communication
The CC1101 communicates with the microcontroller using the (SPI) protocol. This is a 4-wire bus that allows for fast, synchronous data transfer. You'll need to connect four specific pins for SPI to work, plus power and ground.
Here is a standard mapping of the CC1101's pins to an Arduino Uno's. Note that while many pins on the Arduino could serve these roles, these are the default hardware SPI pins, which offer the best performance.
| CC1101 Pin | Arduino Uno Pin | ESP32 Pin | Function |
|---|---|---|---|
| VCC | 3.3V | 3.3V | Power (Strictly 3.3V) |
| GND | GND | GND | Ground |
| SI (MOSI) | 11 | 23 | Master Out, Slave In |
| SO (MISO) | 12 | 19 | Master In, Slave Out |
| SCLK | 13 | 18 | Serial Clock |
| CSN | 10 | 5 | Chip Select (Slave Select) |
| GDO0 | 2 | Any GPIO | General Digital Out (Interrupt) |
| GDO2 | 3 | Any GPIO | General Digital Out (Interrupt) |
The SI (Serial In) and SO (Serial Out) pins are named from the perspective of the CC1101 module. This can be confusing. Just remember to connect the Arduino's MOSI (Master Out, Slave In) to the CC1101's SI, and the Arduino's MISO (Master In, Slave Out) to the CC1101's SO. Think of it as a conversation: one speaks (MOSI) while the other listens (SI), and vice versa.
Antenna Choice and Tuning
Your radio is only as good as its antenna. The CC1101 can operate on several frequency bands, most commonly 433 MHz, 868 MHz, and 915 MHz. The physical length of your antenna must be matched to the frequency you intend to use. An improperly sized antenna will result in poor range and unreliable communication.
For a 433 MHz signal, a quarter-wave antenna should be about 17.3 cm long. For 868 MHz, the ideal length is much shorter, around 8.6 cm. Most CC1101 modules come with a small, coiled soldered to the board. These are a compact compromise, but for maximum range, a straight wire cut to the precise quarter-wavelength will almost always perform better.
When buying a CC1101 module, make sure the included antenna is designed for the frequency band you plan to use in your region. Using a 433 MHz antenna for a 915 MHz signal will yield very poor results.
Now that the hardware is connected, the next step is to configure the CC1101's internal registers to set the frequency, modulation, and data rate for communication.