Using the CC2500 Arduino Shield

Software : the Arduino Library

( the hardware is described here )

Update #2 : the LivingColors library has been updated, the transmit power is higher and the range should be longer.

Update : the example program and library has been updated to Arduino version 1.0. New version of the example program is here : a_LiCo_Control_A1.zip , the LivingColors library is here : LivingColors.zip

The software consist of a library for the Arduino that can control a Philips LivingColors and a couple of sample programs. The library takes care of sending an receiving of messages using the CC2500 and can be used as a basis to communicate between two shields.

The library can be found here for Arduino version 1.0 (and here for older versions) and should be saved in the  “libraries” directory of the Arduino environment (this is the “hardware/libraries” directory in older versions of Arduino). You should have a  “<arduino>\libraries\LivingColors” directory with the files :

  • CC2500.cpp
  • CC2500.h
  • ColourConversion.cpp
  • ColourConversion.h
  • keywords.txt
  • LivingColors.cpp
  • LivingColors.h

The library can be found here for Arduino version 1.0 (and here for older versions) and the files are well documented.

The source code has a GPL license.  The code is based on code by Jeroen Domburg, known from various hacks on Hack a day and Tweakers, and described in an article van of the dutch edition of Elektor in May 2008. George Mathijssen cleaned up the code and got it working as an Arduino library.

The library is likely to have bugs and omissions. The RGB to HSI conversion seems a bit wrong and we ignore the ACK and NACK responses from the LivingColors lamp. Fixes and improvements are welcome !

LiCo_Control : an example of an Arduino application.

To test the library i have made an application to control LivingColors lamps. The application receives commands by serial over USB, you can control it with something like Putty or HyperTerminal.

When LiCo is ready to execute a command it sends a “!”. If it did not understand a command it sends a “?”.

The available command’s are :

Command Function
r reset
wn-rrr-ggg-bbb r, g and b are numbers 000 to 255. Example “w000-255-000\” for bright green. n is the lamp number.
hn-hhh-sss-iii h, s and i are numbers 000 to 255. No example for now. n is the lamp number.
i print info
nn turn lamp number n on
fn turn lamp number noff
ee e = 0 echo off, e = 1 echo on.
l listen for addresses. Use i to list addresses.
saabbccddeeffgghhii store address in a..i. 9 numbers as 2 digit hex
? dummy command.

Using the application to control a LivingColors lamp :

In LiCo-Control you can get control over the lamp by  :

  • Switching the lamp on with the remote.
  • Opening a connection to the Arduino board with a terminal application (putty, hyperterminal.. etc.).
  • Telling the application to learn the code of the lamp by sending the “l” command..
  • .. and control the lamp with the remote..
  • The Arduino will the eavesdrop on the communication between the remote and the lamp and will learn the addresses of  lamp and remote.
  • The command “i” will display the learned addressees.
  • With “w0-255-000-000” you should be able to set lamp 0 (zero) to bright red (R=255, G=000 and B=000).
  • With “w1-000-000-010” you can set lamp 1 to faint blue.

Its best to hardcode the learned addresses in the LiCo-Control application.

WheelColor : an example Processing application.

WheelColor is a Processing application that sends commando’s to LiCo_Control. You can set the color of the LivingColors lamp with a colorwheel. The application is simple and ugly but it contains a useful example for robust communication between Processing and Arduinio and in this case WheelColor and LiCo_Control.

Here an example using WheelColor :

Relevant files.

The schematic (as pdf).
The printlayout (as png).
The BOM (as txt).
The Arduino library for Arduino < 1.0 (as zip), library for Arduino 1.0 (as zip).
An Arduino example for Arduino < 1.0 (as zip), example for Arduino 1.0 (as zip).
A Processing example that uses the Arduino example (as zip).
The datasheet of the CC2500 chip from TI. (mirror). There are important bugs mentioned in the errata on the TI site !
The datasheet of the CC2500 module from Quasar. (mirror)
The datasheet of the 74LVC125. (mirror)
The datasheet of the LP2950 voltage regulator. (mirror)
The CC2500 and Atmel on the Arduino use SPI to communicate. TI has a  application note about SPI.

30 thoughts on “Using the CC2500 Arduino Shield”

  1. Hello from germany,

    I am interested in Your ccc2500 Arduino shield.
    Is there any chance to buy ist?

  2. I am interested in your shield. Is there any place from where I can buy it? I have left my email with this comment, so please do contact me. Thanks.

  3. Hi,

    Really nice work !! I found my old 1st gen LiCo lamp and the remote seems to be busted. Do you still have available kits?

  4. Each lamp and remote has a unique code. The kit learns the code by eavesdropping on the messages between the remote and lamp. Are you sure the remote is broken ? The batteries die pretty quickly.

  5. Hi from India,

    I’m working on a WSN project and I would like to know if your shield is on sale. if so, I’d like to buy a few.

    Cheers!

  6. Hi Ivo!
    I received the shield today and I got up running in five minutes! The shield looks very well manufactured and is kapton isolated from the usb plug, preventing shorts with the arduino usb socket (unlike many shield i tried before).
    It works like a charm.
    Very nice job mate, and many thanks for providing this shield!

  7. Hi Ivo,

    I finally managed to test the shield you send me.
    Unfortunately I could not get the controller to work…the board sends the “!” command, but whatever command I send then, it just ignores it. Can you give me some advice?
    Thanks in advance,
    Matthias

  8. Hi, I’m interested to buy this shield. Could you Plesse send me details how to order this? Thanks!

  9. Hi,
    I would like to buy a shield from you if that’s still possible…
    I have the lamp but remote seems broken and i can’t do anything with the lamp now.
    Would greatly appreciate

  10. If you don’t have a working remote there is no way for the shield to find out the address of the lamp. If you can borrow a remote the you can bind the lamp to the new remote and then learn the address with the remote.

  11. Hello,

    I’m interested in a cc2500 arduino shield. Do you still have one for sale?
    Thank you in advance.

    Jurn

Leave a Reply

Your email address will not be published. Required fields are marked *