New User: Truck-to-PC module

Hey everyone! I've been very impressed with the power and capabilities of the Arduino since I first discovered it's existence via Hack-a-Day.

I am new to micro-controllers and have only done minor tinkering and small projects. I feel very comfortable with this though, as it seems pretty user-friendly and I am fairly good at programming (Learn pretty fast and have messed with the most common languages)

Anyways, to the point - I recently installed a Carputer in my truck and wanted to put something together to allow the computer to interact with the truck. Nothing too extravagant but I wanted to retain my stock steering wheel controls. They output on a single wire which reads different resistance values depending on which button is pressed. (Each button has a different value resistor connected to it)

I need a way to take that output and get it to my computer. Once the computer receives an identifiable command from the controls, I can program something to take care of it from there... Just getting it there is my problem but I'm sure the Arduino can handle this easily.

I also want to be able to control my windows, locks, engine start, pull OBDII codes, etc etc. I don't have a set list of everything I want to do just yet but I just wanted to make sure that I am investing in the correct board. I was thinking that either the "Pro 328" or the "Duemilanove" would work? Maybe even the Pro Mini?

Just wanted to get a little insight and make sure I'm on the right path.

Thanks everyone!

As a beginner, start out with a stock Duemilanove (w/ 328 - I don't think they come with 168s any more, but just be sure), work thru the examples, etc.

A lot of what you want to do can be done with the Duemilanove (and you can learn the individual stuff using it); but in the future, you will probably want to upgrade to the Mega (or a similar board based on the 1280), simply for the extra ports, speed, etc - you will likely need for everything you are wanting to do.

Good luck!


Thank you for the reply! Honestly, I would rather start with the Mega if you think that's what I'll ultimately need. I don't mind the investment as I am in no rush for this project.. Just want to get it right the first time =)

I just don't want to get the Mega if it's overkill and not going to do more than the Duemilanove. I haven't looked into the ODBII monitoring and such yet so I don't know what will be required on that part but the rest should be easily handled by the Duemilanove I would GUESS. But then again, I am new and not sure. I may get the Mega anyway just to be safe.

Your two biggest issues to do everything you will likely want to do will be 1) code space, and 2) ports. The Mega has a lot more room for code and variables, plus it has more ports for i/o use.

With that said, I would still urge you to go with the Duemilanove at first for the simple reason that that majority of examples and tutorials you will find out there (aimed at beginners and seasoned users alike) are typically done with a Duemilanove, and not a Mega; there are certain differences between the two (certain pin numberings and such) that you may run into issue attempting to use one set of code on the different platform, which, as a beginner, may cause headaches.

By going with the Duemilanove, you would avoid this issue, and you may also learn a few tricks by being a such a restricted space (32k, vs 128k on the Mega); you may actually find it can do everything you need, with good coding (and bloat elimination), coupled with some extra hardware (port expander ICs, SPI/I2C interfacing, serial LCDs, etc).

If you find later that you need the Mega, you will be able to carry all that you've learned over to it, and by that time you will have a foundation such that any differences between the platforms are easy to spot and change in your code.

Another reason to go with the Duemilanove is the fact that there are more shields for it, should you need them, simply because there is a larger user base; generally, if you have a need, there has probably been a shield made to address it. Finally, the Duemilanove, based on a thru-hole DIP IC (well, on your standard Duemilanove), allows the option of uploading your code to the ATMega328, then migrating the IC to your own custom embedded PCB (should you build one) fairly easily. While you can fab your own PCB with an SMT ATMega in mind (with programming headers and such included), it isn't as easy of a task, and takes special skills and sometimes tools to do right (SMT is one of those things I have yet to try my hand at, personally).

Good luck, whatever path you choose!


Again, thank you. I will be taking your advice and ordering a Duemilanove tonight :) My biggest concern is that the memory can't house all that I need it to do.. 32k seems so small! But we will cross that bridge when we get there.

