Author Topic: My first DigiSpark project: an RC5 remote control  (Read 5301 times)

Paul Boven

  • Newbie
  • *
  • Posts: 8
My first DigiSpark project: an RC5 remote control
« on: May 16, 2013, 02:19:56 pm »
Hi folks,

At work we moved into brand new offices a while ago. They're quite nice, but they do lack something essential: a lightswitch. Instead, there's an overhead motion detector that turns on the light when you enter your office, even during broad daylight. And turns the lights off if it finds you haven't been moving enough, even when it's dark outside. After much complaining, at least the meeting room now has a lightswitch (hard to use a beamer if the lights won't go off). This switch is glued to the wall, and turns out to use infrared signals to communicate with the overhead sensor. The lightswitch retails for over €140, which is a bit much to put in every office, apparently.

Anyway, a bit of research turned up that the switch (a Philips OccuSwitch) uses the RC5 encoding for IR signals, and so my first project was to build an IR remote control for that.

RC5 uses a 36kHz carrier, with about 30% duty cycle, which I generate using Timer0. An ISR then counts the number of pulses, and turns the modulation on or off in the right pattern. The Digispark now lives in the USB port on my LCD screen, and I can simply override the motion detector by having it transmit an 'on' or 'off' every few minutes. And at home, I can use it to change the TV channel.

digistump

  • Administrator
  • Hero Member
  • *****
  • Posts: 1465
Re: My first DigiSpark project: an RC5 remote control
« Reply #1 on: May 16, 2013, 06:04:44 pm »
Very cool project - I love these projects that use a simple piece of electronics to replace a very overpriced one!


Would you mind sharing your source code?

Paul Boven

  • Newbie
  • *
  • Posts: 8
Re: My first DigiSpark project: an RC5 remote control
« Reply #2 on: May 17, 2013, 02:18:04 am »
Sure, there's a few small refinements that I want to do and then I'll share it.

Note that it's not a 'sketch' as I'm not into IDE's. So this is a straight .cpp file that I run through avr-gcc, using the Makefile by Christopher Poole:
https://github.com/christopherpoole/DigisparkArduinoIntegration

I'll try turning it into a sketch before sharing it.

donromeo

  • Newbie
  • *
  • Posts: 1
Re: My first DigiSpark project: an RC5 remote control
« Reply #3 on: June 05, 2014, 08:40:22 pm »
Hi Paul, great post.

Any news on posting the source code.

Thanks in advance.