Keegod
Posts: 6
Joined: Mon Dec 07, 2015 3:54 am

Some advice on car automation

Mon Dec 07, 2015 4:03 am

I have a raspberry pi 2, and I'm looking at automating my car. I see a couple people using arduino to get the car to start via bluetooth, and I was just wondering if the pi 2 was a good option if I wanted to control heat, doors, and the starter.

To give you an idea of what I'll be doing, I want to use three position motors to control the heater settings, (I plan on covering up the current heat controls with a touchscreen - so I'll back up the controls a bit and attach the position motors) , I want to use bluetooth to unlock the car doors with a button on my phone sending a simple command to either lock or unlock the doors. Then there's the starter... I saw a guy use an arduino to check the ECM and then control the starter.

That all being said I don't think the pi 2 should have a problem. I'm just wondering if anyone has any pointers as I begin this process.

ineverwrit
Posts: 2
Joined: Thu Dec 10, 2015 12:10 pm

Re: Some advice on car automation

Thu Dec 10, 2015 12:35 pm

Sounds like an interesting project, and a Pi 2 ought to be a good candidate as a controller. It's worth noting that a car is generally a very 'dirty' electrical environment and it's likely that you'd want to ensure good electrical isolation between the Pi and the car electrics - possibly optoisolators/relays?. It might also be worth mounting the Pi in a shielded box electrically connected to the chassis. As for the software, you should be able to achieve what you want with Python or Scratch, depending on what you are familiar with, although these can be a little slow compared with what can be achieved in C++. You might be interested in http://grapl.16mb.com as an experiment - it could get you started very quickly if you have a reasonable grasp of boolean logic.

Keegod
Posts: 6
Joined: Mon Dec 07, 2015 3:54 am

Re: Some advice on car automation

Thu Dec 10, 2015 10:09 pm

ineverwrit wrote:...It's likely that you'd want to ensure good electrical isolation between the Pi and the car electrics - possibly optoisolators/relays?. It might also be worth mounting the Pi in a shielded box electrically connected to the chassis.
Did some work as a freelance macro programmer couple years back that was on part with final projects for fourth year students, so I pick up on languages decent enough. Sure it was Basic, but I've played around with C++ and a little with Python before. As for keeping the box safe, I plan on keeping it secured in the glove box with wires entering through the side that way very little is visible from the dash other than my screen.

I'm just wondering if anyone has experience here with hooking up electric car locks. I haven't dealt with hardware very much, just the software. Basically, if someone tells me where I should physically hook up and how to get the car battery to connect in the correct polarity I'll be able to handle the programming no sweat. It's just my first larger project so I'm looking for a little heads up :)

I've seen some people say relays are good on other forums, and I'm thinking about going that route. Just need to do some more digging. Thanks for the link!

Metasyntactic
Posts: 13
Joined: Tue Dec 08, 2015 8:32 pm

Re: Some advice on car automation

Fri Dec 11, 2015 2:37 am

I think my first thing to check would be the voltage and amperage your glove box light draws. Couldn't even begin to tell you if it's enough or stable enough to power a PI but it's certainly an idea. Out of curiosity, why go to the trouble of controlling the heat controls with motors? I mean, it sounds like you're already okay doing some serious changes to the cars so why not just solder to the controls behind the dashboard? That way you can maintain access to the buttons while also being able to control them via the pi.

Edit: I'll be honest, I've ALWAYS been tempted to do a James Bond car if I had the time and money. I'd have to disable half the stuff in order to make it street legal but it seems like it'd be a super fun project.

stderr
Posts: 2178
Joined: Sat Dec 01, 2012 11:29 pm

Re: Some advice on car automation

Fri Dec 11, 2015 3:10 am

Keegod wrote:I haven't dealt with hardware very much, just the software. Basically, if someone tells me where I should physically hook up and how to get the car battery to connect in the correct polarity I'll be able to handle the programming no sweat. It's just my first larger project so I'm looking for a little heads up :)
The other person did suggest optoisolators. No one likes to eat fried pi.

Keegod
Posts: 6
Joined: Mon Dec 07, 2015 3:54 am

Re: Some advice on car automation

Fri Dec 11, 2015 5:06 pm

Metasyntactic wrote:I think my first thing to check would be the voltage and amperage your glove box light draws. Couldn't even begin to tell you if it's enough or stable enough to power a PI but it's certainly an idea. Out of curiosity, why go to the trouble of controlling the heat controls with motors? I mean, it sounds like you're already okay doing some serious changes to the cars so why not just solder to the controls behind the dashboard? That way you can maintain access to the buttons while also being able to control them via the pi.

Edit: I'll be honest, I've ALWAYS been tempted to do a James Bond car if I had the time and money. I'd have to disable half the stuff in order to make it street legal but it seems like it'd be a super fun project.

I'm going to be placing a 7 inch screen where the controls currently are as an inboard interface (I hope to later use the pi to control the car computer for quick select of presets for fuel efficiency) and so I'm going to recess the controls and attach position motors so that I don't need to deal with them. I was thinking of just normal motors, and sync them to a 1 to 1 with a rotation display on screen, but decided I might screw that up way too easily.

Honestly, and this is where I might want advice really, I was thinking of trying to create a series of resistors and a fuse or two straight from the battery to lower the voltage/current before it hit the pi so I have constant power, much like you do for an amp. Either that or a rechargeable battery that I have wired to charge while the car is running and hope that's enough to power it

Keegod
Posts: 6
Joined: Mon Dec 07, 2015 3:54 am

