Car interior light

mikie_121

Member
I'm replacing my interior light with LEDs and I want to make them fade out when the door closes, but I'm having some trouble with connecting my 08M to the existing car wiring.

My interior light has 3 wires: +12V, GND, and Door (Door open = 0V, Door closed = +12V).

I also want to retain all the functionality of the interior light switch (ie ON, OFF, DOOR).

Existing light wiring:


I want to replace ONLY the 'Globe' part of the circuit with my Picaxe circuit. I already have a small 7805 (TO-92) and filtering capacitors on a tiny circuit board measuring 5cm by 2cm. Everything else is sorted, except for the input signal.

So how do I wire the DOOR signal to a Picaxe input to retain all existing functionality? I don't have room to use any more chips so I'm limited to just surface mount components, and I have lots of resistors.
Can it be done?
 
Last edited:

westaust55

Moderator
Connect a 10 kOhm resistor from the +5V (that you are setting up for the PICAXE 12V to the lamp side of the door switch.
That will give a point which is high (5V) when the doors are closed and low when the doors are opened.

See attached modified version of your diagram
 

Attachments

Jeremy Leach

Senior Member
I'll throw this very simple non-picaxe solution in. It relies on the cap being big enough to drive the LEDs for enough time to acheive a nice fade. So not sure if it would work.

Code:
          o 12V
          |
          |
          |
   .------o-----.
   |            |
   V LED        |
   -            |
   |            |
   |            |
   V LED       --- Big Cap
   -           ---
   |            |
   |            |
   V LED        |
   -            ¦
   |            |
  .-.          .-.
  | |R1        | |
  | |          | | R2
  '-'          '-'
   |            |
   |            |
   '-------o----.
           |
           |
           V Diode
           -
           |
           |
Door Signal
R1 sets the brightness of the LEDs. R2 is a low value resistor purely to limit the capacitor charging current (lot lower value than R1).
 
Last edited:

mikie_121

Member
Westaust55: The door switch actually supplies 12V so the way you have it would put 12V straight onto the Picaxe input.

Jeremy: I considered the cap solution but I don't have a lot of room: Max size can be 20mm X 40mm X 10mm high. I looked at 'supercaps' available from Jaycar but they are only 5V.

rstu450: wtf?
 

Jeremy Leach

Senior Member
Ok, not sure if anyone else can help out on caps. But I guess the first consideration is the LEDs you are going to use and the drive current through these. I doubt the picaxe output will be able to drive them directly so you will probably need a transistor. I'm guessing you are wanting to use a PWM signal out from the picaxe to fade the LEDs?

Also I expect people will have things to say about the 12V and the power regulation you are going to need to the picaxe as it's in a car. Although this is a picaxe forum I really think a picaxe isn't the way to go here, if all you want to do is fade. I think a transistor added to my circuit might do it...
Code:
                ---------------o----o------o------- +12V
                               |    |      |
                               |    |      |
                               |   .-.     |
                               |   | |R1   |
                               |   | |     |
                               |   '-'     |
                              ---   |    |<
                           C1 ---   o----|       (PNP)
                               |    |    |\
                               |    |      |
                               |   .-.     |
                               |   | |R2   |       T1 (PNP)
                               |   | |     |
                    ___        |   '-'     V LED
     Door Signal  -|___|--|<---o----'
                                           |
                    R4    D1               |
                                           V LED
                                           -
                                           |
                                           |
                                           V LED
                                           -
                                           |
                                          .-.
                                          | |
                                          | | R3
                                          '-'
                                           |
                                           |
                ---------------------------o------- GND
By using a transistor the value of the cap can be relatively small. R1 and R2 simply bias the transistor and also determine the fade period. R3 limits the current through the LEDs. R4 is small value just limiting charge current into cap.
 
Last edited:

westaust55

Moderator
Westaust55: The door switch actually supplies 12V so the way you have it would put 12V straight onto the Picaxe input.

Jeremy: I considered the cap solution but I don't have a lot of room: Max size can be 20mm X 40mm X 10mm high. I looked at 'supercaps' available from Jaycar but they are only 5V.

rstu450: wtf?
Mikie,
are you sure you have got that right?
Can I respectfully ask you to go and check again.

That would have 12 volt on both sides of the lamp and it would not work on "door" mode, only for "on" mode which would be peculiar.

Most cars have the door switch closing a contact to the switch body which is mounted on the car body and thus earth. Most modern cars also have "negative earth" so the switch pulls the wire down to ground.
 

Andrew Cowan

Senior Member
Could you fit three supercaps in series? That would give you the 12V you need.

I agree that picaxe doesn't seem the best option.

Have you calculated how hot the 7805 will get?

Andrew
 

BeanieBots

Moderator
Be careful with super caps.
The 5v versions often have VERY high internal resistance in the order of several kohm. They are designed for backup for RTCs etc and cannot supply more than a few 100uAs.
The other versions, like a 'true' cap but very high value are rarely above 2.3~2.7v. There is also a significant cost difference.
You can series them but you MUST have a mechanism for voltage sharing. This could be a simple resistor across each one but the value would need to be quite low to cater for worst case difference in capacitance. I find a low value resistor (220R) in series with an LED of suitable forward voltage works well for voltge sharing. Probably a good idea to fit a reverse schottky as well to prevent reverse polarity during discharge.
 

hippy

Technical Support
Staff member
As westaust55 says, when switched to "door" position there will be a plunger switch between that and the car's body (0V). In both "on" and "door" mode the bulb is lit when there is a circuit made to 0V; it's a standard battery and bulb setup with the power switch in the battery negative (0V) line.

Most cars with dimming bulbs have an additional connection to 0V similar to what Jeremy showed in post #5. Without that 0V connection the 'bulb' will have to have its self-contained power supply to keep the LED's going when the 0V connection is cut, eg some sort of capacitor.

It's probably easier to add an extra 0V connection and use the existing door signal as a 'short to 0V' signal when active but note that some cars use current sensing to trigger alarm activation so where +V and 0V comes from and goes to can affect things. It is also adding a permanently on system to the car which will always be drawing power from the battery when not active.

If you do pursue this project prototype the circuit using a current limited PSU or low current batteries before considering adding it to a vehicle and make sure appropriate fuses are fitted. Undertake a risk assessment and failure mode analysis before fitting, and check your insurance documents on vehicle modifications.
 

jppizhere

New Member
Like Hippy was saying something like this would require to be powered continuously (my car hs serveral things that require power all the time ie..radio,clock,alarm,etc and the draw of the cicuit should not be enough to have a huge effect on operation of the vehicle), however should not be overly complex to build or code if you are willing to live with that. Westaust had it right, but maybe the same drawing with the bulb removed would have cleared up any confusion. So, I will try to explain is some. Take ot the bulb and take the 12v in at bulb connector and regulate it down to 5v to operate the picaxe, and use a connection to the "ON" side of the switch to provide the ground for the picaxe. Make a connection from the regulated five volt to one input pin on the picaxe to hold that pin high, and from same pin connect a resistor that also connects to the switch side of the bulb connector.

Confused yet, I might be but let me try to explain my thinking. The 12v side of the bulb always has power, keeps the voltage regulator running to power the picaxe, any old ground should do for the regulator/picaxe ground that is why I sai connect it to the "ON" side of the switch as it is a ground. There is normally no ground on the switch side of the bulb so the bulb will not light, when the switch is moved to "ON" or door is opened a ground is provided and bulb lights, so if we use regulated 5v to a input pin it will be held high all the time and the Picaxe can detect this and it will be the "off" state for the LED that you are using for light, however if we also connect this pin to the swtch side of the bulb connector when a ground is provided on the wire through door opening or switch being moved to on the 5v will go to ground and that Picaxe pin will now be low, the Picaxe can then determine this as the "on" state and light the LED (put a resitor in there because I am guessing that the 5v regulator would not appreciate being connected directly to a ground.), then it simply waits for the pin to go high again and when it does dim the LED to off using pwmout.
 
Last edited:

hippy

Technical Support
Staff member
One thing to also consider is actual functionality of the dimmer, particularly how quickly it starts to dim. Two particular circumstances when the light has come on and you will be wanting it to be going off ...

1) When you get into the car, close the door and start the ignition to move off

