The image below is a link. Try to click on it.

Playing with Arduino Irdroid and Car Halo light led controller

The Car Halo LED Light controller is controlled using a cheap remote control using a EV1527 Encoder chip, which is compatible with the Arduino / Raspberry Pi  rc-switch library. I has able to clone the remote control buttons using a cheap RF radio transmitter and receiver AM modules, working at 433MHz. Then I was able to control the Car Halo Light led controller , using the Irdroid IoT SmartHub.

The image below is a link. Try to click on it.

WiFi to Infrared module introduction

 

The WiFi to Infrared (IR) converter module will allow you to remotely control your home appliances ( Air Conditioners, TVs , Audio, STBs, DIY devices and many more ), using you smartphone via the free application for Android and iOS. The module comes with a microUSB power supply cable and a user manual for downloading and configuring the application for Android and iOS. The unit is truly universal as you can choose thousands of devices remote control codes and in addition if your target device is not in the database, you can “record” your remote control as the wifi to infrared module has a infrared “learning” function, so that you seamlessly add your device in case it is not in the database of supported devices.

The video below shows unboxing of the WiFi to Inrared module

 

The Wifi to Infrared module has build in functions for automatically recognizing the target device / infrared  remote control . If you have the original device remote control you can add it by simply scanning the original remote control infrared commands. These scanning  / learning functions are build in in the free applications for Android and iOS that comes with the WiFi to Infrared module.

The video below demonstrates how the remote control “learning” procedure works. It shows you how to add an Air Conditioner remote control in the App.

 

You can purchase WiFi to Infrared module from the link below:

– https://irdroid.eu/product/wifi-to-ir-converter/

 

The image below is a link. Try to click on it.

Battery powered infrared devices considerations and design using open source tools and hardware

Designing battery powered devices that have to run for years on batteries is a challenge. If you look around you will see that most of the home appliances such as TVs, Music devices, Aircons, Heaters, Fans and so on are controlled using battery powered remote controls. The remote controls used with these devices should run for long periods of time on batteries.

 How is this achieved? Can we design a embedded custom remote control, by using open source hardware and software tools?

The Answer is Yes. We can use off-the-shelf low energy power consumption microcontrollers which will allow us to run on batteries for long periods of time. In this post we will review the possibilities with Atmel Atmega328P microcontroller, running at 16MHz and powered by 3.3V. We will also review and measure some off-the-shelf open source hardware development boards like Arduino, Olimexino etc.

 

We will review the following:

  •  Breadboarded Atmega328
  • Arduino UNO R3 Atmega328

  • Olimexino 328 uses Atmega328

 

According to the MCU specification the microcontroller supports sleep modes with minimal power consumption (Approximately 0.1uA).

 For the measurements we will use the BRYMEN 867s Digital Multimeter.

According to the MCU Specification we will have to power the Atmega with 3.3V in order to benefit from the lower current/power consumption. For the breadboarded version,we have just the Microcontroller, a quartz and two caps we are expecting to get the lowest result/ measurement.

 

In terms of software for our tests we will use a test program that will put the MCU in sleep mode, written for Arduino . The test program does really a simple thing – when the MCU is awaken / not in sleep mode it flashes the board LEDs for 5 times it waits for 10 seconds, then the microcontroller is forced to enter sleep mode. The sleep mode can be interrupted by grounding the INT0 pin of the MCU. The idea is that when in sleep mode all MCU peripheral and core is switched off and therefore we have minimal power consumption. Nothing is running in sleep mode, except for the logic that wakes up the MCU. The main program of the MCU is executed every time waken up, it does its thing and then it goes to sleep after a user defined period of time (usually several seconds after it performs a task.)

 

