Core Electronics Forum

12v Triggering GPIO to turn on camera

To the gods of the project work,

I am currently trying to wire up my car to receive a gpio trigger when the car is in reverse and then turns off when the car is back to normal drive, i know that i am very new to this world and at my age its definitely a hobby to pass the time. i find it so fancinating however im very limited in the world of tech and learning this world be a great start.

At the moment i have a raspberry pi 4 4gb, a 12v camera how to make it work>?

3 Likes

Hi Quan
The easiest place to get a signal when a car is in reverse gear is the reversing light wiring. Relatively easy at the rear end of the car but can be a bit of a dog’s breakfast when trying to do this under the dash.
I had lots of fun with my car (Peugeot) when fitting a reversing camera.
Cheers Bob

4 Likes

Hey Quan and Bob,

Yes, the lines running to your reversing lights should pretty easily get you a quick high/low depending on whether you’re in reverse for this project. Auto-electrical work is often quite an organized mess to put it lightly, just be careful that the voltage that you’re getting off that line is suitable for input to the Pi if you’re connecting directly to your GPIO (or regulated with an appropriate logic-level converter in between if necessary) and you should be good to go!

Let us know how you get it working when you’re done if possible, I’m keen to see whether you came up with any tricks for it along the way that may be useful for future projects :grinning_face_with_smiling_eyes:

3 Likes

honestly your going a to an long extent to do a simple job just hook it to the reverse sensor on the gear box…

Thank you all so much for a swift response… so what I have in been able to achieve is get the camera to work, how do I automate this with gpios? I have seen the core video of setting up a relay. I have also gone that way but I don’t know much about scripting…or making it automated when I switch to the reverse.

Hi Quan
Why are you scripting anything??? Over complication is all you finish up with.
Just connect the camera to the reverse light circuit. If too much current is a concern do what I did and fit a LED lamp to the reverse light to replace the current hungry incandescent one.
Cheers Bob
PS. When the reverse light comes on the camera comes on. When the reverse light goes out the camera goes off.

1 Like

Ok, how does it show up automatically on my screen? I still have to press a button on my pi for it to show. I’m trying to make it automated. Currently I have everything wired up as follows. Video capture card to reverse camera, power source to 12v relay and then some gpio pins into pi…

1 Like

Hi Quan
This is the first time your screen has been mentioned. You have just been talking about turning the camera on and off.

You do the same at the screen end. Identify the reverse light wire and use this to drive a relay to power your screen or trigger something else to do it. Are you using a Pi to record video?

I think this is the first time this has come up. I can make no further comment until I see a proper circuit showing what you are trying to do.
Cheers Bob

1 Like

My apologies for the lack of I formation. My intent is to use a reverse camera in the car, and when I put it in reverse the video image comes up on my pi screen.

At the moment I have the following set up.

1 Like

Hi Quan
Not exactly what I had in mind for a schematic but it looks like you are using the Pi to switch the relay and provide power to something or everything, not immediately obvious from the pic. How is the camera itself powered. Via the long cable or locally at the back of the vehicle. I have been assuming locally at the back.

If power is supplied to everything at the front end you could stay with that set up and signal the Pi that reverse is selected. The easiest and most obvious way to do this is still the reverse light wiring.

I would not do it this way as this sensor would signal a computer somewhere and you don’t want to upset this operation.

Identifying the reverse light wire at the dash end is a major problem. Some cars (mine included) have an ID number printed on and this will help if you can find it at the rear end for ID purposes. I fitted a wireless system in my car recently and had to do something similar to switch the receiver and screen on when in reverse. I got wiring schematics for my vehicle (or a close approximation) which enabled me to find the relevant connection under the dash. My car has a central distribution unit with lots of plugs so being able to identify the colour coded plug was a good start. Without this info this could have been a nightmare but as long as the wire colour and ID markings are there not impossible. I changed the bulb for a LED as described above and used the light power for the camera and transmitter.

You have to tell the Pi that reverse gear has been selected. Without diving into the computer communication system (something I think should be avoided at all cost) the only way I can see is to use the reverse light system. There may be other exotic means but I can’t think of any easier.
Cheers Bob

1 Like

i think my intent isnt being met. i have sourced the power from the rear light so when reverse is engage the power will power the rear camera. please note this isnt a camera that comes with the car its aftermarket. i need to tell the pi when the camera is on (in reverse)the screen will show the image autmatically.

1 Like

Hi Quan

Getting information is sometimes like pulling teeth. OK. Now we see the camera itself is separately powered and you can use the reverse light wire ar the rear of the vehicle to do this. Is this correct ? I would still change the bulb for a LED type so you should not have any over current problems.

That is fairly obvious.

I get the impression that it is you who are not understanding and reading properly.

That is what I have been saying. And I also said the easiest way to get this info is the reverse light circuit. To do this you will have to identify the wire at the dash end as I have said. I don’t know any other way to get this info. If you find another way I would be interested.

If you play with the sensor at the gear box or any other part of the vehicle electronics do so at your own peril. I personally would have no part of that.

Identifying the reverse light wiring at the dash end will have to be up to you. I don’t think there is any way to help you remotely. Especially as you haven’t bothered to share with the forum what sort of vehicle you have. Remote as it seems there is a possibility that a forum user may just have been through this exercise with a similar vehicle and can steer you in the right direction.
Cheers Bob

1 Like