Wednesday, 3 October 2012

Remote controlled volume control

So yesterday I was at the meeting for the IT-group at the local "Kulturbanken". Me and a couple of friends are in the process of starting a Makerspace in the town we live in and as a first project (has to be project based so we can get sponsors) we chose to develop/construct a remote controlled volume control which i will later use in my stereo system.

When I have finished building my speakers (which hasn't been shipped yet...) I will start finishing my amplifiers (the AMP10-Basic and the AMP15 PS-XP) and then sell my current Harman Kardon HK3490. That will put me without volume control and remote control. Since I don't have the need for a full-scale pre-amplifier I was thinking of just having a simple volume control that can be controlled with a remote control.
I consulted my friend Daniel who has lots of knowledge of electronics and such things and he said that we could try it right here and now.

So we started out with a simple IR remote that my friend Robin had, and then an IR-reciever and an Arduino CPU. We found a simple servo in a box too. We started with making sure the IR-reciever worked, by connecting an LED and made it blink everytime the Arduino got a signal from the IR-reciever. Robin did all the programming while I was looking and thinking of the next step. I could probably have programmed that myself but since he is way better than me at programming I let him do the job (and the computer we were using was running Linux and I have no idea how that works).

The IR-Reciever. Ignore the resistor, we had the LED placed there before but removed it before this picture was taken.
The next step was to find out what "codes" the IR remote control was sending when we pushed the + and - buttons on it. We opened some window called "serial monitor" if I remember correctly and there we could see what codes the buttons had.

The next step was to connect the servo to the Arduino board and get that working properly. We managed to get it moving without the remote control at first. Then we implemented that code to the IR remote control and made it possible to control the servo with the + and - buttons on the remote. It was moving very slowly and you couldn't hold the button down, you had to press again to make it move another one degree.

This is with the servo installed (servo not in the picture though, only the cables). 
The next step was to make it possible to hold the button down and the servo would continue to move in the same direction. The code for the + and - buttons were something like "0xFFA25D" (hexadecimal values) while the code for holding down a button (any button being held down) gave "0xFFFFFFFF". To make it possible for the code to remember which way it is moving (since the code for holding down a button is the same for all buttons) we had to make an integer called "Direction". Robin wrote the code successfully and we manage to get that working as well. The only downside was that the servo we were using still moved pretty slow this way. But that doesn't matter since we most likely wont use a servo in the final product.

Then we started working on an ON/OFF function. In the final product I guess we'll control a relay to turn it on and off but for this experiment we decided to try to turn on and off an LED diode. Unfortunately we ran out of time but we think we know how to do it. Connect the LED to an output on the Arduino board and then control the output and set it to either HIGH or LOW. The code for that is really simple and shouldn't pose any problems.

This is how we tried to connect the LED. Robin found some guide on the Interwebs saying it was possible to do like this.
And on my way home I started thinking about the mute function but that shouldn't be that difficult either. Just put a relay in the signal path and control it with the HIGH/LOW function.

What I imagine the final product to be like is an IR remote control with volume up, volume down, on/off and mute buttons. I will then make a tiny case being the "pre-amplifier" housing a potentiometer to control the volym, a mute switch as described above and then some function to cut the power to the amplifiers.

For guidance we used this page

No comments:

Post a Comment