We have the following listing:

 /*———————————————————————-*

* Sleep demo for ATmega328P.                                           *

* Wire a button from digital pin 2 (INT0) to ground.                   *

* Wire an LED with an appropriate dropping resistor from pin D13 to    *

* ground.                                                              *

* Pushing the button wakes the MCU.                                    *

* After waking, the MCU flashes the LED, then waits 10 seconds before  *

* going back to sleep.                                                 *

*                                                                      *

* Jack Christensen 07May2013                                           *

*                                                                      *

* Tested with Arduino 1.0.5 and an Arduino Uno.                        *

* Test conditions for all results below:                               *

*   5V regulated power supply, fed to the Vin pin                      *

*   16MHz system clock                                                 *

*   Fuse bytes (L/H/E): 0xFF / 0xDE / 0x05                             *

*   Optiboot bootloader                                                *

*                                                                      *

* Uno R1                                                               *

*   38mA active, 26mA with MCU in power-down mode.                     *

*                                                                      *

* Uno SMD edition                                                      *

*   42mA active, 31mA power-down.                                      *

*                                                                      *

* Adafruit Boarduino                                                   *

*   Power select jumper set to “USB”, USB (FTDI) not connected.        *

*   15mA active, 3mA power-down.                                       *

*                                                                      *

* Adafruit Boarduino without power LED                                 *

*   12mA active, 0.1µA power-down.                                     *

*                                                                      *

* Breadboarded ATmega328P-PU                                           *

*   12mA active, 0.1µA power-down.                                     *

*                                                                      *

* This work is licensed under the Creative Commons Attribution-        *

* ShareAlike 3.0 Unported License. To view a copy of this license,     *

* visit http://creativecommons.org/licenses/by-sa/3.0/ or send a       *

* letter to Creative Commons, 171 Second Street, Suite 300,            *

* San Francisco, California, 94105, USA.                               *

*———————————————————————-*/

#include <avr/sleep.h>

 

const int LED = 13;                          //LED on pin 13

const unsigned long KEEP_RUNNING = 10000;    //milliseconds

 

void setup(void)

{

   //to minimize power consumption while sleeping, output pins must not source

   //or sink any current. input pins must have a defined level; a good way to

   //ensure this is to enable the internal pullup resistors.

 

   for (byte i=0; i<20; i++) {    //make all pins inputs with pullups enabled

       pinMode(i, INPUT_PULLUP);

   }

 

   pinMode(LED, OUTPUT);          //make the led pin an output

   digitalWrite(LED, LOW);        //drive it low so it doesn’t source current

}

 

void loop(void)

{

   for (byte i=0; i<5; i++) {     //flash the LED

       digitalWrite(LED, HIGH);

       delay(100);

       digitalWrite(LED, LOW);

       delay(100);

   }

   delay(KEEP_RUNNING);           //opportunity to measure active supply current

   digitalWrite(LED, HIGH);       //one blink before sleeping

   delay(100);

   digitalWrite(LED, LOW);

   goToSleep();

}

 

void goToSleep(void)

{

   byte adcsra = ADCSRA;          //save the ADC Control and Status Register A

   ADCSRA = 0;                    //disable the ADC

   EICRA = _BV(ISC01);            //configure INT0 to trigger on falling edge

   EIMSK = _BV(INT0);             //enable INT0

   set_sleep_mode(SLEEP_MODE_PWR_DOWN);

   cli();                         //stop interrupts to ensure the BOD timed sequence executes as required

   sleep_enable();

   //disable brown-out detection while sleeping (20-25µA)

   uint8_t mcucr1 = MCUCR | _BV(BODS) | _BV(BODSE);

   uint8_t mcucr2 = mcucr1 & ~_BV(BODSE);

   MCUCR = mcucr1;

   MCUCR = mcucr2;

   //sleep_bod_disable();           //for AVR-GCC 4.3.3 and later, this is equivalent to the previous 4 lines of code

   sei();                         //ensure interrupts enabled so we can wake up again

   sleep_cpu();                   //go to sleep

   sleep_disable();               //wake up here

   ADCSRA = adcsra;               //restore ADCSRA

}

 

//external interrupt 0 wakes the MCU

ISR(INT0_vect)

{

   EIMSK = 0;                     //disable external interrupts (only need one to wake up)

}

 

The code will flash the board leds 5 times, wait for 10 seconds, to allow us to make a measurement and then it will force the MCU to enter sleep mode.

 

We have tested breadboarded Atmega328, Arduino UNO R3 and Olimexino 328, as you can see from the code header, other people has tested and mesured also for other boards , based on Atmega328.

 

The results for the breadboarded Atmega328 are stunning – 0.1uA in sleep mode, though there is nothing else than the microcontroller, a quartz and 2 caps,powered by 3.3V. (the first pretendent )

 

The second in this list is the Olimexino 328 , running at 16MHz, powered by 3.3V. The board is designed with on board charger for connecting external batteries. In a running mode the total power consumption at 3.3V was about 7ma , in sleep mode this board consumes approximately 200uA, which makes it usable for battery powered devices. (Our second pretendent)

 

And finally the Arduino UNO R3 gave us high power consumption both active and sleep modes (  38mA active, 26mA with MCU in power-down mode ) which renders it unusable for designing battery powered infrared applications.

 

