IR Remote Control for Resistor Based Car Stereo Control

One reason not to chain is so that you can more easily control one resistance value without having effects on all the other values in your chain.

Since the receiving device most likely measures voltage, the best chain is one where the resistances are chosen to distribute the voltages across the measurement range.

Your unfinished diagram uses three 1k resistors to make a range of 1k 2k 3k. The difference in voltage between 1k and 2k is unlike the difference in voltage between 2k and 3k. Given enough switches, that difference might not be enough to remove ambiguity in the receiving device.

So I would aim for 1k 2k 4k (multiply by two), or 1k 5k 25k (multiply by five). Assembling these ranges becomes more difficult using a chain, because of how resistors are available in an E series. Assembling them not as a chain can be easier; e.g. 1k 4k7 22k.

This goes back to your test results on how different resistances must be to be differentiated by the device. It is all experimentation, since you don’t know the internal design of the device.

Thanks… You may have missed my earlier responses about my button variance testing, as one of them I didn’t press reply to you. They are up a bit… I’m on my phone at the moment so it’s hard to reference them, but the first one mentions that test you suggested about using a trimpot to find the upper and lower limit of a trained button, and the second lists the sensitivity it has in the lower ranges of resistance with further testing I did. 1K is way over the gap required, hence I believe a large enough spread when starting at 0, until you get to about 15K, when it starts to get close to 1K not being such a large gap anymore in which what you say makes sense, as its is when the curve starts to kick in (be relevant) (metophorically)

sorry… i did it again, the reply didn’t put your name… please read above response i wrote a moment ago about my testing… cheers.

Notifications to me are happening whether you hit reply or not, thanks.

Yes, the results of your trimpot test show the device is sensitive to voltage, not resistance.

Resistors in a divider can create the voltage, as you have already done, but there are other ways to vary a voltage. One such is a Digital to Analog Converter peripheral. The Arduino Uno doesn’t have one built in, but one can be added or made from components. An example is http://littlebirdelectronics.com.au/products/sparkfun-i2c-dac-breakout-mcp4725 or http://littlebirdelectronics.com.au/products/mcp4725-breakout-board-12-bit-dac-w-i2c-interface which requires just two digital wires connected to the Arduino, and the output wire might be connected straight into the device you are hoping to control. The Arduino sketch would then send a number to the DAC, which would represent it as a voltage, and the device should respond. After half a second the sketch would restore the voltage to maximum 3v3, which is what the device understands to mean “no button pressed”. The advantage of the DAC is simplicity of wiring and control; you won’t need a MOSFET for each button. I see that two weeks ago I gave this as a second design choice. :wink:

thanks… sorry about my incorrect language, and thanks for correcting it - much appreciated. i guess i mean related or something then :slight_smile: or i should just put everything in terms of the remote and leave the stereo out of it. basically the higher the resistance of the remote becomes, the less buttons i am able to fit on it as the resistance gap required starts to get crazy large. I understand the stereo is not measuring resistance, but rather the voltage which is being varied by the resistors on the remote. i’ll look again at the DAC example, I think I discounted due to being able to understand the MOSFET scenario and your recommendation to use a transistor… (The cheapest option without isolation is a transistor. That’s probably what I would use.)… i’ll get back to the books… thanks again.

DAC looks good… i think i’ll go down that path and give it a shot. correct me if i’m wrong, but i’m guessing when I measure voltage of the stereo remote wires black and red, and also if I measure with the black and white (both measurements giving 3.25v) - that I’m actually measuring voltage in series? In other words the red and the white wire which I have been thinking are live 3.25v wires are actually not? Basically I’m thinking this must be the case if we are able to send it voltage from an external source and for the circuit to still behave itself? Sorry if it sounds confusion - i’m not sure exactly how to explain what’s in my head.

Yes, does sound a bit confusing.

Series and parallel are arrangements of two or more components. Series means the current must pass through all components, one by one. Parallel means the current may pass through any of the components, all at once.

Hope the following renders correctly for you; if not, use a monospaced character set. Firefox has rendered it properly for me.

Draw some fences and gates to contain a cow, Betsy.

 +-----------+-----+-----+-----------+
 |           |     |     |           |
 |           |     |     |           |
 |    (+)       A     B       (-)    |
 |           |     |     |           |
 |           |     |     |           |
 +-----------+-----+-----+-----------+

