Throttle sensor with voltage display noisy only when using arduino

I've been working on a little device to take a throttle input and modify the signal. The Arduino reads the throttle and then outputs a new value via a DAC. When testing, I have a throttle just plugged into the Arduino and the power comes thru usb. Everything works great.

But when I plug the Arduino into the vehicle's throttle powered by a battery, the signal from the throttle is extremely noisy, basically unusable. I suspect it has something to do with the throttle having a voltage display, which is fed directly from the battery and then the ground goes thru the same wire that the throttle ground uses.

If I use a second throttle which is just plugged into the throttle connection and not directly to the battery/no voltage display, etc, then the input signal is fine. Or if I take out the Arduino and use the main throttle, the signal is fine.

Is there a way I can stop the sensor from being so noisy? And why is it only happening when the Arduino is introduced? I'm tempted to use a throttle which doesn't have the voltage display, but it's a nice feature to give up.

Here is the basic layout of the systems, showing which is noisy and which are ok

Thanks for your help!

Would a diode or a capacitor or something help reduce noise? I really don't understand why the sensor would be so noisy but only when using the arduino. The arduinos output is fine, just the input of the throttle when plugged into the arduino with the voltage display enabled

Sounds like ground currents from the voltage display are injecting noise directly into the system.

MarkT:
Sounds like ground currents from the voltage display are injecting noise directly into the system.

thanks for the replay, and yes it does seem like that is likely the case, I don’t get why it works correctly when the arduino is taken away and plugged directly into the controller.

Im gonna try using the voltage display on the second throttle I have and see if the same thing happens

Run separate ground wire to the voltage display, alongside the 60V switched supply.
Each signal or power wire should be running alongside its own individual ground so that
you don't have big loop antennas all over the place. You might be picking up interference
from such a loop in fact.

unfortunately the switch, voltage meter and throttle are all part of the same unit. i may just switch to a throttle without any other features on it though since that does work. unfortunately it doesnt seem like both the arduino and this throttle can be used

So the throttle/display/switch is a single unit with 5 terminals (+5v, +60v, switched +60v, signal, ground)?

It might be interesting if you posted a link to the specific throttle and maybe a picture of your setup. May or may not help, who knows.

It seems unusual to me that the noise only occurs when the Arduino is connected. If the display were causing the noise then it would surely be present Arduino or not. Is it possible to just connect the Arduino power as shown in your diagram, but pass the signal straight to the controller? How would the signal look then? Are you measuring the noise with a scope?

arduarn:
So the throttle/display/switch is a single unit with 5 terminals (+5v, +60v, switched +60v, signal, ground)?

It might be interesting if you posted a link to the specific throttle and maybe a picture of your setup. May or may not help, who knows.

here is the throttle, just a generic ebike throttle.. I will take a picture of my set up but it was happening with an RC filter instead of the DAC as well

It seems unusual to me that the noise only occurs when the Arduino is connected. If the display were causing the noise then it would surely be present Arduino or not. Is it possible to just connect the Arduino power as shown in your diagram, but pass the signal straight to the controller? How would the signal look then? Are you measuring the noise with a scope?

yes it seems really weird to me as well that it only happens in one specific case. I don't have a scope. The way I can tell that the signal going out of the arduino is ok was by using some simple code where if the input voltage was above a certain value, then only output a fixed value, otherwise output nothing. When I did this, the motor would only spin at one speed, but it would start and stop randomly even when the throttle wasn't moved at all. it could be caused at the arduino and not actual noise on the line, I honestly am not sure. I'm more of a programmer, I just expected this all to work!

frantik:
When I did this, the motor would only spin at one speed, but it would start and stop randomly even when the throttle wasn't moved at all.

Might actually be a wiring issue

frantik:
I'm more of a programmer, I just expected this all to work!

Lol

Power_Broker:
Might actually be a wiring issue

I will double check though the only possible thing could be some weird combination of two particular connectors that don’t like each other, cause the wiring works fine with other throttles and that throttle without the ardunio

here's pics of the project, though it was showing the same issue when I was using a digital out with PWM and an RC filter.. I thought i was having problems with the RC filter which is why I went with the DAC, but it's the input that is the problem

Thanks for the pictures. I guess in the interest of completeness you should probably post your code too, though I can't imagine what could be in it that could cause the symptoms.

Some further suggestions to try to pin down the problem:

  • Disconnect the motor to eliminate any possible noise generated by it. Maybe you are doing this already?
  • Print out the values read from the throttle sensor to the serial, each on a line, and then use the serial plotter to graph it. You could write a small sketch just to do the analogRead and serial print if necessary. Sometimes visualisation helps.
  • If you have a multimeter it would also be worth measuring the voltage with it too as an independent witness. Obviously if the voltage is rapidly changing the meter will probably just show an average or change too quickly, but that in itself is information.

arduarn:
Thanks for the pictures. I guess in the interest of completeness you should probably post your code too, though I can’t imagine what could be in it that could cause the symptoms.

Some further suggestions to try to pin down the problem:

  • Disconnect the motor to eliminate any possible noise generated by it. Maybe you are doing this already?
  • Print out the values read from the throttle sensor to the serial, each on a line, and then use the serial plotter to graph it. You could write a small sketch just to do the analogRead and serial print if necessary. Sometimes visualisation helps.
  • If you have a multimeter it would also be worth measuring the voltage with it too as an independent witness. Obviously if the voltage is rapidly changing the meter will probably just show an average or change too quickly, but that in itself is information.

if it doesn’t work with the motor connected then it’s kinda pointless :stuck_out_tongue: I don’t have a way to read the serial port without USB and the controller actually sends 4.2v not 5v so I don’t want to mix them. I’m probably just going to either not use the arduino or the voltage meter… I don’t really like the bulky key switch anyways