IR Remote Control for Resistor Based Car Stereo Control

You are correct, i tested the voltage in series. I thought if i tested voltage across the wires i would be shorting the circuit… I’ll give it a shot and see what results I get. Unless I’ve misunderstood by what you mean by across the wires - negative of multimeter to ground wire from stereo, positive of multimeter to positive of stereo.

I realised I didn’t need the first 1K resistor, so i removed it… (after removal I had to retrain the first button, but the other three still worked to what they were trained to). I ran voltage tests with both the 1K at the start, and without… Results are as follows (1K, 0.834v; 121K, 2.886v; 241K, 3.014v; 361K, 3.065v)… without the 1K the results are (first button, 0.6v; 120K, 2.882v; 240K, 3.01v; 360K, 3.061v). Also it’s worth noting that the voltage seemed to drop to 3.235 (i’m not sure when and i didn’t turn the car off and back on to check, but basically the first time I tested the voltage before any button pressing it measured 3.24. (pretty sure i had the breadboard wired up at this point – this could be due to loose connections or something similar as I don’t have any wire clips yet for the multimeter… not sure if significant).

Okay, thanks. The results don’t match a single resistance inside the system. It won’t be possible to predict the least resistance gap that will be differentiated.

Only thing left is to try it. You can buy trimpots, variable resistors with a multiple-turn screw head, and gradually vary the resistance to figure out how far off it has to be before the system refuses to differentiate.

e.g. Jaycar RT4616 20k 10-turn trimpot, or RT4608 1k.

Can also put them in series to make really fine adjustments.

thanks… i obviously have a lot to learn :slight_smile: I appreciate all the help… FYI I did a bit of an experiment last night and was able to get the first 3 buttons accepted as follows (first button (no resistors), second button (1K), third button (86K)…

No worries, quite normal.

Use a trimpot, set it for a particular resistance about midrange, e.g. 10k for a 20k trimpot, or 50%, then train the system for that as a button, then change the resistance until you find the button does not work, measure that resistance, then turn it back slowly until you find the button does work, measure that resistance, then turn it over the other side of the midrange and use the same method to find at what resistance it doesn’t work. That will give you a very good idea of how the system works.

Resistors change resistance slightly with temperature, so the system has to be able to cope with changes.

A button trained at 51K is treated as different (+4.5K) at 55.5K and (-4K) at 47K. A button trained at 152K is treated as different (+29.2K) at 181.2K and (-21.1K) at 130.9K.

It is extra sensitive at the lower levels of resistence, i was able to train 21 buttons between 0-10K and 10 buttons between 10K to 17K, that’s more than enough. got my audrino kit during the week, so time to crack it open and see if i can drive these MOSFETs.

hi mate sorry to bother you, but i’ve got a bit of question… i have done a bit of reading but am a little confused, and was wondering if you could relate it to my setup… it concerns pull-up and pull down resistors. Are they relevant in my case? If they are I think I have sorted how to do the pull-up resistor by putting a 47ohm resistor between the digital output pin of the arduino and the gate of the mosfet, but i’m a bit lost as far as the pull down resistor goes – mainly due the fact that both the audrino and the other ground are connected to the source. does the pull-down resistor go from the leg of the source pin after which goes both to the ground of the arduino and the stereo or do a use seperate resistors one for the ground of the arduino and one for the ground of the stereo?

At the gate drive frequencies you’ll use for remote control of a sound system, frequencies under 10 Hz, you don’t need to worry about gate capacitance that much, or the transitions of the gate voltage. They will be comparatively rare. So a series resistance between the Arduino and the gate may not be required.

However, if you want to put one in so the design looks proper, then yes, 47Ω is a reasonable choice.

A series gate resistor as described above is neither a pull-up nor a pull-down.

A pull-up resistor connects from a pin to the logic supply voltage. The Arduino has built-in pull-up resistors that can be turned on or off under software control. The purpose of a pull-up resistor is to provide a path for current so that the voltage of the pin can be constrained. An example is a digital input pin with a switch between it and ground. With the switch open, the pin is floating. This is ambiguous, and the Arduino sketch may read either a HIGH or a LOW. Waving a hand near it can change the result. Adding a pull-up removes the ambiguity. The voltage will be HIGH unless the switch is closed, when it will be LOW. The value in ohms of the resistor is not so critical, but it must be large enough that a significant current does not flow when the switch is closed. Ohms law comes into play.

A pull-down resistor is like a pull-up resistor except it pulls a pin down to ground.

When driving those MOSFETs from an Arduino, your sketch will drive the pin HIGH or LOW, and should not leave the pin floating. Therefore you don’t need a pull-up or pull-down on the pin that is connected to the gate; there will never be ambiguity.

However, if you want a perfect design, a 10 kΩ pull-down may handle the scenario of the first few milliseconds between power being applied and your sketch running.

thanks for this, i’ll sketch up the schematic this weekend and upload it here if you get a chance to look at it (no rush - i’m taking this whole process nice and slow, and also i’m busy at work! can’t wait for holidays)… i’ll do some reading in to pull-ups and pull-downs. I understand what you say about pull-ups going to the supply voltage, and pull-downs going to ground but I think my understanding is still lacking a bit. For example, in your last sentence I am unsure if you mean to connect the arduino pin I am using for the gate with a pull-down (which I think you are) or if i should connect a pull down from the source pin of the mosfet to the ground. (which I think you might be). In either case, because I will be using multiple pins (one for each button/IR signal), is it okay to share the 10k.

sorry…my latest message a couple of minutes ago I didn’t click reply to yours - so not sure if you got notification. thanks.

There would be one pull-down resistor per MOSFET gate.

Do draw a circuit.

One of the laws of circuit theory is that everything attached to a node will be at the same voltage.

A node is where components are connected.

When you connect an Arduino pin to the MOSFET gate, that connection is a node, with two components connected to the node.

When you add a pull-down resistor between the MOSFET gate and ground, that node now has three components.

As a consequence of the law above, it means that one end of the resistor will have the same voltage as both the Arduino pin and the MOSFET gate.

If you then connect that same resistor to another Arduino pin and another MOSFET gate then all five things will have the same voltage;

  • the first Arduino pin,
  • the first MOSFET gate,
  • the second Arduino pin,
  • the second MOSFET gate,
  • one side of the pull-up resistor.

Because the gate voltages are the same, the two MOSFETs would be on or off at the same time; they could never be in different states.

This is less useful than a separate resistor. You can’t possibly share the 10 kΩ resistor unless you intended that the MOSFETs always be in the same state.

Also, if the Arduino pins were connected together, you would also have to write the sketch very carefully to make sure you never set one of them HIGH while the other is LOW, or vice-versa. If you did, then the Arduino would try to pass current from one pin to the other, and this may damage the Arduino, or collapse the power supply on the board.

It is very unusual to try this. :grin:

Now, about the source pin of the MOSFET. Since it would normally be connected to ground already, there would be no possibility of adding a pull-down resistor to that node; both sides of the resistor would be connected to the same node.

If you mean disconnecting the source pin of the MOSFET from ground and substituting a resistor; this isn’t a pull-down configuration.

It would raise the source voltage, and if large enough the MOSFET would not turn on; because a MOSFET turns on when the gate voltage is higher than the source voltage by a certain amount, called the threshold.

thanks… that makes more sense now… i realised when I was typing my last message that it didn’t make much sense and what I was thinking about with the pull down resistor was pretty much what you had already told me was not a pull-up resistor (well kind of) - in addition as to what you mention about the voltage, it also effects the number of buttons I will be able to have in a negative way if i put a 10k before the ground of the stereo circuit - but i guess this may have been only for the arduino circuit…
I’m sketching in EAGLE, it’s my first time using it but I’m running through a few tutorials and starting to get the hang of it… just wish I was able to take some holidays from work, but real busy at the moment :slight_smile: thanks again and I’ll upload a schematic and board when I have something worth looking at.

Perhaps it isn’t time for you to learn EAGLE. Try pen, paper, and a camera to share. :wink:

Resistors are really cheap and you should expect to use many of them.

You don’t have to chain the resistors up like you did on the protoboard. You can instead have one resistance per switch, as long as the resistance is different. Try it on your protoboard.

The resistors that select the function should work fine between the drain of each MOSFET and the red wire on your protoboard photograph. I’m assuming N-channel MOSFETs. When used as a “low side switch”, the source is connected to ground, the gate to your control voltage (the Arduino pin), and the drain to one side of the load. The load in your case is a resistor connected to a remote control input.

sorry i forgot to mention… i successfully got the arduino on the weekend turning off and on a 2N7000. The 2N7000 was on a breadboard with an LED, one resistor for the LED, and a couple of resistors (i put small ones next to where i thought pull-up and pull-down were just in case), and it’s own powersource 3v (2x1.5v batteries). The arduino was running off my USB on my PC. I hooked it up like you described in an earlier message. So the arduino was signaling the gate, and LED was turning off and on like expected… but i didn’t run it for too long as I was a bit paranoid about the pull-up, pull-down stuff.

Sounds good. Small isn’t good for a resistor choice when you don’t know what it is for. Because by ohms law, current increases as resistance decreases. You have a meter you can use to measure current and voltages? Next time you do a test, measure as much as you can.

okay… i did a bit of search before i pressed go, i wasn’t worried about blowing the LED or the MOSFET but concerned about the arduino / arduino shield… i put a 1K resistor for the LED, a 47ohm on the output pin of the arduino as i found that through google and also a 47ohm on the drain before the connecting to the negative of the battery and ground socket of the arduino… i figured i was fairly safe of not bricking the arduino / arduino shield, but i will keep that i mind. yes i have a meter, i’ll make sure to use it always.

sorry i think i meant source not drain there… i’ll double check…

here’s a picture of the breadboard i had hooked up to the adruino.

the black and the green jumper leads are for the arduino and the resistors from left to right are 470, 47, 1K. 3v (2x1.5v) are connected with the red and black wires to the power rail. (edited: i meant 470, 47, 1K)

is there a reason to not chain the resistors? cost wise doesn’t bother me, but i would assume the cost would be the same either way as I would still need the same number of resistors both ways, albeit different resistance levels depending on which way. I’m just wondering if there is something else I am missing as to a reason? easier to wire or something? thanks again for all your advice… i’m off to work, i’ll start with pen and paper like you suggest… i had already done a quick pic (unfinished) in EAGLE if you’re interested, ignore the model of the mosfets in the pic, i couldn’t find the one’s i needed in the software…