In the above diagram, Betsy (or current) must move through both paddocks, (or components) to get to the other side. This is a series arrangement of components.

 +-----------+-----------+-----------+
 |                                   |
 |           |     A     |           |
 |    (+)    +-----------+    (-)    |
 |           |     B     |           |
 |                                   |
 +-----------+-----------+-----------+

In the above diagram, Betsy (or current) must move through either paddocks, (or components) to get to the other side. This is a parallel arrangement of components.

Now current, unlike Betsy, is divisible. Betsy is only divisible into steak. In a parallel arrangement, some of the current can pass through each component. How much, depends on resistance.

Draw a circuit to represent the remote control receiver; the representation is not accurate, just a model to explain what you are measuring. It should have three components and two wires;

  • a 3.3V battery (simulating the internal 3.3V logic power supply of the stereo system),
  • a resistor R1 connecting from the positive side of the battery to the red wire,
  • a resistor R2 connecting from the negative side of the battery to the black wire.
       +-------/\/\/\----O  red wire
       |         R1
       |
    -------  3.3V
      ---
       |
       |
       +-------/\/\/\----O  black wire
                 R2

Now, when you connect a resistor across those wires, the three resistors form a voltage divider, and the remote control receiver measures the voltage of the red wire relative to the negative terminal of the “battery”.

That’s why you should be able to inject a voltage into the red wire relative to the black wire and have it work the same way. As far as the remote control receiver is concerned, it can’t tell the difference between a control voltage or a switched resistor.

the pictures render well, thanks. i have a basic understanding of series and parallel as far as for example connecting batteries in series will increase the voltage, whereas in parallel the voltage stays the same. Also when measuring, if you cut for example a lead to the positive terminal of a battery and measure the cut one for each lead of the multimeter you are measuring in series.
my main confusion comes from how to wire the DAC to the arduino / stereo, as the stereo is a black box with a few wires coming out of it behind I cannot see… I thought (most likely incorrectly) that somehow we can send a voltage without using the black wire of the stereo. I’ve read through the DAC specs and hookup guides, and from what I can tell you power it with a power source, and it provides a ground and a positive terminal out of which the voltage you tell it to comes out of, that you have chosen by sending it a command over I2C. I can’t determine what to do with the wires coming out of the stereo, because in my head they already have a voltage. I then thought maybe the black wire would power the DAC or something similar? but not sure what to do with the negative of the output of the DAC.

You must use both wires, to form a circuit.

Current must flow for voltage to be present. The current can be trivial though.

Yes, the device sends a voltage, but only as a side-effect of how it measures the voltage that comes back from the remote control.

You have already been sending a voltage, by nature of the voltage the device was providing, combined with resistors.

Attach the OUT pin of the DAC to a 10k resistor, let’s call that R3, then from the other side of the resistor to the red wire. Attach the GND pin of the DAC to the black wire.

Now, that circuit looks like this;

     +-------/\/\/\----O----/\/\/\--------+ OUT     +------------ VCC 3.3V
     |         R1                 R3      |         |
     |                                +----------------+
  -------  3.3V                       |    MCP4725     |--------- SDA
    ---                               |                |--------- SCL
     |                                +----------------+
     |                                    | GND     |
     +-------/\/\/\----O------------------+---------+------------ GND
               R2

Now R1 and R2 are unknowns.

Assume the DAC is sending 0V OUT, which is 3.3V below the left side of R1, and with R3 of 10k and worst case zero R1, by ohms law current will be limited to I=V/R, I=3.3/10k, so I=33 microamps.

Assume the DAC is sending 3.3V OUT, and no matter what R3 or R1 is, the current should be near zero.

Make the same sort of calculations using your already working pushbutton and resistor configuration, and you’ll find the currents involved are now much smaller with the DAC, but the voltage will be whatever you set it to.

Assemble the above, and measure voltages and currents to verify the theory. If the theory matches well, you may be able to reduce R3 to eliminate noise.

(What if the remote control receiver has a capacitor bridging the red and black wires? It will make the voltage swing over milliseconds instead of microseconds, and perhaps the microcontroller in the device waits for the voltage to settle before paying attention to the value.)

Additional notes on R1 and R2.

Remember the inside of the device is unknown, all we can deduce comes from measurements.

It could be that R1 is instead a constant current source. This would work too, and in the assembled circuit above you would find a maximum current at DAC 0V still would be 33 microamps because of R3.