Conclusion:

 The user should either make a custom design , using the Atmega328 and create a design with low energy consumption in mind, or use the Olimexino 328 as a basis, which is open source hardware and it has a decent power consumption both active and sleep modes.

 

Downloads:

 

 

The image below is a link. Try to click on it.

Rapid Infrared Remote Control App development with Irdroid

In this blog post I will share my experience on how to rapidly develop custom infrared remote controls for Android using the Irdroid Hardware modules, and in particular the Irdroid WiFi to Infrared adapter module and the Irdroid USB Infrared Transceiver module.

You will learn how to:

  • Rapidly develop Infrared remote control Apps for Android
  • Design custom remote control screens / templates.

The winter is coming and i have decided to purchase additional heater unit for our living room.After i made a short investigation on the Internet I found that there are plenty of home heating units, with ability to be controlled  via small infrared remote controls like this one. In my particular case the heating unit is Tesy (Bulgarian brand) MC 2014. The unit comes with a small infrared remote control, that allows the user to set the heater temperature, to turn on/off the unit, to set a on/off timer as well as to set the unit to work @ 1000W or 2000W.

Immediatly after i purchased I have decided to make a simple App for Android, showing the same small remote control interface on the Android Smartphone screen, and to allow the user to control the unit via the APP over WIFI, using the Irdroid WiFi to infrared adapter module.

So far so good , but how to transmit the same codes that the remote transmits to the Tesy MC 2014 unit ?

Well, the Irdroid WiFi to Infrared adapter consist of two modules – the main wifi unit and the USB Infrared Transceiver unit. The Irdroid USB Infrared Transceiver unit can be used to transmit and receive infrared signals. So I used the Irdroid USB Infrared transceiver to scan the remote codes, using Winlirc / LIRC . In my particular case I have used Winlirc and the built in irrecord command line tool to record the infrared remote control codes and to generate a file with that codes.

To be able to scan infrared remote codes under Windows you need to  install the Irdroid USB IR transceiver ACM driver for Windows by downloading it from here https://irdroid.com/downloads/?category=5 , you will also need to download and configure WinLirc (Which is described here : https://irdroid.com/downloads/?did=17)

After I have scanned the Infrared remote control buttons of Tesy MC 2014, I ended up with the following file:

 # Please make this file available to others
 # by sending it to <lirc@bartelmus.de>
 #
 # this config file was automatically generated
 # using lirc-0.9.0(IRdroid USB IR Transceiver) 
 #
 # contributed by
 #
 # brand:                       Tesy MC2014
 # model no. of remote control:
 # devices being controlled by this remote:
 #
 begin remote
 name  Tesy
 bits           16
 flags SPACE_ENC
 eps            30
 aeps          100
 header       8969  4395
 one           599  1607
 zero          599   489
 ptrail        604
 repeat       8981  2156
 pre_data_bits   16
 pre_data       0xFF
 gap          39670
 repeat_gap   95433
 toggle_bit_mask 0x0
 begin codes
 power                    0x50AF
 plus                     0x20DF
 minus                    0xE01F
 timer                    0xF807
 temp                     0x08F7
 end codes
 end remote

The above file is used by LIRC to regenerate the Infrared Signals transmitted by the TESY MC 2014 remote. This file is to be downloaded to the Irdroid WiFi to infrared adapter. The procedure for adding new lirc conf files to the Irdroid / LIRC database include sending an email with the file to info@irdroid.com and adding the file in the Irdroid WIFI database. After that I have added the Tesy lirc conf file to the Irdroid WiFi to infrared adapter by visiting the link https://irdroid.com/db/database/index.php?dir=Tesy%2F and clicking on the file Tesy.conf (make sure that you are connected to the Irdroid WiFI to infrared adapter and the adapter itself is connected via ethernet cable to your home router)

So finally the Tesy.conf file is in the Irdroid WiFi to infrared adapter unit and I can now connect to the adapter using the Amote app for android and control the Tesy MC 2014 from the Amote App.

That is OK but i want to have the same UI design as the original remote, so what to do ?

I have decided to take a picture of the remote, I have used GIMP to edit that picture in order to use it directly as a base for my Tesy remote UI. So now I have the same picture of the Tesy MC 2014 remote , but how to make the buttons on the picure clickable / tapable. I decided to use a second picture loaded the same way as the main ui picture but not visible defining color regions at the places where the buttons are on the original Tesy Remote picture. The user sees the remote control picture and after he tap on the relevant button it is recognized by color from the reference picture and a particular action is assigned for every button.

