Hi All,

I am a complete newbie to the Arduino Uno so forgive me if I come across as a numbty ;-)

I have built a golf trolley using repurposed hoverboard motors using two bldc motor controllers and a manual dual 10k pot. This is working well and now I want to attach an RC to this using the Dual Digital Potentiometer (100K) DFR0520 via an Arduino Uno.

The RC I am using is a cheapo unit (only because it was the smallest I could find) that is a 4-channel unit as follows:

Channel 1 (forward) - Left and right output - +3v to +5v output (I will control speed with button presses i.e. full speed press, unpressed cuts the power so speed will not be incrementally controlled i.e. it is either on or off at a fixed top speed)
Channel 2 (reverse) - Left and right output -3v to -5v output (I will probably not use this as Arduino cannot accept -ve voltages)
Channel 3 (Left) - Left output +3v to _5v and right output -3v to -5v (I will use diodes to filter the -ve voltage to protect the Arduino Uno)
Channel 4 (Right) - Right output +3v to _5v and left output -3v to -5v (I will use diodes to filter the -ve voltage to protect the Arduino Uno)

I will be using the default code for the digital pot I am using i.e. Dual Digital Potentiometer (100K) DFR0520 controlled through the Arduino Uno analog ports. Code is viewable here: https://wiki.dfrobot.com/Dual_Digital_P ... U__DFR0520 under the second article -- "Template Code for MCP42100"

Now this is where I am struggling as a complete novice newbie and need some assistance. I have been through the various options and tutorials and to be honest I am more confused than when I started on what code to insert where to enable the the Arduino analog ports to accept the RC inputs above.

The sample code I am able to sort through and can control the DFR0520 pot without an issue via my PC, so all I need help with is the analog port coding to cut the cord ;-)

Any help with this will be appreciated.

Many thanks,

Ok, I think I have figured out how to filter out the -ve voltages and have gotten this down to around -0.03v so should not cause any issues with the Arduino Uno analogue inputs. I have used a diode on each of the reverse voltage legs. I will just cut the motor at the near 0v range and rely on the other motor to do the turning. Now to figure the code out to drive this further.

With this arrangement before I work out the code, I can by-pass the Arduino Uno for now by just adjusting the 100K rotary pot to match my desired speed and not use the reverse function of the 2nd channel (I am using the soft brake option on the controller here instead).

Hope this helps some of you for now and when I figure the code out I will post more.

Happy New 2021 for you all.