5v signal to 5v signal converter

First off sorry if this is covered elsewhere in another topic. I would say i'm pretty saavy with electronics, I have some computer programming experience but I am VERY rusty as I haven't done it in about 12 years, but I have a good bit of experience diagnosing and repairing electronics. I am also very new to arduino, I have a little bit of knowledge about them but I have never actually messed with one before but I am eager to learn so please be gentle if I say something stupid lol.

Anyways with that being said I am working on a project car of mine and have an issue that I think an arduino could help me solve. If anyone wants more details feel free to ask but the basic issue is this.

The ECU I am using is looking for 2 5v analog signals from a pair of sensors on the throttle pedal. This pair of sensors both function from 0-5v however they are inverse to each other, so at closed position sensor 1 reads about .2v while sensor 2 reads about 4.5v and sensor 1 increases voltage while sensor 2 decreases voltage as you push the throttle until they are inverted at full throttle.

The problem is the original part that makes this signal won't fit in the car without a ton of work, so I would like to use the existing pedal I have. This pedal also has 2, 5v signals. However they do not swing in the same way. On the pedal that is already in the car sensor 1 outputs about .2v - 2.5v while sensor 2 outputs about 2.5v - 5v and they both increase as you push the pedal instead of being inverse to the other.

So basically I need to have a board and bit of code that takes 2 inputs from the existing pedal and then convert and output the 2 corrected signals. I read alot that arduino doesn't output 5v analog only 5v pwm, but again I am a total noob with arduino and have only been researching this for a couple days but I would imagine this could be possible. If anyone would like to help me learn and work out my problem any help would be much appreciated!

Before getting to involved you should read this application note: https://www.st.com/resource/en/application_note/an2689-protection-of-automotive-electronics-from-electrical-hazards-guidelines-for-design-and-component-selection-stmicroelectronics.pdf It will give you an idea of what you have to look forward to. Because of the safety involved I suggest checking to be sure it is safe and legal in your area to do what you are thinking about.

1 Like

I second that.
You intend to build a throttle manipulating device from beeing a beginner in programming.
Will you promise to add an emergency engine-stop button that is directly disconnecting ignition and fuel-pump to have safety-backup to make the car stop in case your 5V-interface goes crazy?

Just a phantasy thought-experiment:
If any kind of accident has happened where somebody got badly injured or died and you could make a very special contract with the devil himself
aim: person is completely health again or comes back to life
and as the "price" you have to drive around with some weird box mounted on your dashboard or anywhere else to use the original parts

How many years or how many miles to drive would you agree in this contract to drive with a car where this extra-space requiring original part is mounted?

Of course you can't make such a contract with the devil but you should make a promise to your guardian angel to stay always safe yourself so your guardian angel will be able to rescue you in case somebody else is careless.

I'm a big fan of DIY electronics but when it comes to safety I always use professional products.

I have a mains-voltage 50m cable drum. If you buy one in the supermarket they start at €40.
I have a 3x2,5 mm² (instead of 3x 1,5mm²) cable certified for permanently outdoor use under rough conditions, PUR-coated with an integrated nylon-rope against tearing off the cable with integrated Residual Current Device which has a high-class protection certificate which cost me €350. IMHO it is worth each cent because of the high reliability and security

best regards Stefan

2 Likes

Thanks for the read, there is alot of information in there. I appreciate you guys thoughts on the safety aspect of this idea. This is just a project car for track use and will never see the road, but even if it did the state I live in pretty much anything goes when it comes to cars lol. I actually work on cars for a living and you would be amazed at the kind of stuff people get away with here we have no inspections of any kind. most of my experience is diagnosing and repairing automobiles.. But don't worry ensuring safety in the event of failure is #1 in my mind. I'm not a beginner in electronics or programming but I am a beginner with arduino...... and I haven't coded since high school lol mostly java and C++ but i understand code and pick it up quick.

I am also using the factory harness for this project to keep it as simple as possible so everything will be wired as factory and the sensors in question are simple potientiometers on a 5v reference circuit for the inputs to arduino. EMI shouldn't be an issue as this stuff lives far away from any major EMI source. As far as voltage surge and fluctuations I am not sure how sensitive the arduino itself is to that. But if I could make the circuit and code and install it to test I can work out any possible issues during the testing phase.

Basically trying to make something similar to a pedal commander which does a similar function of taking in the signals from the pedal sensors and altering the output signals to the ECU to change throttle response curves to the drivers liking. Just instead of just basically amplifying the input voltage for the output like a pedal commander i need to take in a voltage and output a different voltage over a range of 0-5v on 2 channels.

The car will have an E-stop that kills ignition and fuel as well as cut the battery all together. Will also have an inertia switch that will kill fuel in the event of an crash. I plan on installing the signal converter on a breadboard in the car at first during testing so I can introduce all possible failure scenarios easily and make sure the ECU responds as it should before it ever moves.

The reason the pedal has 2 opposing sensors is for this reason. If 1 of the 2 sensors or both fail, output the wrong voltage, don't correlate with each other, etc. the ecu will throw a code and should get thrown into a limp mode state to disable the throttle and only allow the engine to idle which is a built in safety feature in the code of the ecu. I plan on doing extensive testing to make sure that any possible failure to the part I make will throw it into limp mode. Once I go through function and safety testing on a breadboard then i'll 3d print an enclosure and make the final install.