Once started the application main activity uses the JAVA LIRC client library to connect to the Irdroid WiFi to infrared adapter and to establish a connection with the listening LIRC server Establishing a socket connection the the Irdroid WiFi to infrared adapter is very easy. You need to add the following in your onCreate() method:

client = new LircClient(“192.168.2.1”,8765, true, 3000);

After a connection is estavlished you may start sending commands to the listening LIRC server by issuing:

client.sendIr1Command(“Remote_NAME”,    “Remote_Command”, 1);

For the five buttons that we have on the Tesy MC 2014 we assign the following lirc commands as per the LIRC conf file that we previously made:

client.sendIr1Command(“Tesy”,    “timer”, 1);    // Set unit timer
client.sendIr1Command(“Tesy”,    “temp”, 1);     // Set unit Temperature
client.sendIr1Command(“Tesy”,   “power”, 1);    // Power On / Off
client.sendIr1Command(“Tesy”,    “minus”, 1);    // minus
client.sendIr1Command(“Tesy”,    “plus”, 1);     // plus

Every command has an assigned color from the mask image loaded in parallel with the main UI image, once the user tap in that color region the relevant command is fired up to the
Irdroid WiFi to infrared adapter and the relevant Infared code is transmitted.

So, voila we have a custom remote control, developed in 2 hours and a nice heater for the cold winter nights 🙂

Video

Downloads:

Tesy.conf – LIRC remote control conf file
Tesy App – APK file (Signed)
Tesy App  – Source Code

You dont have a Irdroid WiFi to Infrared adapter?

Purchase one from the links below.

[print_thumbnail_slider]

The image below is a link. Try to click on it.

Irdroid WiRF433 – IoT Development Computer

Irdroid WiRF433 is open source software and open source hardware, low cost starting from USD 38 Linux Industrial grade single board computer with GPIOs capable to operate -25 – +85C

The Irdroid WiRF433 SBC is designed with the Ralink RT5350 SoC, 32Mbytes of RAM and 4 Mbytes of Flash. The Irdroid WiRF433 board is designed with 2 ethernet ports, therefore the board can be used for routing.

All the GPIOs of the RT5350 Soc are available on the WiRF433 board pin headers. The Irdroid WiRF433 comes also with a RF433MHZ RF module which allows for controlling IoT Remote control switches, light bulbs and sockets operating at 433.9Mhz.

Irdroid WiRF433 is completely open source – including hardware and software, this means you have access to all CAD files and sources and you can reuse them for your own personal or commercial project. There are NO restrictions to manufacture and sell these board for your own use or resale.

Main Features:

  • Mips Architecture CPU @360Mhz
  • 32 Mbytes of SDRAM
  • 4 Mbyets of FLASH memory
  • 1 USB 2.0 HOST Port
  • 1-SPI, 1-I2C , and on I2S (AUDIO)
  • WiFi 802.11b/g/n interface
  • 2 Ethernet interfaces 1WAN and 1LAN
  • RF433 RF Remote control interface with onboard Antenna

The Irdroid WiRF433 SBC comes with preinstalled uboot bootloader and OpenWRT Linux distribution, which includes also IoT remote control applications and software like RCSwitch for controlling RC 433.9Mhz remote control switches and a Mobile HTML5 web application , configured for work with the RC switches, which gives the possibility to add unlimited number of RCSwitches

APPLICATIONS:

  • Home Automation Development Computer. The Open Source apps like LIRC,RCSwitch and serial web proxy will allow you to rapidly and easyly build Home Automation Systems
  • IoT Development Computer. With its available interfaces, you can turn Irdroid WiRF433 into a IoT main unit, and you will be able to control RC Switches, RC Lights and RC Sockets
  • Internet Router with IoT capabilities – The OpenWRT open source Linux distributions will allow you to easyly create one
  • Inexpensive PLC with the open source protocols, available on the Internet.

WEB RESOURCES:

HARDWARE

The Hardware project is released under the Creative Commons Attribution-Share Alike 3.0 United States License. You may reproduce it for both your own personal use, and for commertial use. You will have to provide a link to the original creator of the project https://irdroid.com on any documentation or website. You may also modify the files, but you must then release them as well under the same terms.Credit can be attributed through a link to the creator website: https://irdroid.com

SOFTWARE

The Irdroid WiRF433 Development board comes with preinstalled uboot bootloader and the OpenWRT Linux distribution. The board also comes with the following preinstalled applications:

  • RCSwitch for controlling RF433Mhz remote control sockets, lights and switches
  • Web Based HTML5 Interface for RCSwitch

The software is released under GPL.