Author Topic: Upgrading the ambient lighting in my car  (Read 1610 times)

0 Members and 1 Guest are viewing this topic.

Offline james2k2Topic starter

  • Contributor
  • Posts: 44
Upgrading the ambient lighting in my car
« on: November 08, 2020, 04:27:06 pm »
Hi All,

This is probably a common project idea, but needless to say I'm trying to do it my way.

The vehicle already has ambient lighting led's in the footwells and the center console but warm white only. My initial testing shows it is dimmed via PWM in steps that I've not been able to acertain, but they're visible steps. My DMM isn't great, but has TrueRMS and has a frequency measurement mode, which shows the PWM being at a low 200Hz - the spec sheet says it can measure up to 10Khz so I'd say more or less this should be close enough for information needed. I'm starting with the footwells and the content below surrounds this part.

- Utilise existing lamp housings
- Do not use any additional wiring where possible
- Add RGB control
- Retain brightness control
- Utilise existing controls in the car by capturing the CAN bus data

What I've done so far:
I've sourced parts so far that should more or less be complete but I'm struggling on a few areas which I will detail below. I've laid out a PCB to make sure everything will fit and needless to say, it's tight! The original PCB measures at just 26mm x 12mm. Looking at the plastic housing in a bit more detail has allowed me to design my own PCB with some 1.5mm 'wings' in places. See attached for the incomplete layout thus far. Height is where I have a little more space, so the wireless transceiver actually sits atop the micro. The micro I have specified as an Atmel ATMEGA328P. It originally was going to be an ATTINY85.

Parts Specified:
- LED: WS2812B 2020
- 5V Regulator: ST LDL1117S50R
- 3.3V Regulator: ST LDL1117S33R
- Transceiver: XY-WB 2.4G (This is a chinese knock-off type thing of the nRF24 series)
- Smoothing Caps: 2x 33uF 16V Tants

Assumptions / Design choices:
- The 328P will use an Arduino loader, with fuses set to internal osc @ 8Mhz, 5V.
- I've used an Arduino compatible MCU as it's something I know very well.
- The XY-WB was the smallest solution I could find for wireless comms in a broadcast fashion.
- I figured I could try and measure the PWM input and apply the dimming level to the output.

- Is the WS2812B a good option, or should I be looking to drive a normal RGB LED from the pins of the MCU?
- Will the two caps I have be enough to provide enough charge to the circuit? My estimates suggest the circuit should only draw around 10 to 15mA from the regulators, and MCU. The LED is around 60mA total at full white, however this would be limited so probably around 30mA in total for the whole circuit.

On the last question (and this has been my main sticking point), I'm trying to calculate if from the PWM signal I can gain enough charge to run the circuit no matter what the dimming level is. Without an oscilloscope I am going to struggle - I understand this. I did some testing with a single 33uF cap and managed to successfully measure a DC voltage of around 7V at 'full' brightness (I'll explain more shortly), and around 3V at the lowest level before off. I only had a single cap to hand at the time and 33uF seems to be the largest I can get in a TAJ-B casing. The vehicle only outputs actual full brightness when the doors are opened or the courtesy lighting comes on after engine stop.

From this I have the following questions:
- Will a linear voltage regulator be happy with a partially smoothed DC, or will it freak out?
- Are my measurements actually correct? I saw the LED on the existing PCB basically stay at full brightness throughout the whole dimming curve with the exception when it plummeted from (my measured) 7V to 3V.
- Am I going about this the right way, is there a better way to smooth a PWM signal and attempt to achieve or store close to the peak voltage (rather than average) based on my maximum current requirements?

I've not even got to the TX side yet, however I don't perceive any issues with that element as it will be a custom module I attach and hide somewhere.

Thanks for reading, and any advice would be much appreciated!

Offline Clear as mud

  • Regular Contributor
  • *
  • Posts: 208
  • Country: us
    • Pax Electronics
Re: Upgrading the ambient lighting in my car
« Reply #1 on: November 09, 2020, 06:11:31 pm »
Your post is unclear, does the existing supply to the light consist of DC that changes voltage smoothly as the lights dim and go out, or is it PWM?

WS2812B chips are meant to operate at a supply voltage of 5 to 6 volts.  3 volts is most likely below the datasheet minimum.  If you're planning on selling this system to anyone in the future, you will not want to operate outside the datasheet voltage range.  Otherwise if it's just for your car, you might test and see what happens.  Beyond that, the consideration of whether to use a standard RGB LED or a WS2812 comes down to which is easier to lay out on your PCB, since you don't have a lot of space available.

Offline Buriedcode

  • Super Contributor
  • ***
  • Posts: 1646
  • Country: gb
Re: Upgrading the ambient lighting in my car
« Reply #2 on: November 09, 2020, 06:36:32 pm »
If you want one group of LED's to be the same colour, I'd go with "dumb" RGB strips, and a driver.  The addressable ones are great but they aren't particularly efficient (you can't drive dies in series, they drop the 1.3-1.8V for each die internally) and used for when you want individual colour variation.

Also beware, the cars 12V supply is pretty evil in terms of transients.  A LDL1117S50R will most likely not survive very long without significant protection.  Also, If you were to use addressable LED's, the max current for each one is 60mA.  A strip of 10 is 600 mA.  A linear reg powered form the battery (lets say the cars battery is a nice pretty, clean 12V) will dissipate (12-5)*0.6 = 4.2W.  That's over twice what the package can cope with.

I think you're on the right track trying to utilize as much of the original parts as you can - car manufacturers know their stuff, and wouldn't install crappy power supplies.  Hopefully you can re-use the power supply, but it depends on how the LED's are wired and driven (parallel? series? low side PWM switched? etc..)./

Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo