king_george
Posts: 5
Joined: Thu Feb 05, 2015 2:49 pm

Small car mods

Thu Feb 05, 2015 3:04 pm

Hello to everyone!

I am new to the Raspberry Pi, in fact, I haven't bought one yet, first I wish to get the information I need before I can decide if the project I wish to create can be done with a RPI.

As the title says, I want to do some small car mods. Here's what I want to do:
-LED Daylights that turn on when I unlock the car
-LED Daylights that turn off when I lock the car

Afterwards, I need to specify that my side mirrors have a motor that works both ways to close or open the side mirrors
-I wish to make the side mirrors work kind of like the LEDs, when I lock/unlock the car, the mirrors close/open.

And finally, I wish to install bi-Xenon projectors on my car. However, by law, in France, when you have xenon headlights, you MUST have light washers (no problem for this) and also, an automatic headlight height system, so the headlights are always horizontal, no matter the position of the car.

Now, the main problem, si that a car works only on 12V, and (correct me if I'm mistaken) a RPI input/output only works on 5V maximum.

I am aware of the stuff I might need, maybe not everything.
For the LED Daylights and the mirrors, the doors have a small motor for locking the door, and it works with 3 wires. One is the ground, the other two are +12V, one works when the doors are locked, and the other when they are opened, and they work only 2 seconds. So this could be something to trigger the mirrors and the LEDs. the mirrors can be continously given 12V because if the motor closing and opening them doesn't move, it stops working, it's like this from factory.

For the headlight height, I am pretty sure I need something like an accelerometer to always know the position of the car. And the headlights already have a small motor to control the height, it's controlled manually, though, 6 positions possible, depending on how much weight there is in the car.

Of course, I am aware about all the security that needs to be done to make such a thing, with all the fuses and everything.
And also, I have some basic knowledge in programming with Java.

So, here I need the help of the experts, is my project possible with the RPI?

Oh, yeah, I forgot, for testing purposes, I have 2 spare headlights laying in my room, I changed mine with brand new ones. I also have a spare computer PSU, also for testing, and of course, it has both 5V and 12V.

Thank you! :)

PiGraham
Posts: 4199
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: Small car mods

Thu Feb 05, 2015 4:15 pm

1. The Pi requires 5V power input. You can use a regulator to convert 12V to 5V. Look for car USB charger adaptors, radio control mdel UBEC devices 'Buck converter' modules.

2. The Pi's GPIO inputs are 3.3V, not 5V. I suggest you use opto-isolator chips and relays to signal between vehicle and Pi.

3. Look at ODBII interface to read the lock-unlock state and possibly command the mirror to retract.

http://www.cowfishstudios.com/blog/obd- ... -head-unit
http://www.carberry.it/
http://www.cowfishstudios.com/blog/canned-pi-part1
http://skpang.co.uk/catalog/pican-canbu ... -1196.html

4. If there is a legal requirement on lighting control then you should check if you need an engineering assessment of your proposed scheme to be legal. You may be required to use properly homolgated (officially approved) lighting systems.

Consider your legal position if a home-brew light leveller went wrong, dazzled another driver and caused an accident. Would you be insured? (any modification, especially safety related modifications, might invalidate your insurance unless it is declared and approved) Could you be prosecuted for driving an unroadworthy vehicle?

5. I think an accelrometer can only tell you the level when the car is stationary. When you are moving there will be acceleration in all directions. This video suggests level is done by sensing suspension travel front to rear:
https://www.youtube.com/watch?v=1NUxDbcG6go
Various sensors like that can be found on eBay:
http://www.ebay.com/bhp/headlight-level-sensor

User avatar
emgi
Posts: 357
Joined: Thu Nov 07, 2013 4:08 pm
Location: NL

Re: Small car mods

Thu Feb 05, 2015 6:02 pm

And you need to drive regularly in order to avoid draining your battery.
Provided you are using a switching regulator, a fairly realistic power consumption estimate would be 6W (equals 0,5A@12V).
Consider yourself lucky if it's less, it won't be much less than that.
This equals 10-12Ah on a 24hour basis.

Bottomline: If your car stays unused for a week, the battery will almost certainly be empty. :lol:

/emgi

PiGraham
Posts: 4199
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: Small car mods

Thu Feb 05, 2015 7:24 pm

emgi wrote:And you need to drive regularly in order to avoid draining your battery.
Provided you are using a switching regulator, a fairly realistic power consumption estimate would be 6W (equals 0,5A@12V).
Consider yourself lucky if it's less, it won't be much less than that.
This equals 10-12Ah on a 24hour basis.

Bottomline: If your car stays unused for a week, the battery will almost certainly be empty. :lol:

/emgi
Pi isn't the best choice for this, but it only needs to be on when driving so consumption isn't really an issue. Wake-up time is an issue, so it would require buildroot or baremetal or similar to get ~<3 seconds startup.

king_george
Posts: 5
Joined: Thu Feb 05, 2015 2:49 pm

Re: Small car mods

Thu Feb 05, 2015 8:43 pm

Hello,

First, thank you all for your answers :)

Yes, you are right, Xenon projectors can be very dangerous if they're out of control or if they start blinding people. I trust my mods, but it's true that I never asked myself about what the insurance will do if something falls apart and I get in an accident, so the headlight might not be a great idea. Too bad, though.

About the mirrors and LED lights: It's not possible on my car, it's a Citroën Xsara, from 2004, the year where these kind of modern options started to appear, so automatic mirrors didn't yet exist, so I need to do it by myself, no ODB interface could help me. Besides, if I sort out the LED, I sort out the mirrors and vice versa.

I have thought about the power consumption, I may need to always have the RPI on in order to have the mirrors opened and closed on demand everytime. Is there no stand-by mode for the RPI?

Thank you!

PiGraham
Posts: 4199
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: Small car mods

Thu Feb 05, 2015 9:58 pm

king_george wrote:Is there no stand-by mode for the RPI?
No.

You could use a microcontroller like PIC or Arduino for very lowpower.
Take a look at Trinket or Teensy.

For LEDs and mirrors you could do it with just a timer chip (NE556) and a few passive components.

A Pi1 can boot in <3 seconds with buildroot. and <1 second bare metal. Pi2 might be faster. You could turn Pi on when needed.


Unless you will use Pi's other features it is more than you need.

king_george
Posts: 5
Joined: Thu Feb 05, 2015 2:49 pm

Re: Small car mods

Fri Feb 06, 2015 9:53 pm

Hello,

The Trinket or even the Teensy seem like a good idea, and very cheap and small too.
The Trinket seems to have a 18V maximum input, which is perfect. I can't find anything about the output, though?
Also, how fast can it turn on and what is the power use? If the power use is low, I could, of course, always keep it on.
And, finally, I guess it is programmed in C++?

Thank you! :)

PiGraham
Posts: 4199
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: Small car mods

Fri Feb 06, 2015 10:06 pm

king_george wrote:Hello,

The Trinket or even the Teensy seem like a good idea, and very cheap and small too.
The Trinket seems to have a 18V maximum input, which is perfect. I can't find anything about the output, though?
Also, how fast can it turn on and what is the power use? If the power use is low, I could, of course, always keep it on.
And, finally, I guess it is programmed in C++?

Thank you! :)
Trinket is available with either 5V or 3.3V interface. Choose when you order. In either case you will need opt-isolators or voltage divider and high current switches (FET?) to connect to car circuits. 5V is a better choice for driving FETs.

Program them using Arduino 'Wiring', which is basically 'c'.
http://en.wikipedia.org/wiki/Arduino#Software

Power is low, there is a sleep mode with wake on timer or interrupt, and start-up is effectively instant.

Note that Trinket has only 5 GPIO. Teensy and other small Arduino boards have more I/O if you need it.

king_george
Posts: 5
Joined: Thu Feb 05, 2015 2:49 pm

Re: Small car mods

Fri Feb 06, 2015 10:40 pm

I already am familiar with 12V to 5V converters, can't find any that does 5V to 12V, though, and I've been looking for one for some time for my school project.

However, to command the power source ot the LEDs and the motors, I prefer to use a relay that the controller will control. One LED lamp is 55W (5W per LED, 11 LEDs per bulb), which is too much for a Trinket or a Teensy.

Well, I have zero knowledge about C, but I guess this is the right forum to get started?

mypifi
Posts: 131
Joined: Sun Oct 21, 2012 1:28 pm
Location: oxford
Contact: Website

Re: Small car mods

Tue Feb 17, 2015 1:27 am

A lot of this can be programmed by the obd socket and some software like vagcom for vw audi group cars (or similar software for your make of car) just like many of the optional extras the dealers charge you for can actually be enabled by such for nothing as long as they are fitted.

PiGraham
Posts: 4199
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: Small car mods

Tue Feb 17, 2015 10:22 am

king_george wrote:I already am familiar with 12V to 5V converters, can't find any that does 5V to 12V, though, and I've been looking for one for some time for my school project.

Why do you want a 5 to 12 v converter? You can get 2V ac adaptors to provide power on the bench instead of in the car.

If you want to control 12V devices use a 12 V PSU and switching or control devices that can handle that 12 V. Relays, MOSFETs, H-Bridges etc can be controlled by 3.3V logic (get devices that work at 3.3V)
king_george wrote:However, to command the power source ot the LEDs and the motors, I prefer to use a relay that the controller will control. One LED lamp is 55W (5W per LED, 11 LEDs per bulb), which is too much for a Trinket or a Teensy.
Yes, use a device that can handle the load current, but control it from a low power device such as Pi or Arduino.
king_george wrote:Well, I have zero knowledge about C, but I guess this is the right forum to get started?
Arduino wiring / c should not be too difficult to learn. What you say you want to do will be quite simple code.

If you are a proficient Python programmer and don't want to learn C you could take a look at Micro Python microcontrollers.
http://www.wired.co.uk/news/archive/201 ... cro-python

king_george
Posts: 5
Joined: Thu Feb 05, 2015 2:49 pm

Re: Small car mods

Thu Feb 19, 2015 1:48 pm

Yes, you can program many options, however, for the mirrors, not on mine, believe me, I have explored this idea, the car's computer does not, in any way, work with the mirrors, they are both independent circuits.

So yes, as I thought, there are devices, like relays that can be controlled using the Pi or an Arduino and they can transport a higher load?

Return to “Other projects”