DS3502 controlling a speed of a small gocart

I have a "pedal" that controlls the speed of a gocart. If i push it the motor goes faster if i release it the motor goes to 0 rpm.

I figured out that if i put a analog potentiometer on the "green wire" coming from the pedal going to the speed controller i can adjust how much total speed the gocart needs to have. The voltage of it is 0.5 V when the pedal is not pressed and 2.5 v when fully pressed.

So now I wanted to controll the potentiometer digitally with the ds3502 on a raspberry pi. So i wired it up like this https://cdn-learn.adafruit.com/assets/assets/000/078/833/original/adafruit_products_rpi_fritz.png

  • Pi 3V3 to sensor VIN
  • Pi GND to sensor GND
  • Pi SCL to sensor SCL
  • Pi SDA to sensor SDA

I followed the tutorial and all works fine, the software works, and the wiper changes the voltage just fine.

But now i want to connect the green pedal wire to it. I tried all combinations of it between RL/RH/RW and the only that kinda works is connecting it to RL and RW. But then i realized even then the ds3502.wiper is set to 127 the motor only goes like 60% of its total power. I don't understand why?

Here is a video of the setup: Dropbox - WhatsApp Video 2020-10-20 at 17.47.42.mp4 - Simplify your life

I assume that the problem is that the ground from the gocart pedal needs to connect to the ground of the raspberry too? But why does it matter? It works just fine with the analogue potentiometer. I am puzzled and need your help. I tried googling all sorts of things but I don't know what to look for.

First backup a few steps. Lets talk about the infamous green wire :slight_smile:
When you measured the voltage from where to where are you measuring your cited voltage?

Second look at the Maxim datasheet of the DS3502 you will see a simplified diagram on page 6.

You will have to connect:

  1. RH to the incoming green wire
  2. RW to the outgoing green wire
  3. RL to the circuit common of the green wire.

This still may work or maybe work only marginally. This is because we don't know the resistance of the circuit providing the voltage of the green wire. Nor do we know the resistance of the circuit receiving voltage from the green wire.

BTW sounds like a neat project

I've been planing to cut the green wire so I measured the voltage on the green wire before the analog potentiometer and after it:

---greeen ----(a)----(analogue potentiometer)------(b)----green-----

So between (a) and (b).

So if i understand correctly I should now figure out from these cables which one is the "ground" one (probably the black one) (how do I know its the ground?) and connect it to RL and Point (a) to RH and Point (b) to RW?

Should I measure the resitance of the circuite on the green wire? I would to that by connecting (a) and (b) together without a potentiometer in between and measure the resistance between (a) and (b)?

Btw. here is a schematic of the whole cart if that helps: