Powering a Mega in an automotive setting

Hello all,

I'm working on planning out a project with a Mega1280. The project I want to tackle is for an engine swap in my truck. I want to take CANBUS data from my new engine into the Mega and use it to fake the engine inputs of the old ECU. This will allow the existing computer to drive all the existing things in the truck (dashboard, transmission, etc) with a different engine.

Now the tricky bit is I currently have only a basic knowledge of electronics, so I've got a big mountain of things to learn before I can build a reliable setup. I've decided to start with tackling how to power the Mega. Automotive power is "12V", but it's really more like 14-15V while the engine is running. The recommended specs say 7V-12V, but 6V-20V is allowable.

https://forum.arduino.cc/index.php?topic=618723.0

I came across this thread about powering an andruino with 12V, and it seemed to indicate that at higher voltages the voltage regulator would overheat. What's the ideal input voltage for an adruino and how many amps does it need? Can I just use the stock 14V from the car if I don't use the arduino to power anything else? Automotive sensors generally operate at 5V, so I'll have a 5V supply from the old ECU that I can use instead of the onboard power.

I hope my knowledge gaps aren't too great here and you can understand what I'm trying to figure out. Looking forward to learning and getting this project worked out. (Yes, I realize I probably have months ahead of me before I'm even close to getting this working).

Most people will tell you to use an external 5V regulator or DC-DC converter, and I I'm not saying that's "bad advice". Since you've got 5V available you might as well use that.

Of course, you'll have to adapt-protect any 12V inputs & output signals (if you're connecting anything to 12V).

I don't know how much current a MEGA takes so someone else will have to answer... But less than 1/2 Amp.

I've had an Arduino Uno running off the "12V" in a vehicle (through the built-in regulator) for a couple of years. (I'm only powering the Arduino and a few LEDs through the regulator.)

You are correct, you have a big big mountain to climb. You need to expect up to 80 volts plus or minus on some of the older vehicles. It is down to 60V on some of the newer ones. These transients are known as Load Dump. You need to pre regulate with an automotive grade regulator. It is easy to say take data from the CAN bus but is the data you need available to you and is it even on that bus. Vehicles have CAN for diagnostics but most also have other buses for control etc. If you an get into the ECU you will need to know the protocol and messages it is communicating with, these are not normally published for security reasons. Look at the cold crank specifications, it is about 6V from the battery and then there is the double battery jump which is about 22V. Consider is the jumper cables are connected in reverse. The sensors are going to be a problem, they are not the same from vehicle to vehicle even though they measure the same thing. These are just a few of the things you need to consider.

These are made for automotive use:

tobsun.jpg

tobsun.jpg

A cheap USB power supply designed to plug into a car's cigarette lighter should be a suitable source of 5v. I got some for abut £1 each that can work with 24v and 12v.

...R

Several people have talked about a 5V DC-DC converter. Do I only need to provide 5V to the Arduino for it to function correctly? Why is the minimum voltage listed as 6V then? My plan is to remove the barrel jack and solder my power supply solution directly to the arduino PCB.

gilshultz, you bring up a good point about load dump, I'd never heard of it before. After a little research I've discovered there's actually an SAE standard to build electronic supply circuits to tolerate load dump. I've built a Megasquirt standalone ECU before, I'll refer back to those schematics to figure out what they did to account for this.

For the CANBUS data, all the data I want is standard OBD-II data points. RPM, throttle position, manifold pressure, and coolant temperature. The faking of the sensors inputs to the old ECU comes back to my experience with the Megasquirt project. As my vehicle is manufactured by GM, all the sensors and their output values are well documented.

georgepatches:
Several people have talked about a 5V DC-DC converter. Do I only need to provide 5V to the Arduino for it to function correctly? Why is the minimum voltage listed as 6V then?

6v is the minimum for the barrel jack - I believe 7v is recommended as the lower limit.

The 5v from a regulated 5v supply should be connected to the 5v pin.

...R

I've used a cigarette lighter USB supply, and connected to the USB port on the Arduino.
For permanent install, SteveMann's suggestion looks more appropriate. Can still use a USB cable, cut off the USB-A connector, and use the USB-B connector on the Mega. Will be sturdier than a couple of wires plugged into the Power Header.

Writing software is tricky. Anything complex rarely works the first time you try it. Probably not the second either.

Consequently, I would be very cautious about having the Mega command the transmission without first doing very significant testing.

wildbill:
Consequently, I would be very cautious about having the Mega command the transmission without first doing very significant testing.

I doubt if anyone would insure a vehicle for use on the road with a DIY computer controlled transmission.

...R

The danger of this is if I get things wrong then I’ll toast the transmission. The 4L60e transmission uses throttle position to set appropriate line pressure. And it isn’t DIY transmission control, the whole point of this is to maintain the factory transmission control with the newer engine I want to install.

But yes, I plan to test this thoroughly on the bench before implementing it in an actual vehicle. I’ve been fiddling and modifying cars for close to 20 years now, I know a lot of things, but this project is also stretching my abilities. Without a challenge we don’t grow.

georgepatches:
The danger of this is if I get things wrong then I’ll toast the transmission.

The real danger is that someone will be killed or seriously injured. In comparison with that a toasted transmission is peanuts.

...R

Anyway...

So I just put 5V directly to the 5V pin by the barrel jack and the arduino with work? I'm assuming that 3.3V pin will not work in this case, correct?

Yes and Yes.
You might also add a diode from 5V (anode) to Vin (cathode) so the regulator isn't totally back driven.
Early 2560 and 1280 boards were susceptible to being damaged from that.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.