Active Headlights

If you are unfamiliar with active headlights here is a description of what they are.

Active headlights come in 2 different versions one version uses an LED array coupled with local dimming type control to aim or point the lights in the direction of travel. The second type use servos to physically move an HID projector that is inside the headlamp housing. The first use of curve active headlamps was in a vehicle made by Tucker. They used a mechanical connection to the steering linkage to move a 3rd headlamp housing located in the center of the vehicle.

With the wonderful world of technology we live in there are systems in a vehicle that can be communicated with to collect bits of information that allow this to be done electronically instead of needing a mechanical connection to the steering linkage.

My project is retrofitting a curve active system and also a horizon active system to the factory reflector single bulb headlamps on my 2008 Pontiac Solstice.

I have been working on this project for about a year now and had to learn many new things. I am extremely ambitions and I decided that I wanted to add 2 projectors to each headlamp housing. There was no way I could fit 2 projectors, 2 bulbs, 4 servos and also the electronics inside of the stock housings. I had to come up with a way to make the housing larger and I wanted to keep it made of all of the same materials as the stock housing. I took the stock housings apart and removed the reflector assemblies. I then cut the back of the housing out leaving only a little bit of the original housing. The little bit was the part that seated to the lens. I then friction welded on flat pieces of the same plastic to come up with a basic shape. One I had that basic shape I created a mold by filling the inside with Bondo. I refined the mold and came up with the final shape.

Next step was building a vacuum forming machine so I could use a single piece of plastic to make the back portion of the housing. That piece I then friction welded to the little bit of original housing that was left.

After working out all of the mechanical bits and making the components needed to move the projectors I moved onto the electronics. I decided that I wanted to spice up the turn signals and the side marker lights at the same time and I added in a grip of addressable RGBW LEDS . For a prototype I used these off the shelf modules.

4 channel relay module
4 metal gear servos that I modified so I could read the position from them.
PCA9685 16 channel pwm controller
MCP2515 CAN interface
MPU9250 9 DOF MEMS sensor
2 5V 5A regulators

The MEMS sensor is used to calculate the pitch and roll of the vehicle. That is what I am using to lock a set horizon. So if I drive over a speed bump when the front tires go over the projectors will pitch down and when the rear tires go over the projectors will pitch up.

I am using the CAN interface to collect the steering angle from the ESC (Electronic Stability Control) system in the vehicle. I am also collecting the vehicle speed and transmission gear.

I wired everything up and got it all running but man o man is it UGLY! I have decided to design a right proper board with everything on it. I have done several revisions of the board starting off with being able to just plug all of the existing modules into the board. That design would be a really tight fit. so after some thought and a lot of reading I decided that I want to only have a single board in each headlamp and all of the components are mounted to that one board.

I need some help with this aspect of it as I am not an electrical engineer and trying to understand what I need to do for different aspects of it by reading the things I can find on the internet is simply not working.

I want to ditch the use of mechanical relays and use MOSFETs instead. I need to be able to use a +5v signal to turn the MOSFET on which will couple a +12V to +15V source to a device. The maximum amperage is as follows.
HID ballast 1 - 15a
HID ballast 2 - 15a
high beam shutter solenoids - 10a
5v regulator - 10a
5v fan - 0.07a

I am not 100% sure on how to design the “MOSFET relays” I have a basic idea but i am not sure how to go about calculating resistors. I know I am going to need an NPN BJT and a P channel MOSFET for 4 of the relays and the one for the fan because the current draw is so low I should be able to use just an NPN. The issue with the fan is the load is not a constant so I am not sure how to select the resistor(s) needed.

The other thing I need some help with is designing 3 voltage regulators. They all need to be able to take an input voltage from 10v to 15v. One needs to output 1a @ 3.3v the second needs to be 1a @ 5v and the 3rd needs to be 10a @ 5v. All of the schematics I am able to dig up have a pot to set the output voltage, this is not going to work and I need something that is hard set.

I am going to continue to use a module style MPU9250 because of the lack of availability for the IC.

This is the list of IC’s that I will be using.
ESP32 WROVER - processor
PCA9685PW,118 - servo pwm controller
PCF8574T/3,518 - i2c IO expansion (provides the +5v for the relay triggers)
MCP2562-H/P - CAN transceiver, the ESP32 has a built in CAN interface that I will be using, This is not SMD because none are available from supplier and I am using the 2562 because it is powered by 5v but has a v-ref pin to set the logic level for the pins that connect to the processor, the processor pins are 3.6 volt tolerant.

