strange behaviour from optocoupler

Good people,

I am trying to take control over a trolley. The set up is quite simple. It is controlled today from a switch/pot. Once the switch is on, 12 volts are connected to another cable I suspect is the power supply to the uC in the trolley. The pot then sets the speed. I have left the current set up as is, and override this by using an optocoupler (for the switch) and a digital pot connected to the arduino.

the problem is that the trolley starts rolling once I activate the optocoupler (4N35) is activated, even when the sweep cable is connected to ground on the physical pot.

I should probably admit to a little accident when I first connected the stuff, shorting the 12v switch cable to the common ground. But the trolley still seems to work fine with the manual controls from the potmeter.

xbee--arduino--4n35--switch cables |__ digital pot--diode--physical pot cables

Thanks in advance for any enlightenment...

Joachim

Thanks in advance for any schematic

Well ok then...

It is messy to say the least, but the problem lies in the opto acting as a switch. If I just connect the two switch cables, the trolley is still. But If I connect them through the opto, the trolley starts to move slowly, even though the pot is not connected to the arduino and the physical pot is in the zero position.

I'm lost

Joachim

I have now come to the suspicion that the issue has something to do with the optocoupler's ability to sink current. If I send 10 mA in, I will not be able to sink more than 10mA? I am trying to figure a way to connect an npn to the optocoupler, but I don't want to share the ground. How would you connect these?

Joachim