2) When you get out the car and lock it

The first is most annoying if the dimming doesn't happen quickly enough ( and it may be illegal to drive until it has ) but if it dims too quickly it doesn't serve its purpose. A second feed from ignition can add an 'immediate off' or 'dim now' function.

The second isn't so bad but can leave you standing there wondering whether the light will go off or not or if the electronics has broken. Been there done that. Another feed from the central locking can make that another 'immediate off' event. This may be a necessity if the alarm is current sensing and having locked and armed the car the dimming bulb sets off the alarm.

Another thing is when does the light come on - When you open the door or when you use the central locking remote ? Having the light come on before opening the door not only reveals the mad axeman hiding in the back but may also causes less reaction in animals left in the vehicle. Having a light which fades-up on unlocking, perhaps instant on when the door opens is another useful mode of operation.

As with most projects it's not simply about how to do it but about what to do, the ergonomics and aesthetics of the solution.

Once you've had a vehicle with a very well thought out interior lighting system using one which is inferior can be very annoying. I ripped out the electronics and rewired for the simple 'door open, light on, door closed, light off' mode in one car I had.
 

premelec

Senior Member
I like Jeremy's basic solution suggestion... no need for big caps as you can use a MOSFET and a small cap on the gate - charge up the gate cap to turn on and then it slowly discharges... OK you'd need a +12 bus then too - as to turning it off fast and such many lights [used to?] have a manual off switch if you actually need to kill the light function....