Re: Some advice on car automation

Fri Dec 11, 2015 5:08 pm

stderr wrote: The other person did suggest optoisolators. No one likes to eat fried pi.
I need to look into what those are. Like I said, pretty new to the hardware side of the house. And agreed, definitely want to avoid fried pi

stderr
Posts: 2178
Joined: Sat Dec 01, 2012 11:29 pm

Re: Some advice on car automation

Fri Dec 11, 2015 5:46 pm

Keegod wrote:
stderr wrote: The other person did suggest optoisolators. No one likes to eat fried pi.
I need to look into what those are. Like I said, pretty new to the hardware side of the house. And agreed, definitely want to avoid fried pi
The idea is to isolate the pi from everything else. The data connections are one vulnerability point so by attaching them (somehow) to something without a direct physical connection to the car, you gain protection. An optoisolator can use light to send the data from, say, a diode to a sensor. Light isn't an electrical connection, so if something happens on the other side, something within the capabilities of the device to deal with, damage shouldn't get across the optoisolator. Of course it could be destroyed but that's better than the pi being done in.

Another potential problem is that your car is powered by a battery and an alternator. How steady and spike/dip free is that power? You may wish to check at your potential source with a meter that is able to read fast enough to see, for example, as someone else starts up the car. If you plug in your smartphone or a tablet to the cig lighter, those devices will have a battery and other electronics to smooth things. They'll also get some help from the 12v to 5v parts in the device that plugs into the lighter. Newer cars have USB power adapters which might have all that is needed in them to avoid these issues. That might not be true if you just score some current off some random hot wire.

ineverwrit
Posts: 2
Joined: Thu Dec 10, 2015 12:10 pm

Re: Some advice on car automation

Fri Dec 11, 2015 5:52 pm

Drop-down resistors will not provide a steady voltage, which is what the Pi needs - a steady 5V. As the Pi does its thing, the current it draws will vary, and therefore so will the voltage to the Pi vary. A better solution would be a 5V regulator like this: http://uk.rs-online.com/web/p/linear-vo ... /0463599P/ or, if you want a quick and easy solution, a car adapter for charging an iPhone/iPod such as the Belkin Universal Car Charger. The Pi typically needs about 1.2A for itself but you'll also need to add the power consumed by anything connected to it such as relays/actuators.

Keegod
Posts: 6
Joined: Mon Dec 07, 2015 3:54 am

Re: Some advice on car automation

Fri Dec 11, 2015 6:10 pm

Thanks for the input!

So I can definitely see using the isolators to receive the data, and using the relays to control the doors and such. So I might need to just look at external battery packs for the pi, see what I can find with pass through charging and hook that up so that while the car is off I've got power and when the car is on, it's juiced by either a line using that regulator or by the usb/car charge port. The goal is to have something that's powered in the background constantly, and I was thinking directly of the car battery would be best, but obviously I need to rethink that after what you guys mentioned.

Metasyntactic
Posts: 13
Joined: Tue Dec 08, 2015 8:32 pm

Re: Some advice on car automation

Fri Dec 11, 2015 7:25 pm

Keegod wrote: I'm going to be placing a 7 inch screen where the controls currently are as an inboard interface (I hope to later use the pi to control the car computer for quick select of presets for fuel efficiency) and so I'm going to recess the controls and attach position motors so that I don't need to deal with them. I was thinking of just normal motors, and sync them to a 1 to 1 with a rotation display on screen, but decided I might screw that up way too easily.
Well, so, the issue with that is, besides the issue of mounting motors and making sure they don't break, you have to actually run them. I mean, I guess you could use servos, but even then, it's a little annoying. The nobs you're looking to control are just potentiometers though, right? Or possibly push buttons? All you need is a digital potentiometer (obviously not if it's a push button). They're literally intended for this application.
https://www.sparkfun.com/products/10613

I actually use them to control my sound system over my home's wifi network. They're incredibly easy to work with.

Metasyntactic
Posts: 13
Joined: Tue Dec 08, 2015 8:32 pm

Re: Some advice on car automation

Fri Dec 11, 2015 10:18 pm

By the way, this will help you with your door locks.
http://www.instructables.com/id/RFID-Ca ... nlock-v10/

Keegod
Posts: 6
Joined: Mon Dec 07, 2015 3:54 am

Re: Some advice on car automation

Sat Dec 12, 2015 1:00 am

The reason I'm using position motors is that I don't want to tear out too much of what's there, and I can use tiny electric motors preset to specific locations to turn the metal bars the controls used to turn to change the heating arrangements. Sort of just replacing the knows with a tiny motor that does the same thing but allows it to be recessed behind the screen.

Thanks for the link! I have a Bluetooth dongle on the way so I'll be able to try and get this to work with bluetooth

Slackware
Posts: 131
Joined: Mon Jan 18, 2016 3:45 pm

Re: Some advice on car automation

Sat Feb 13, 2016 9:06 pm

biggest problem with a pi for this is you would have a wait overhead for it to boot. an arduino would have no such limit well one in a few nanoseconds anyways.
but why a 3 position heater? With a temp sensor you can have the temp set for any amount of heat or cold, just adjust the below doors by fractions as needed.

only reason for a pi would be to send garbage to the state inspectors when they plug into the computer, and even that a arduino could probably handle. A nice 12 volt negative spike on the signal lines should smoke their equipment when they hook it up to the obdb connector. Just make sure you have something that hooks up and needs that spike on the connector. A work light to look at fuses under the dash perhaps.....

Return to “Automation, sensing and robotics”