It could be that R2 is zero, and the black wire is equivalent to vehicle ground. Or it could be a current source as well. Still it will work. Only way to be sure is to test.

But, as soon as you power the Arduino and DAC from the same ground as the vehicle, it is important to understand what R2 is. None of your measurements so far have related the black wire to the vehicle ground.

thanks… i’ll do some more testing. not sure if it matters, but if the circuit is formed by touching the wires (in other words a button with no extra resistor, the full voltage let through) it registers as a button press (not sure if this is similar to when the DAC is sending OUT 0v or if it is a different scenario?

Yes, having the DAC send 0V would be identical to touching the wires together through a switch.

Having the DAC send 0V is part of a test only, not expected in use. The test was to find the maximum current, which you could also do by touching the wires together through a multimeter set to current.

When idle, that is when you are not intending to send any remote control command, the DAC should be sending 3.3V, or 3.25V, as this should be indistinguishable from the wires not being connected to anything.

It reminds me of another thing; the time between power up and the sketch running to set the DAC may make the remote control receiver think you’ve pressed a 0V button.

But you’re dealing with a system you don’t know enough about; so you’ll have to expect failures of one sort or another.

thanks… that makes sense now, so for practical purposes I could think of increasing the DAC OUT voltage as descreasing voltage in the previous way with resistors? the possible false button press between power up and sketch running is fine, i won’t use that voltage for a button when designing the software and training the stereo; so it will be ignored if it happens.

When only resistors are used in the remote control, then by ohms law as the resistance switched across the control wires is increased, the voltage seen by the remote control device also increases. With no switch closed, the voltage is maximum.

No, when you increase the DAC OUT voltage you will be simulating the effects of a larger resistor.

You should do the training with the DAC and Arduino. You might, for example, use a sketch that receives the voltage as a number sent via Serial from your computer.

When you have that part working, you can move on to IR, and then to final integration.

thanks… haven’t got the DAC part yet, i’ll order it shortly. I sorted out the basics of the IR today. I bought an IR module with the Arduino and had a play around with it today… i assigned remote control buttons to the green, red, and blue led… works well.

Okay, if you haven’t got a DAC yet, you might be able to get things working with a resistor capacitor arrangement on an Arduino PWM pin. A simplified DAC. You tie the PWM pin to a resistor, then the other side of the resistor to the positive side of a capacitor, then the negative side of the capacitor goes to ground. By varying the duty cycle of the PWM you vary the voltage. Don’t go above 3.3V. Tie the positive side of the capacitor to the red wire, and the negative side to the black wire.

Capacitor size will depend on the current drawn by the red wire; try 0.1uF, 1uF, 10uF, with say series resistors of 1k, 10k, 100k.

And just to explain further, if the Arduino PWM pin is floating the red wire will charge the capacitor to 3.3V, and your sketch should switch to PWM output at duty cycles less than 66% during which the LOW pulses from the PWM pin will discharge the capacitor a little bit each time, lowering the voltage to what you choose, which the remote control receiver will interpret as a button press.

After sending a command like this, the PWM pin should be switched back to being an input, and that will then let the capacitor rise again to 3.3V, which the remote control receiver will interpret as button release.

thanks… very useful. i’ll go check the current now… i’m assuming i can check for current with just the multimeter, can i judge what size capacitor I need going off the current? i think what you are saying is that if i use a 0.1uF capacitor then put it in series with a 1k resistor… what sort of current drawn by the red wire would map to each different capacitor you list? thanks.

just did a current test… as mentioned there are three wires, the black - and two control wires; the red and white… the current drawn from black to red is 2mA, same as the current drawn from black to white (2mA). would a 0.1uF capacitor with a 1k resistor suite this?

i used the fading example and managed to hook up the circuit like you described with the capacitor and depending on the value for analogWrite it changes the voltage of the other circuit that i have hooked up with 3v from 2x1.5v. i’m happy that works well and i’ve experimented adjusting the voltage etc… and all seems good. the issue i have now is as soon as i introduce the IR, specifically the command irrecv.enableIRIn(); the voltage on the other circuit no longer behaves as expected and is a constant ~3v. I thought this may be due to digital / analog compatibility or something, the pins I am using are different, and i’ve also tried seperating the IR input pin to the first 4 headers, and the other stuff in the 2nd 4. any ideas?