Newbie needs help! Relay diagram question

Discussion in 'The Projects Forum' started by merzatt, Jan 15, 2009.

  1. merzatt

    Thread Starter Active Member

    Jan 15, 2009
    37
    0
    Here is my problem. My car's microprocessor controls the radio button illumination but not the LCD night/day brightness setting. When the parking lights turn on, it provides Pin A with 0.2 - 12 v for variable illumination level. But it doesn't provide the signal radio needs on Pin C to switch the LCD to day/night mode i.e white and black background. So, when I turn the parking lights on at night, buttons light up but LCD is always bright.

    Radio dims the LCD to night mode when the Pin C circuit is open (0 volts). And switch back to day mode when it receives a positive signal. I do not know the correct current but anywhere between 0 to 12 volts worked for Pin C.

    This is my solution I am using the Pin A signal for both illumination and signal for relay. When the parking lights turn on, (usually 9-10 volts) this should turn on the lights and also open the Pin C circuit. When I turn the parking lights off, remaining current on Pin A is enough to send a signal to switch the LCD back to day mode. I tested this manually and created a diagram.

    Questions:

    1) Is the diagram correct? I do not want to harm very expensive microprocessor and radio.
    2) What diode and relay should I use? Solid state for no clicks?
    3) Can I ground the relay to the radio or not?

    Please help. this is my first ever project.
     
    Last edited: Jan 19, 2009
  2. mik3

    Senior Member

    Feb 4, 2008
    4,846
    63
    Are you sure the output of the microprocessor varies between 0.2 and 12V or it just outputs two values (0.2 and 12)? If the voltage on pin A varies from 0.2 to 12 V then you can't use this pin to drive the relay and provide a signal for pin C. Is there any other output from the microprocessor which changes when you turn on the lights?
     
  3. merzatt

    Thread Starter Active Member

    Jan 15, 2009
    37
    0
    As you said, microprocessor probably gives 0 or 12v but the current radio receives is adjusted by the instrument cluster illumination knob. My usual setting is ~9 volts.

    I have a 12V 20/30 amps relay for testing and it works with a current from 9v battery. Am I missing something?
     
    Last edited: Jan 16, 2009
  4. mik3

    Senior Member

    Feb 4, 2008
    4,846
    63
    It is not a good idea to drive a relay directly from a microprocessor because you will destroy the microprocessor unless it can handle the current the coil of the relay needs. In your case you don't need to use a relay, use a transistor. If you know how to use MOS transistors use one otherwise use a BJT one. Connect the emitter (source) of the transistor to ground and connect its collector (drain) to 12V via a 1K resistor. Then connect the output of the microprocessor to the base (gate) of the transistor via the a 1K resistor. Finally, connect pin C on the collector (drain) of the transistor.
    Note, that if you use a MOS use a 500 ohm resistor between the gate and the output of the microprocessor and also put a 10K resistor between the gate and source.
     
  5. merzatt

    Thread Starter Active Member

    Jan 15, 2009
    37
    0
    Is this circuit correct? Will this setup cut the current on Pin C when there is 0.2 to 12 volts on Pin A (parking lights on)? What will be the current on Pin C when lights are off?

    Also will 2N3906 transistor work here?

    Thank you
     
  6. mik3

    Senior Member

    Feb 4, 2008
    4,846
    63
    Yes, the transistor is fine, don't worry about the current in pin C, it won't be much, just a few mA. This circuit will give 0V to pin C when A is 12V and 12V to pin C when A is 0V. Is that you want?
     
  7. merzatt

    Thread Starter Active Member

    Jan 15, 2009
    37
    0
    That's what I wanted to do. If the illumination pin (A) and LCD pin (C) are wired parallel, radio doesn't switch back to day mode. I will build this circuit and see how radio will act. Thank you!
     
  8. merzatt

    Thread Starter Active Member

    Jan 15, 2009
    37
    0
    Ok, I just tested this circuit. It didn't do the job exactly. If the voltage on Pin A is let's say 9 volts, it gives 3 volts out of pin C and it doesn't work. Signal on Pin C should be either 0 or 12 volts for the radio to switch.

    The final solution is this;

    Pin A (lights)--> Pin C ---> Radio LCD
    ------------------ ------- -------------
    0 volts----------> 12v -----> day mode
    0.2 - 11.7v------> 0v -----> night mode

    How do I do this?

    I don't know it matters or not but I used NTE101 (NPN) as the transistor.
     
  9. mik3

    Senior Member

    Feb 4, 2008
    4,846
    63
    It should work. Increase the resistor on the collector to 10K. Also, check the voltage across the 1K resistor on the base when A is high.
     
  10. merzatt

    Thread Starter Active Member

    Jan 15, 2009
    37
    0
    Mik, I increased the resistor to 10k and it didn't make any change.

    Currently

    Pin A (lights)--> Pin C ----> Radio LCD
    ------------------ ------- ------------------
    0 volts----------> 12v -----> day mode
    0.2 - 11.7v----->(12v - A volt) ->day mode {Pin C should drop to 0 for the radio to switch.}

    Here is the latest diagram. Let me know what I am doing wrong. :confused:
     
  11. mik3

    Senior Member

    Feb 4, 2008
    4,846
    63
    The diagram is fine. Are you sure pin A outputs 12V when it is high?
     
  12. merzatt

    Thread Starter Active Member

    Jan 15, 2009
    37
    0
    Pin A output can be between 0 to 11.7v when lights are on. It is adjusted by the instrument cluster knob. Usually it has 9 volts. When lights are off, it has 0.

    Pin C gives 12v when A is 0v (OFF) This correctly switches to Day mode.

    Pin C gives 3 v when A is 9v (ON) Pin C needs to drop below 0.5v to switch to night mode.
     
  13. mik3

    Senior Member

    Feb 4, 2008
    4,846
    63
    I think pin A is not able to provide enough current to saturate (fully turn on) the transistor. Also, if the voltage on pin A is reduced a lot the transistor won't fully turn on. Use a n channel MOS instead of a BJT which fully turns on at a gate voltage of 5V.
     
  14. merzatt

    Thread Starter Active Member

    Jan 15, 2009
    37
    0
    I am thinking if PinC = ((V+)-PinA), why don't we lower the (V+)? When the Pin A is equal or less than V+ Pin C will drop to 0.

    I checked the circuit by connecting 3.5V to V+. The voltage on Pin C was 1.5v when the PinA 0 and 0v when the Pin A was 9volts. Radio is able to switch even if + signal less than 12 v. How do I lower v+ current to something like 3-6 volts?
     
  15. mik3

    Senior Member

    Feb 4, 2008
    4,846
    63
    PinC = ((V+)-PinA) this is not true. The transistor circuit should work, something is wrong or the transistor is bad.
     
  16. merzatt

    Thread Starter Active Member

    Jan 15, 2009
    37
    0
    Is NTE101 transistor wrong choice? What should be the correct specifications for BJT or MOS?
     
  17. mik3

    Senior Member

    Feb 4, 2008
    4,846
    63
    Without knowing the what amount of current the microprocessor can provide the NTE101 seems to be fine. Measure the voltage across the 1K resistor when the microprocessor outputs 9V and tell me. If you want to use a MOS choose one which will fully turn on with a 5V gate voltage. For the current rating more than 500mA is more than enough.
     
  18. merzatt

    Thread Starter Active Member

    Jan 15, 2009
    37
    0
    It's 8.5 volts (between the legs of 1k).

    I just came back from shop with this MOS: NTE2987
     
  19. Søren

    Senior Member

    Sep 2, 2006
    472
    28
    Hi,

    Try another 10k resistor from the transistors base to emitter (ground).
    I have a feeling that the line you're driving it from is either 12V or floating (i.e. not connected). If this is the case, the pull down resistor should cure it.
     
  20. mik3

    Senior Member

    Feb 4, 2008
    4,846
    63
    This means 8.5mA through the base which means in the worst case the collector current will be 8.5*10=85mA (if the collector resistor allows such current). In your case the collector resistor is 10K and it needs only 1mA to get the transistor into saturation. This should work unless the transistor is bad.

    Anyway, remove the BJT and connect the MOS with the source to ground, the drain to the 10K resistor and the gate to the 1K resistor. Also, put a 10K resistor between the gate and the source. If the gate voltage is above 5V, pin C will be pulled down to ground.
     
Loading...