I have used 1Fd 5 volt caps [fairly cheap memory backup type] to keep an LED on for a short time... depends on how much light you need how long etc...

Q=CV=IT relates charge, capacitance, voltage, current and time to estimate how much capacitance will give you how much current - some LEDs are very bright at .005a these days.... 2 volt change at .005a 10 seconds implies [C=IT/V] = .025 farad. It's not that
simple as the current is not constant [unless you put in a current regulator...] but this gives some idea....
 

mikie_121

Member
Westaust55: I'm sure about the door switching 12V. I couldn't believe it so I have double checked. I actually designed the circuit a few months back and I assumed that the door simply supplied 12 to the light when it was open. So I made a circuit that pulled the picaxe input low and looks for a high (through a voltage divider of course). It works very well, except that I can't turn the light on from the light itself. I have to open the door.
I just thought there might be a simple method of pulling the input high and looking for a low, without blowing anything by supplying 12V to the chip.

Jeremy: I like your solution. I'll investigate further.

Goom: My car wiring isn't the same, though. My door signal goes low when the door is open. Still, I think I can make something out of that circuit.

hippy: Thanks for the legal considerations, I hadn't thought of any of them. I've had the circuit in the car for the last week and it only got slightly warm. I had to concentrate to feel the heat. At the moment the lights fade out over about 2 seconds so I hardly have time to put it in reverse before it has faded out. My aftermarket alarm system does turn on the interior light when I unlock, so that suits me just fine. The total current drawn from the circuit is less than 100mA when it's on (two banks of white LEDs at 35mA each, plus the 7805) and about 20mA when it's off.

I think I'm going to leave the PICAXE out for further design because I really like Jeremy's solution. It will leave me with a simpler circuit too.

Here is my existing (wrong) circuit diagram for those who are interested:

It works well, I just can't turn it on using the switch on the light.

thanks for all your help
 
Last edited:

jppizhere

New Member
Looking at your diagram I am assuming that you have connected the voltage divider straight to the wire going to the door switch. Have you tried connecting it to the wire going from where the bulb would be to the switch assembly for the light, as it should work the same just with the on switch as well as the door switch activated.

If you measure from either side of the bulb while the light is not on I am going to guess that you would measure battery voltage with other lead to ground. The door switch as well as the light on switch should be providing a ground making the cicuit work (which of course wil give you 0 volts to ground on door switch when light is on), there is always 12v at light I suspect, it just has nowhere to go unless one of the two switches is activated then there is a ground. A quick way to figure it all out would be to take the bulb out and measure, which side has voltage when the door is open or switch is on? If it is not the side that goes to the switches then both switches have to provide a ground or the circuit would not be functional.
 

mikie_121

Member
I did all the voltage measurements with the whole interior light unit out of the car. I tested the plug hanging out of the roof. I'm certain it was giving me 12V with the door closed and 0V with the door open.

My circuit does work with the door opening and closing, but it doesn't work when you switch the light to 'ON' because the 'door' input to my circuit is then grounded. But it is already grounded through the voltage divider so it makes no difference.

For those who might be interested: My car is a 1989 Toyota Celica. Maybe if someone has a wiring diagram you could confirm the (strange) interior light wiring.

For now I'm working on the transistor/capacitor method suggested earlier.
 

westaust55

Moderator
here is a 2002 Celica wiring diagram. So easy to find took me all of 2 minutes.
http://www.celicatech.com/ewdsourc/2002/02celica/electric/overalle.pdf

and for a 200 model at http://pdftown.com/pdf-ebook/Overall Electrical Wiring Diagram.pdf

Sure you can find your exact model if you search. Attached a preview . . .


Note that the door switches are pulling the lamp to ground as I originally suggested

Nothing strange about it - its bog standard !

I have a 1988 Toyota and a 2000 Toyota as well and wrt door switches they are both wired exactly the same as the links shows here. Don't think Mr Toyota will vary the wiring too much.
 

Attachments

Last edited:

