My television is mounted on an fancy 'mMotion Swing' mounting bracket made by Sweedish 'People of Lava'. The mMotion Swing is motorized and by using it's remote control, I can bring my television into any angle between 0 degrees and 90 degrees (probably even more).
I have however had problems with the remote control being unstable. I have been changing batteries, cleaning the battery terminals, cleaning the PCB, tearing my hair out,.... nothing helped.
A replacement remote control is not terribly expensive (https://buylava.com/collections/other/products/mm...) but would be too easy, right? So I made a replacement remote control.
Step 1: Build Remote Control
The images above shows a simple proof-of-concept construction. This is what you will need:
- Arduino (I used a Nano)
- IR tx LED
- 220Ohm resistor
- Push button
- 3 position switch
- 9V battery
- Battery connector
- Some wires
- An enclosure (e.g. a used jewel box like on the photo)
Step 2: Software
The software is very simple, and can be found here: https://github.com/LarsWH/arduinoLavaRc
It does however require a modified library as well, which can be found here: https://github.com/LarsWH/Arduino-IRremote
The software can be build with a standard Arduino IDE, but has been developed using Microsoft VisualStudio with the 'VisualMicro' plugin.
People of Lava have been kind enough to published the IR commands as a PDF here: http://www.peopleoflava.com/info/mMotion/IR%20Code. But unfortunately the instructions only partly workded for me.
These commands are the ones that did work for me:
- Auto: RC5 code: 0x0C (as per the documentation)
- In: RC5 extended code: 0x1B 0x5E (unlike the documentation)
- Out: RC5 extended code: 0x1B 0x5F (unlike the documentation)
More information about the RC5 protocol here:
Step 3: For the Record...
Looking at the project now, it all seems very simple, but in fact it took many many hours of reverse engineering:
- Building up a general-purpose IR monitor (arduino based) to record signals. In the end I did not really need this - just the oscilloscope
- Capturing IR signals on oscilloscope, to learn that the Lava documentation must be wrong.
- Getting the timing right. Especially a silence period of approx. 80ms between repeating signals seems important
- Trying to do all the above with a semi defect Lava remote control, that only sometimes would output a signal.
- Develop an extesion to the existing IR library in order to have support for 'RC5 extended'
Step 4: Build Into Box
Since this a very simple construction, there is no need for a PCB. The few wires can be soldered directly onto the Arduino Nano.
Fitting everything into the jewel box is a bit tricky, but doable. The used jewel box is a temporary solution (has been for many months now....), but my daughter thinks of it as her contribution to the project, so it stays like this a little while longer.
Step 5: Future Improvements
When I get around to it, I would like to make these improvements:
- Range: Increase the IR LED output to get more range of usage. If the IR LED is driven more directly from the battery (controlled by a transistor), a higher current can be provided, and thus more light emitted.
- Power on: Decrease the power-on time of the Arduino, so commands are sent without any noticeable delay. The current power-on delay is around 3s.
- Buttons: Replace the current 1 switch + 1 button with 3 dedicated buttons
- Enclosure: Something nicer than a used jewel box