No announcement yet.

Arduino Mega As Body Controller(BCM)

  • Filter
  • Time
  • Show
Clear All
new posts

  • Arduino Mega As Body Controller(BCM)

    I have been playing with arduino boards for my car already. for intelligent fan control and separate board for autolamps. I now wish to add remote start to my project car and one day would like to remove the a/c control head from my vehicle. and maybe even the ignition switch. because my car has an aftermarket engine controller with general purpose input/outputs, and the cheap aftermarket alarm in my car has a provision for trunk release my car doesn't have, creating remote start will be incredibly easy. I think an ultimate end goal for this controller would be to remove all switches, dials, levers, buttons, etc. from the interior. they have small 3 and 4" touchscreens for arduino boards, and I could configure one of these for climate control, power windows, or even password input for ignition key delete. but all that is down the road. for initial install the controller will run headlights, fans, and remote start. so far, I have determined pin requirements and pin assignments, setup a breadboard with leds, pots, buttons, and switches where I will later wire relays, sensors, and other inputs for writing and testing software(sketch), and that is where I am, now. copying the autolamp control, and even fan control I already wrote is done, and I am working on remote start. this is my test rig
    Attached Files

  • #2
    Is there a limit to the amount of 'work' the mega can handle? Can everything be combined into the one sketch Or will it be separate sketches? My knowledge is limited with arduino ive played with my leonardo but im lacking time on it.
    P.S love your work!!


    • #3
      I am writing everything into one sketch. so far the biggest problem I am having is I can't use any kind of a delay command anywhere because it pauses the loop and ultimately will impact control of other functions. so where a delay is needed, I create a value, use a couple of if/then statements to walk the value up or down, then use the value as delayed command. I am not an expert with arduino or great with programming. I do a lot of copy and pasting from example sketches I find, then make alterations as needed. but i'm getting better. haven't played with Leonardo, yet.


      • #4
        Im a trial and error kind of guy.the leo can work as a hid keyboard thats why i got it.but i hit a few snags with modifyier keys early on and im not sure if they have been resolved...
        I suppose if it all gets too much for the mega you can always get another and load the sketches need to interact at the moment?


        • #5
          I suspect you will find that an arduino just doesn't have the power to accomplish all that you want.

          Parallax Propeller's are very similar and are designed in a manner that makes them easy to combine together if you want. The Propeller actually came out before the Arduino and is more powerful than any of the Arduino setups.

          It is not the "Common" used board here but you certainly can find more than enough support for it and can get anything up and running within a short time.

          There are also other options out there with the ARM boards that are more than capable of doing everything. Some of the Freescale boards for instance are actually used in prototype cars and in production vehicles. But you can get one of the many ARM boards to play with such as a rasberry pi or one of the much more powerful units. You load Linux on them and can use stuff already around.

          Good luck with your project regardless if you decide to continue to use Arduino or go to something more capable.



          • #6
            for processing power I have an aem engine management system that will drive an engine with sequential fuel injection and coil on plugs all the way up to 25,600rpm, and a 64-bit quad core gaming carputer that scores all 7's in windows7 assessment. this controller needs a bunch of input/outputs, but maybe doesn't need to be real powerful. it is only gonna drive a group of if/then type of commands. not even any pwm ckts at this point. OldSpark already drove me down the road of looking at other controllers when I was building my first autolamp module. I got criticized for the size of the module on this forum. OS suggested I try picaxe chip. so I did. and I built an entire autolamp module, complete that fit on the tip of my finger. and it works. but it is a controller for just one ckt, and that is all it can ever be. in the end, I wasted valuable time chasing something I didn't want to begin with. for I wanted to wire all inputs/outputs into a common controller, so upgrades down the road can be done with just software, instead of running more wires. I am committed to the mega board for now. when I delete window, door lock, and a/c knobs and switches and install 3" touchscreen, I will re-assess the power situation. but I think even at that point, I would just end up with a separate mega board to work the lcd and touch and have it send signals to the other board. here are pics of the big autolamp module I first built with an arduino nano board and what I made as small as I could with a picaxe chip.
            Attached Files
            Last edited by AutoWiz; 06-15-2014, 05:43 PM.


            • #7
              camo.b, at the moment, no the 3 controls I am starting with will stay separate. but it is all written in the same loop and the same sketch. but as time goes on this will change. for example, I have a 2008 chevy uplander for the wife n 3 kids. this newer vehicle uses the headlamps and reverse lights as courtesy lights that come on for a time when the doors are unlocked and when the ignition is turned off but only when it is dark outside. to add this feature I will only have to run one ckt to control reverse lights and the rest is already wired and I can just alter / add to my sketch to create this feature in my 1997 Honda. another example is retained accessory power that keeps the radio on after the car is turned off and until the door is opened. these are all simple controls that can be created with a minimal amount of code, or sketch. and even the same is true for the remote start. you wouldn't believe how short the sketch for that is. and it's because I have an engine management system with general purpose input/outputs. so the arduino board doesn't ever need to see anything that the engine or any of its sensors are doing. the aem ems-4 can handle all that and just ground a g.p.i.o. when the engine is running. and arduino has only to look at a digital pin to make that determination. the rest of the world would have to create some way for the arduino board to interperet the crank sensor, or map sensor to make that determination.


              • #8
                Cool project that i shall follow !


                • #9
                  awesome seeing you tackle this. for remote start, instead of using a password, look into active rfid. I'll be adding that to my car after i finish the digital instrument panel, think it's the best way to go about keyless ignition
                  New System in progress:
                  Phaze TD1500 ~> Dynaudio MD130
                  Phaze TD1500 ~> Seas g18rnx/p
                  Zapco Ref 500.1 ~ 12" tc-9
                  Behringer DCX2496 ~ Envision Electronics psu
                  Transflective Xenarc

                  My Car Pc Install
                  My Boat Pc worklog


                  • #10
                    if i knew how i'd post up a copy of my sketch so far but when i try to upload file it says invalid file.

                    active rfid is a good idea. but that is a whole other project. one i might take but later. aside from creating this body / fan controller i also am building a new screen for my carpc and relocating a/c vents and control head to move screen up higher on the dash. i am setting up an awesome 7" 1280x800 ips panel with hdmi input, and 7" usb capacitive multitouch overlay. got the screen on ebay for $72 and the touch glass for $119 also on ebay. under $200 to build a very sharp display. so i already have multiple projects going on at once. oh, and i am also upgrading carpc to windows 8 to compliment the multi touch monitor. here is a picture of where the monitor is currently mounted and the ac vents and controls above are where i want to put it.

                    and i would love to know more about your digital instrument panel. i have been considering dumping my cluster for another 7" monitor. for me the tuning software i use, aemtuner, has a gauges display and my carpc has a radeon 6670 1gb gddr5 video card so it can handle multiple displays with no problem. so everything is already in place. but i haven't tried doing it yet because i will have to log into tuning software everytime i start my car and other problems of the like that i thought i would cross.
                    Attached Files
                    Last edited by AutoWiz; 06-17-2014, 05:47 PM.


                    • #11
                      Very intersting work AutoWiz !! i am also, just now,completing , a Full AC + power windows control system, based on arduino. but i am not going to use LCDS. instead, since i arledy got a 15.6" lcd in my car pc, i am going to use a java application to control everything from the pc that way you can also control them via voice if you want i can share code!

                      As for the power, i think arduino, and especially mega has moooore than enough power! i dont even use arduino UNO boards. . i use barebobone atmega chips. the only limitation is indeed the inputs outpouts...

                      I am also planing to build an ECU based on arduino chips, but this is some time far from now.. (i already have build a diagnostics module, connected with a tablet, as "instrument cluster" )

                      if you want we can exchange info, because i really dont think this kind of work, has been done many times in the past !


                      • #12
                        In fact, If you see well , just specifics files type are acccepted !
                        Zip your files !


                        • #13
                          settra your offers are why i posted this thread in the first place. please share with me what you have. i was not aware pc could control arduino. only upload sketch and maybe serial monitor. as i said before i am not great with these boards, yet. and i have considered building my own engine controller with megasquirt, but ended up going with aem.

                          my capacitive multi touch glass with usb interface finally showed up. so i am proceeding with moving my a/c control head and center a/c vents down to where the screen is now. i am also installing windows 8.1 pro. never liked windows 8 before, but never had it on a touchscreen. i want to integrate at least basic a/c controls into the arduino mega eventually for my goals of automotive ai. ultimately, i envision the arduino never shutting off. and when battery voltage hits 11v or 11.2v have arduino start my car and run it for a time. and between 4:50-5:30p have it start the vehicle to bring down and maintain interior temps so its comfortable to get in when i get out of work. never having to worry about a dead battery again is a goal i will achieve early on. it will pretty much only require software once the remote start is setup.


                          • #14
                            this is a sweet idea . if you succed on remote start, please post detail info on how you did it, cause i also want to do it on the future (i am planing to use it with mic shield, so that i can start the car via my cellphone)
                            i will post you detailed codes, when i return home, in 5-6 hours or something!
                            in order to control the arduino from pc, you will need to write a program on java, or c++. i did not had previous programing experiance, but Java is easy as spit. it has almost anything ready..
                            the idea is that yout program will constantly send a serial of numbers "9,2,23,4,5...."(which represent what you want the arduino to do) to the arduino. then , on the arduino side, you know exactly the number of bytes you w8 to receive, and decode them accordingly

                            The board i am finishing now, is controlling the power windows + Heat/AC. i also wanted to control the rear fog, and defrost, but i literally did not had enough space for the relays inside the board... :P it all depends on what your car has pre-installed. if all the "buttons" on your dash, where controlling relays, then even small relays can do. but in my case, all the switches (including pwoer windows), where the power controllers, so i had to use buff relays wich take up space... i will be installing the board on my car in 1-2 days

                            As for AC control, it really depends on what you car has.... my car did not had AC at all, so i was free to build the whole system from the start with hobyist servos....
                            the main idea, is that 1) you control 4-5 servos, (airflow, air-recyrculation, temperature actuator..). 2) you control the AC relay. 3) you set a PWM for the Blower. 4) you have a thermometer in the ac evaporator, so that you turn of the AC when evaporator is at 0celcius. 5)ofc implement anything else that your car supports, like cabin temp or AC low pressure leaks...

                            As for the ECU. i have argued milllions of hours with the noobs down at the arduino forum, but the bare truth is that the atmega has MORE proccecing power than the first MOTOROLA chip used in the megasquirt. appart from the bare hardware part, which isnt easy (but i think i can make it), the hard part is writting the software, and tunning the engine... For that reason i am doing it step by step. like : first build and "eCU" That reads all the sensors of the car. then maybe make an ECU that just controlls the ignition sparks, and finally change from carbiratur to injection and control that as well


                            • #15
                              btw, if you want to have a function delayed you could use something like that :

                              unsigned long paused_time;

                              void setup {

                              void loop {
                              //do the things you wanna do.
                              //when it comes the time you want to delay the function use something like : paused_time = millis();
                              if ( (millis() - paused_time)>=2000 ) { //2 secs delay
                              do the function