Library, Source Code

Free Four Channel Remote Controller + Documentations

Referred to previous article “Learning-code remote controller and how to decode it” we discussed about it and its library for EV15xx. The source language is C for ATMega8, just explain how to decode remote’s code and you have to add extra parts; so we decided to build a practical 4 channel remote controller project.
Stay with sisoog.

Copyleft License

Depend on “Free software, software freedom”, we publish this project as GPL V3 license. All documents and resources are available to be freely used, modified, redistributed and sold by anyone but not allowed to remove creator’s name.




We used ATmega328p because it is Arduino’s micro. with 16 MHz frequency, but with a little change can be used for other microcontrollers and with other frequency.

It has been used GCC compiler and Eclipse development environment, but you can create a new Makefile and use it in Shell environment or Winavr compiler. It can be used in codevisionavr with a little change as easy as pie 🙂


Learning-remote library’s correction

Because this library has been written in 2009 with no change after that, some parts of library is rewritten such as decoding process as the main part. With the older one, maximum and minimum range of pulse width was micro seconds, that causes trouble when frequency was changed.

The tow upper lines has been deleted, so changing timer frequency has no interrupt. Instead of that it uses pulses width ratio for analyzing their types; now it’s ok to change frequency.

1 MHz and 2 MHz was tested as timer frequency with no problem program worked well.

The other change is about storing receiving data from remote. The older library used an array for storing each bit that needed 24 bites of RAM memory.

The new version of library, each bit uses exactly one bit of memory and data store in long variable with 4 bites. Using lookup table speeds up process that use 128 bites of Flash memory, in comparison with 32 KB Flash memory it’s nothing.

And some other change that make library’s function better.

It is recommended to use the corrected library for your projects.

The above description can help you assemble and assign connections; all pins are changeable except RF_IN. Timer1 is used as timer; pay attention, because of pulse width measurement accuracy, a 16-bit timer is needed, so if you want to change timer, use a 16-bit timer for transferring.

Explain project

The program has three different modes:

  • Normal Mode

After turning on the device, it is in normal mood; on-board LED is on for 1 second and off for 1 second, and pressing each button affects related output.

  • Learn Mode

For using one or more remotes it’s needed to introduce the remotes to the device, so using learn mode.

By pressing device button for 1.5 second, learn mode starts and LED starts blinking fast, then for learning the remote’s code, press one button of the new remote, after learning, device mode is normal.

  • Erasing Mode

For erasing saved remotes, press button for 10 seconds, LED turn on and off for 3 seconds, then all the remotes’ code is deleted from device memory.

Download Source Code

The source code of this project is uploaded at Github and is available to download.




Author: Zeus

Translate: Golnoosh 


انتشار مطالب با ذکر نام و آدرس وب سایت سیسوگ، بلامانع است.

شما نیز میتوانید یکی از نویسندگان سیسوگ باشید.   همکاری با سیسوگ

بازگشت به لیست

دیدگاهتان را بنویسید

نشانی ایمیل شما منتشر نخواهد شد. بخش‌های موردنیاز علامت‌گذاری شده‌اند *