But trust me I have not overlooked safety lol. I understand and appreciate the thought experiment, the part I want to try and use is the original part to the car, but not the original part to the engine swap ECU. and its not that the part that would just work properly is a bit bulky kind of thing, its more of a it just won't fit at all kind of thing lol.

Even though the only person that will be in danger is me crashing into a wall on track I still don't want a runaway throttle for any reason and will make sure its impossible for the arduino to cause that. I would never carelessly put something on a car that could kill me or someone else, i've driven enough customer cars that tried to kill me I don't plan on adding to that madness lol.

I was thinking using 2 arduino nano would be the best option. 1 for each pedal sensor. Each would have its own separate code and just a single input and output with a DAC on the output. please correct me if i'm wrong or there is a better way, I wouldn't mind a bit of input on the hardware side

Sorry for the rant, but I am a very safety oriented person lol if I didn't know that there are already safety features in the main ECU for this then I wouldn't even attempt this.

Thanks for the update and the good answer to my concerns. You know what you are doing, the majority I see do not. I have many years in automotive electronics and understand what happens and the extreme amount of caution the OEMs use to be sure everything is safe. It is amazing what users will do to a car and when it messes up expect it to be covered in warranty.

Yeah i'm not just some dumb kid trying to do something stupid lol It is nice to know someone else with automotive experience. I went to school for automotive tech and have about 16 years of automotive experience and I have been playing with all sorts of electronics since I was a kid. I actually own a small auto repair shop, i've been in business almost 10 years now. I tend to get alot of electrical issues that no one else in town can figure out. There are very few techs in my area that really understand electronics and how to test and troubleshoot them.

Not to mention customer installed electronics, it almost always makes me cringe when I see the fire hazards and rats nests they create lol.

So do you think i'm on the right track hardware wise? Would the nano be a good fit for this? Cost isn't really an issue but if the nano would work it would keep the cost and size down to a minimum. And I thinking using 2 so each one is only dealing with converting 1 sensor would add a level of safety and make it easier to diag in the future if an arduino fails to just look at the sensor PIDs on a scan tool and see which one is out of spec and point you to the problem faster.

Also I am just starting to get into the coding. I'm trying to brush off the rust since its been a LONG time since I've used it. I'm thinking I can make an array basically as a reference table for output and have an input value reference a different array index then output that value as pwm voltage. It would be a large array, at least 50 so it would have a fine resolution on the output through the swing of the potentiometer input. Am I thinking about that right?

The Nano or any other would be fine, just keep it in the body compartment as elsewhere as you know will get a lot hotter. Be sure to protect the electronics from all the nasties.

When the circuit is operational only while the alternator is operating I like to keep the input to the microprocessors as reasonable to 100K as possible. I normally put a pull up on the input connector to be sure I pull at least 1mA then a 100k From that point to the microprocessor with a small maybe 220nf on the port pin to ground. That will limit the current to the protection diodes to 10mA with a 1Kv pulse. This slows down the input but if somebody presses a button a few milliseconds will not be noticed.

Another trick I use is place a fuse in the circuit power input and a diode that will blow the fuse if connected backwards. If you can afford the voltage drop a series diode will do just great. They also make voltage rated regulators that will protect against reverse battery, low voltage, and lots of other things.

My background is based on zero defects and how to maintain that number. Also I design with an idea that might be a million out there this year and more next. I am not that cautious on this forum but generally that is the base for my answers. The AEC Q100 ...etc specifications are a big help. As you read them I had to meet all of them and more with my designs.

Now you probably understand my caution when I first responded. Hopefully this helps.

1 Like

A couple of op-amps, maybe three.

1 Like

So you need
a circuit that takes 0.2 - 2.5V and generates 0-5V .....(A)
and
a circuit that takes 2.5-5V and generates 5 - 0V ..... (B)

for A you need an amplifier with a gain of 2.17 and offset of -0.2V
for B you need an INVERTING amplifier with an offset of -2.5V and gain of 2.0

Each of those is a simple task for an op amp. and using an Arduino would be irrational.

To ensure the voltages stay within the 0-5V range I'd power it from a 5V supply (12V via a regulator) and use rail-rail op amps. Decouple everything with capacitors to eliminate spikes (and noise from the original signal) and build it all on perfboard or similar.
Simple fun job easy to test on the bench.

No real safety concerns as if the signals dont match the ecu will go to limp home.
After all, if the original gubbins has a problem the ecu does exactly that.

I've had this issue on my merc, cost me £250 for a new throttle pedal - likely the only problem was one of the pots had gone noisy,

1 Like

Thank you guys for your info it is much appreciated!

what you described is exactly what I need to do, just on the output side not quite 0-5 or 5-0. more like 0.2 - 4.5 and inverse but you got the idea. Speaking of merc pedal that is exactly what i'm trying to do. Trying to convert the merc pedal outputs to a GM pedal output.

I kind of thought this could be done with hardware alone but I don't think i've ever used an inverting op amp. Can you point me in the right direction where is a good place to buy good quality hardware? Rather not risk just buying possible junk off amazon lol

What's your QTH ?

1 Like

Not sure what you mean @phestezio - op amps (by definition) have inverting and non-inverting inputs.
Do you mean you havent used one configured as an inverting amplifier?
You can see all those configurations in my link.

I bought GOOD op amps from RS Components (UK) and VERY DODGY ones from China (on EBAY).

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