I will also be using the following resistor arrays
4310R-102-331LF - 330ohm, 5 resistor, isolated (voltage divider)
4310R-102-101LF - 100ohm, 5 resistor, isolated (voltage divider)
4608X-102-221LF - 220ohm, 4 resistor, isolated (servo PWM lines)
4604X-102-103LF - 10kohm, 2 resistor, isolated (I2C pullups)

The voltage divider is for sensing ignition, high beam, low beam, turn signal and parking light from the vehicle. I need to bring 15v down to under 3.6 volts.

I found a schematic for making the MOSFET relays for 4 of the relays using a FQP47P06 MOSFET and a 2N3904 NPN BJT the issue is the 2N3904 is no longer made and I do not know how to make adjustments to be able to use a different NPN.

For the fan relay I was thinking of using a BC33716BU NPN but my issue here is calculating the resistor value because the load is not going to be a constant, it is a PWM controlled fan and I would like to be able t adjust the fan speed. I am going to be using a 40mm x 40mm x 10mm Noctua 5V PWM fan.

I am OK with SMD parts as I am planning on having the assembly done as I do not have the proper setup to mount SMD parts cleanly.

You should rather ask at some electronic forum like for example:

I do not understand projects like this.
It has been tried, probably multiple times, but it’s never become common.

Part of that is probably because it is not very useful. You only want to look further ahead when you’re at a decent speed, and at those speeds you can’t make sharp turns anyway.

There are also problems with legislation and reliability.
Messin’ with car headlights is no casual business. Imagine cruizin on the highway and then your headlights suddenly turn sideways because of some software glitch. Therefore headlights are safety critical devices, and that is where legislation steps in. I’m fairly certain that you’re not even allowed to modify your car in the EU to install such a system.

I could be wrong of course.
You’ve already put a lot of effort in this project and very likely do know much more about it then I do.

I’m also a bit puzzled by your questions about the 2N3904 It’s a simple general purpose transistor, which implies that you do not know much about electronics yet. And that is of course perfectly all right. We all had to learn in some way. But beginners in electronics tinkering with safety critical car parts is not a good combination.

I always respect the people who are building (or even better: designing) their own lab power supply. It may seem a boring project, but it’s just as good as any other electronics project as a learning experience, and when you’ve build it, you have something that you can use in your further education in electronics.

But there are so many other electronics projects. The whole web is full of them.

But also, like Piotr already mentioned.
This forum is for the KiCad software itself, how it works, bugs, tips & tricks, etc. It is of course visited by people who are into electronics, but a site like EEVblog is a better place for questions about electronics projects .

1 Like

Your project crosses many fields of expertise. So I hope you will post in other forums like eevblog and also where they may be people who understand parts of your proposal and you can piece together the knowledge. This forum concentrates on PCB design. Naturally many people here are also familiar with power electronics and even mechanisms. But you should spread your search wider.

Also some of your modules like the power relays are available off the shelf which can save you effort. Some of the currents you mention are large and it’s not a good place for a beginner to start.

Thank you all for the input. The link to the other forum is helpful and appreciated. I am not “new” to working with electronics and large current and I have done some repair but not building something from scratch. I know there are already off the shelf modules that are already made but space constraints are causing an issue doing that. This is the reason why I need to put everything onto a single board.

The large current is not consumed by the circuits I need to make, it is consumed by external devices like the HID ballasts. I simply need to turn power on and off to those devices.

This is something that is available in a lot of vehicles. I have active headlights in my other 2 vehicles. It is extremely common and not rare at all. The thought that it is not useful is because either you have never owned a vehicle that had this technology or you have never lived in an area that was dark enough to really experience the benefits of having it, both of which I have. Having the headlights move 30 degrees in either direction really improves visibility at night.

Here is a list of car manufacturers that have adaptive headlights, This list does not include all of the manufacturers.
Audi, BMW, Buick, Cadillac, Hyundai, Lincoln, Infiniti, Kia, Lexus, Mazda, Mercedes-Benz, Land Rover, Nissan, Genesis, Porsche, Volkswagen, Volvo, Ford, Lexus, Subaru, Mini Cooper, Chevrolet and Toyota

Kind of hard to believe that all of those car manufacturers would be offering this technology and it is not “common” It is extremely common on vehicles produced after 2016. The funny thing is that there are a large number of people that do not even know their vehicle has this feature and have it either switched off or they simply don’t pay attention and haven’t noticed the beams of their headlights moving as they turn the steering wheel which can be due to there being too much ambient light.