hippy

Technical Support
Staff member
Nothing strange about it - its bog standard !

For the switching and wiring, yes, but I'm not so sure about the mysterious "Body ECU" which the wiring runs through.

In a pre-gizmo vehicle I'd expect Body ECU to be nothing more than a wiring loom / inter-connect with PCTY and DCTY joined to be a pull to 0V for LP. The Body ECU here could be performing some internal, intermediate tricks. If the Body ECU dims the lights it is possible that is done by changing LP volts from 0V to +12V, for the earlier models it may be same but a jump rather than a fade. Assuming earlier models also have this ECU, it could simply be a matter of whether they fit a capacitor in the ECU or not to determine its operation.

Seeing the two separate door courtesy switches also reminded me of another ergonomic issue; how the light behaves depending on whether it is the passenger or driver's door opened. Best behaviour depends on whether the ignition is already on; the driver probably doesn't want to unnecessarily wait for the light to dim until moving off when a passenger gets in or out.

Again we're back to an apparently simple project being potentially a lot more complicated than the 'back of a napkin' proposal suggests. It could be said to be unnecessary 'feature creep' but success ( for commercial manufacturers ) comes in delivering the perfect solution for its customers.

I've spent ages on minuscule and petty design issues in the past and the customer rarely notice but they sure do when it's not as good as it could be or doesn't work as expected. One little niggle can grow into huge resentment over time and outright criticism of an entire product or range for one minor, seemingly irrelevant, flaw. There's a large gap between "does the job" and "done right" and that's also a reason why commercial products cost so much more than a minimal or thrown-together DIY solution.
 

westaust55

Moderator
Nothing strange about it - its bog standard !

For the switching and wiring, yes, but I'm not so sure about the mysterious "Body ECU" which the wiring runs through.

In a pre-gizmo vehicle I'd expect Body ECU to be nothing more than a wiring loom / inter-connect with PCTY and DCTY joined to be a pull to 0V for LP. The Body ECU here could be performing some internal, intermediate tricks. If the Body ECU dims the lights it is possible that is done by changing LP volts from 0V to +12V, for the earlier models it may be same but a jump rather than a fade. Assuming earlier models also have this ECU, it could simply be a matter of whether they fit a capacitor in the ECU or not to determine its operation.

Seeing the two separate door courtesy switches also reminded me of another ergonomic issue; how the light behaves depending on whether it is the passenger or driver's door opened. Best behaviour depends on whether the ignition is already on; the driver probably doesn't want to unnecessarily wait for the light to dim until moving off when a passenger gets in or out.

Again we're back to an apparently simple project being potentially a lot more complicated than the 'back of a napkin' proposal suggests. It could be said to be unnecessary 'feature creep' but success ( for commercial manufacturers ) comes in delivering the perfect solution for its customers.

Cars have had "gizmo" circuitry for at least 30 years - hence my thought that it is "bog standard". My 1980 Mazda 626 has a few of what were known as "relays" that in reality were assembled like a relay but has a stack of electronics inside.

Toyota from this 1980's also had such devices which they usually called "integration" relays see attached from a Toyota Supra of about 1989 vintage. This manual does not show what is in the circuit but my Camry manual does for some of these "relays"

The commercial interior light dimming units are typically designed to be wired across the door switches so that they just make it look like the door has remained open longer. That way it does not matter what is between the switch and the lamp.
From the Toyota Camry manual wrt the interior lamp "relay" it states:
INTEGRATION RELAY
4&#8211;GROUND : APPROX. 12 VOLTS WITH DOOR CLOSED
0 VOLTS WITH EACH DOOR OPEN
This is what mikie121 also states - its equal to the voltage as seen at the door switch.
 

Attachments

Last edited:

mikie_121

Member
This circuit should work if I was still going to go with the Picaxe idea, which I'm not. I just wanted to find a solution to get an input from this light circuit.

Code:
12V (bat) --------------\/\/\/\/--------\/\/\/\/-----------Door
                         4.7kOhms  |      4.7kOhms
                                   |
                                   <  1kOhm
                                   >
                                   |
                                   |---------to picaxe input
                                   |
                                   <  680Ohm
                                   >
                                   |
                                 -----
                                  ---
                                   -
So the voltage between the two top resistors with vary between 6 and 12V with the door open and closed respectively. This voltage will then be stepped down through divider circuit to produce somewhere about 2 and 5V respectively. (I'm just estimating these voltages so put that calculator away!)

I didn't want this circuit to beat me and I think this nails it. I won't use it but it should work.

Thanks for all your help, guys.

Mike
 
Top