My biggest concern is that the memory can't house all that I need it to do.. 32k seems so small!

32k -is- small, compared to what is available today; but you would be surprised what you can fit into that space, especially as you trim and optimize your code (do this last, though!).

The limits imposed by the small amount of memory can actually lead you in surprising directions, as long as you don't take the easy way out and buy a Mega at the first sign of trouble. You may find after all is said and done that you have to use a Mega; but look on using a 328 as a supreme challenge of your skills as a programmer. I have seen amazing, jaw-dropping-to-the-floor things done in only 256 bytes - check out this site, search on "256" to see some examples:

BTW - if you increase the footprint a bit, say to 1K - ooh, boy! Or, how about this guy (mentioned earlier in a thread around here on video generation with the Arduino - a forum member here created an NTSC library):

Seriously - if you look upon the limit as an opportunity...

In a project I work on sporadically, I thought a 168 was going to be tight for my needs; I eventually upgraded to a 328 for the heck of it, but I found as I wrote my code, that things weren't increasing as fast as I thought - my compiled code now sits at around 4-5k - you might see the same thing.

As I said before though, where you might run into issues is with ports and I/O; the Duemilanove only has so much. You can expand this with shields or custom circuits (shift registers, analog multiplexers, etc), depending on what you need speed-wise and such. You may be able to figure out ways around such limitations - or you might be forced to a Mega or some other solution.

The main trick, though, is to put your "hacker hat" on, and code like a mad monkey on crack. Think outside the box; heck, think outside the universe the box is in! I have always been in awe at democoders and others in the scene; they have always pushed the limits of modest hardware...

Good luck, and if you have questions, etc - post your code (use # button!), your schematics, etc - we'll all be here to help as best as we can...


Just received my Arduino today. Sadly, I can not do anything with it until Friday or Saturday.

Anyway, I was wondering exactly how will I set this up for the steering wheel controls? The controls are off 12v I believe so can I reference that on the reference pin and just pull the value from one of the analog pins?

Anyway, I was wondering exactly how will I set this up for the steering wheel controls? The controls are off 12v I believe so can I reference that on the reference pin and just pull the value from one of the analog pins?

Be sure to order a replacement BEFORE you do that.

Anything more than 5V in, and you'll need the replacement for when you do it right.

Well, knowledgeable one, how about you explain the correct way to someone who is new to this; rather than being sarcastic about it.

The maximum voltage into the Arduino, on a digital or analog pin, including VREF is 5V. Anything over that is likely to damage the Arduino.

You could use two resistors, as a voltage divider. Feed the vehicle's power to one end, ground the other end, and tap the middle to feed into the digital or analog pin.

vehicle power --/\/\/\/------+---/\/\/\/\/-------Gnd | input pin

The total resistance should be about 10K. The ratio of values should be 7 to 5, with the larger resistor on the left, and the smaller on the right.

The voltage divider drops the voltage, so that (if a 7 to 5 ratio is used) 7/(7+5) (or 7/12ths) of the voltage is dropped before the pin gets power.

If the vehicle power goes over 12 volts (and sometimes the voltage in a normal car can exceed 14V), use a larger resistor on the left.

Thank you! I was wrong though about the control voltage.. When I finally got home, I hooked a multimeter up to the output wire and it never read over 2v.

Looks like I'll have to do more studying though because I wrote a small program for my Arduino to tell me what the input value was every second and it fluctuated so much that there is no way I'll be able to capture a correct button press. I didn't reference anything though, just that single wire to the analog 0 pin.

I just downloaded the service manual for my truck and will study that and see what I come up with.

Did you connect the Arduino ground and the vehicle ground? The Arduino is measuring relative voltage. Relative to what? To ground, of course. So grounds need to be the same for the vehicle and the Arduino. I.e. they must be connected.

Doh! No. I was trying to do it while it was still light outside and I totally didn't even think of that. I will try again tomorrow since we only work eight hours then. Thanks again!