If development of new ideas simply didn’t exist because of the thought of something being unsafe then we wouldn’t have seat belts, airbags, anti-lock brakes and electronic stability control. All of which come standard in vehicles. in 2004 ABS by law has to be sold in every new vehicle. ESC became law in 2012, airbags were in 1998 and seat belts were in 1968. You also have whiplash restraints that became law in 1969. All of these now standard safety features were deemed to be unsafe when they first appeared. Don’t get me wrong, when they first came out there were issues with them that needed to be corrected. I remember airbags causing people to bite holes through their tongues and knocking the front teeth out. This was fixed by adding holes to the airbags so the bags could deflate when the occupant hit them.

Look at Passenger Presence Sensor Systems and the number of issues those things had when they first came about (late 2000’s). That too is required by law to be standard on all vehicles.

What brought about me making this was me having a full grown Bull Elk run into the side of my car at full speed. This happened because I did not see the Elk on the side of the road where there was a bend/curve to the road. Think about having something moving at 40mph that weighs 1000lbs and 90% of that weight is 3 feet off the ground slamming into the side of your car. It put my car up on 2 wheels, the car is also a convertible. I am extremely lucky to not have had the animal end up in my lap. Had the headlights been pointed into the curve in the road I would have seen the Elk and the accident would have never occurred.

I am posed with 2 choices, be one of “those” people that has headlights and lights bars that are so bright they blind oncoming cars. Or, make it so that I can have headlamps that will light up the direction I am headed better and not blind other drivers. While it is the more complicated thing to do I opted to do the latter which is the safer thing to do.

I did manage to hammer out the power supplies so that is covered. I came across the XL4015 data sheet and in that data sheet they provided a schematic for how to use it and they also included how to calculate the resistance values needed to set the output voltage. It also provided all of the capacitor values and resistor values needed to make the circuit. The only thing I am dealing with now is the MOSFET relays and I may order the components for those that I believe should work and do some bench testing to see if it does. I believe that I have a circuit for the MOSFET relays that should work and bench testing will answer that question.

The only thing that gives me a large question mark is the value of the resistor used on the on the trigger for the NPN that switches the fan on and off. That resistor value is calculated using the current of the attached device/circuit. With a PWM fan that current is not a constant due to the fan’ speed being adjusted. I would imagine that in order to saturate the NPN I would have to use the current the fan would consume at it’s lowest speed but this information is not provided in the fan data sheet and the current draw is non linear due to the efficiency increasing with lower speeds. I might have to figure it out by trial and error…

Hackaday has people working on projects like robot mechanisms and modifying 3-D printers who will understand your driver requirements. They can review your design, if you publish it. Don’t be fixated on a previous design using BJTs to switch the fan current. There are many ways to do this, including FETs.

1 Like

I apologize for my ignorance.

I do have a car, but I don’t know how old it is, probably 15+ years and I do not keep up much with modern car technology.

I also tend to drive around over well lighted roads (There hardly are any others in the Netherlands) and quite far from area’s where crossing elks can be expected to cross the roads.

I will comment on the 2N3904. It is a 200 mA general purpose transistor in TO-92 through hole package. It is not obsolete but there are 2 considerations:

  1. Supply shortages cutting across the entire semiconductor industry.
  2. These days I would expect that an SMT version (electrical specifications identical or almost identical) such as MMBT3904 would be much more commonly used. I cannot imagine that a through hole TO-92 2N3904 would be designed into any car which was introduced in the last 10 years. Even the SMT versions do not seem so likely. More likely is that the transistor would be incorporated into an IC which is specific for the purpose. If a car uses a circuit board with a lot of discrete transistors, the board will quickly become too large and unreliable.

Digikey shows some stock of 2N3904 in TO-92 although less choice than I remember from a few years ago. They have much better stock and selection of MMBT3904. BTW this sort of SMT transistor is actually available in several different packages such as SOT23, SOT323 and others…I am not getting into that.

It is amazing how many types of transistors there are when each one uses only a few :slight_smile:
I use practically only BC847C and BC857C. If someone needs THT: BC547C/BC557C
BC847C has hfe=420…800.
I looked 2N3904 - hfe=80…300 (in comparable conditions). It is much worse - you need 420/80= 5 times higher base current to get the same at collector (I used 80 as I always assume the worst condition).
I see MMBT3904 has a group G with hfe 300…400 - better but still less then BC847C.
If I need higher collector current (2N3904 has 200mA and BC847 only 100mA) I will use BC817-40 (500mA, hfe=250-600).
What for are the other transistors types I really don’t know :slight_smile:

(a) It’s a upsell for higher priced models for most manufacturers, you can’t get it without spending extra $$$$. I’m definitely not paying an extra $5k just for this feature.
(b) It is still a debate about how well adaptive headlights improve safety, in fact, Mazda’s adaptive headlights fail the IIHS tests for headlight projection visibility compared to their normal ones.
(c ) The adaptive headlight systems have an array of patents on them. This not only forces the manufacturer to sell them at higher cost

Most modern cars have fixed this with far superior static headlamps with LEDs that allow more shaping light downwards and further. In fact, some lamp based headlamps are also just as good now with new design techniques in the headlamp that aggressively shape the light pattern emitted.


There may be a question of time and evolution.

  1. Some of the types have lower Vceo than 2N3904.
  2. 2N3904 I think has been around for 50 years or more and I think started in USA. They became popular and standard. I am not sure when or where the BC series started but I am guessing they may have been with Philips (to NXP to Nexperia) in Europe. (??) For the vast majority of my applications the Hfe available from MMBT3904 is ample. Just now I am looking at a home project which might take advantage of higher gain from a BC type. I have not learned those type numbers and I do not even have any in my lab! I do have some MMBT5089 (Hfe of 450; 50 mA max) and would probably use those. But those are less available now than the similar BC types.

A significant portion of collision detection for myself is to take note of what visually changes. An “active” headlight system that kept changing illumination based upon where it thought I was looking would be something that would be irritating to me.

A well balanced illumination field would also keep an individuals eyeballs from being overly saturated in one particular location.

I have got first silicon transistor (BF520) into my hands when I was in secondary school. It have to be 1975 or 76. I remember that as it was very expensive - it costed 60 PLZ while my father (engineer) earned those time about 2000 PLZ per month. Certainly BC have to be at that time also. But we (Poland) as a socialistic country were strongly behind.
Germanium elements got names starting from A and silicon starting from B. Second letter C meant low frequency low power transistor, and F - high frequency low power transistor.

Very good and correct guess. They were used extensively in Philips post valve (tube) B & W TVs and early CTVs in my country… circa 1970 - 1980. As I recall, that series was far more popular and available for the hobby scene than most low power 2N stuff.

XL4015 data sheet

Very ambitious project! Hat off to you sir.
I can’t help but comment on this though. You will be using the cars voltage supply, so it’s not just “10 to 15V”. There are dozens if not hundreds of application notes discussing automotive electronics design, and dealing with voltage drops during cranking as well as voltage transients upwards of 100V are commonly mentioned. Manufacturers specifically provide automotive-grade IC’s to comply with safety and reliability regulations. The manufacturers you mention no doubt spent millions of dollars ensuring fail-safe operation of their adaptive headlights, as well as performing controlled environment tests. I’m not even going to get into the questionable status of your insurance with this type of modification. I can absolutely see them washing their hands of any liability with this level of car modification.

Your story is touching and I’m happy you are alive. There’s already a solution that doesn’t involve butchering your existing cars critical features, it’s called an LED light bar that’s on every Jeep and truck I see drive on pitch-dark county roads at night. The fact that you drive a coup at night and want it to look as stock as possible isn’t an excuse to endanger other drivers on the road, where if you were to get into an accident and cause injuries, your insurance could just deny their claim forcing them undue hardship.

On the subject of electric gizmos in cars now-days, I often get the feeling that most of these devices are invented and used under the guise of safety but their real intention is to keep marketing departments happy.
So many items are to “warn” the driver so said driver feels “safe” with the consequences that the driver pays less attention to driving and more to other pastimes, which can often result in unfavorable outcomes.

“BC547” is a European code, following the “Pro Electron” naming:

And according to Wikipedia, it is an extension of a previous standard naming convention for glass tubes:

1N4148 and 2n3904 are named according to the (USA) JEDEC standard.

Transistors starting with “2SC” are according to a Japanese standard:

And all this transistor stuff started in in the cold war and the Russians had their own standards, but Piotr probably knows more about that than I do.

I just heard about a “PN100” which is apparently a fairly common transistor in some parts of the world, but I don’t recognize the naming system.

Boy I feel ancient, I actually remember the schemes for naming US and European tubes. I had a RCA tube data manual and a Philips vade mecum for bedtime reading as a kid. No home computers, let alone Internet. I was so chuffed when I built my first 1-bit storage bistable with 2 transistors (and steering diodes). I actually used that design later to square a waveform.

Nah, it’s both. There really is a drive for more safety. Whether or not the idea is actually the golden killer solution…is marketing’s job to sell.

On that note, I love the automatic high beams on my new Honda Civic. Far exceeds the benefit any motorized headlights can provide.