I am new to Arduino and I need so help. I was advised by a friend to look at Arduino as a solution to a problem I have.
I have a after market engine management system for my car and I need to interface it with the car's OE gearbox controller to send a signal to my engine's ECU to temporally cut power when a shift change is detected.
The gearbox controller (which I can not access to configure) has 5 shift solenoids to select all 7 speeds of the gearbox via a combination of the on off states (12v/0V) of the 5 solenoids.
I have searched a bunch of online tutorials and project info but could not find anything that would help me.
Can someone point me to a project where that tells me which functions in Arduino I need to use to pulse an output for 1 second should any of the 5 wires I am tapping from the gearbox change state?
Please I am a complete Noob so be patient with me.
First, if this is a road car then you will invalidate your insurance by doing this and you might be breaking the law.
To do what you want you need a voltage divider for the inputs, there's lot and lots and lots and ... of examples on this web site for connecting 12V signals from car electrical systems to an Arduino, so do some searching.
You need to learn C/C++, which you can do using the examples and tutorials on this web site, in the IDE and elsewhere. I found this web site very helpful when I learnt C C Tutoral
You probably need a buck converter to power the Arduino from the car electrical system.
I stay in South Africa and Insurance and law regulations are not that strict, we are allowed to install aftermarket ECUs into road going vehicles.
I understand the electrical connections. I will bring the 12V signal down to 5/3.3v on the inputs and use a 9V voltage regulator to power the Arduino.
I bought an Arduino with a starter kit with some projects but what I could not figure out to date is to detect a change of state from 5 separate inputs to a single output. Whenever I search for something like that the results is normally to connect 5 switches to a single pin via voltage dividers with each switch having different resistance values on the input pin state. That is not going to help me to sense a change of state between any of the 5 input pins. Does this explanation make sense to you?
I stay in South Africa and Insurance and law regulations are not that strict, we are allowed to install after-market ECUs into road going vehicles.
OK, I know nothing of South African law (beautiful country BTW, I visited in 2016 ). The warning is also for anyone else reading this who might want to copy what you are doing.
Use a 9V voltage regulator to power the Arduino.
You would be better to use a buck converter with a 5V output connected to the 5V pin of the Arduino. The on board regulator on the Arduino cannot supply much current and will probably get hot with 9V in, bypassing it altogether is better.
What you are asking is straightforward. You just need the basics of programming, which you can learn by doing the various tutorials on this web site, in the IDE and elsewhere. I get the impression you have yet to learn the basics.
benniehurter:
Can someone point me to a project where that tells me which functions in Arduino I need to use to pulse an output for 1 second should any of the 5 wires I am tapping from the gearbox change state?
Bring the state of each conditioned input into the low five bits of a byte then mask off the upper three bits with a bitwise AND. Compare the byte now to the byte's state on the last pass through the code. If it's different set a boolean flag to trigger whatever action must be done. Store the current state into the last state, that way if nothing changes no more change signals are generated. When the work that the flag triggered is done, clear the flag.
I am new to Arduino specifically but between my son and myself we can get basic circuits working, We need to figure the more complex stuff out still.
Hi dougp
I think you are on the right track but I still cant figure out how to read a a complete port in one go yet. I looked at some examples but it gets a bit complex. My theory on digital maths is very rusted I last studied anything to do with bit shifting etc was in colleage back in the mid 90's
We came up with this design last night. Ignore the resistance values and many volt and amp meters for now I am experimenting to see what values works best and safest, Have a look at the code and tell me if we can do it better
The one thing I am still struggling to figure out is why the pin 13 switch off (to 0A) does not happen instantly.
benniehurter:
I think you are on the right track but I still cant figure out how to read a a complete port in one go yet. I looked at some examples but it gets a bit complex.
There are ways to do this but it is almost certainly unnecessary.
Use digitalRead to read each of the pins and compare each with the previous value. It will take only microseconds to do so.
Thanks for all the concern around the insurance. Some have even sent me Private Messages. In SA it is not required to have vehicle insured to use it on public roads, the only requirement is that the vehicle has undergone a road worthy test to get it licensed and registered.
We have this Arduino circuit installed and it is fast enough to get the ECU to retard the timing when changing gears. My son did some fancy math to check for state changes on individual inputs and it seems the Arduino can switch pulse to output quick enough.
But we have one more issue and that is the boost controller. At this stage we only have it as on or off and we want to change it to apply boost in a controlled manner. Firstly we will have to build a circuit that reads values from a MAP sensor and then pulse the Boost controller via a PWM signal and then we will also connect the output of the existing functions to drop of boost during gear changes. I looked at some fading LED projects on TinkerCAD and that would be a perfect start for this code.
I have a few new questions:
As far as I can figure out the Arduino PWM runs at 1Khz. from documentation it seems that the car's ECU used to run the boost controller at 32 Khz. I found a you tube video of someone explaining how to use a code library to change the PWM frequency. With running such a library on the Arduino, would it be wise to have the PWM control functions on a separate Arduino or will a single UNO be capable to run to multiple processes simultaneously?
Since the PWM output is 5V and the car's boost controller runs at 14V what type of Transistor/OPAMP would be best suited to boost the PWM signal to the higher voltage? The Boost controller's coil measures 24ohm so I guess the current draw should be around 600mA.