Maker Pro
Maker Pro

Help:Replace manual switch with mcu controlled device.

I have a mobility scooter that I am trying to make into a simple ROV. The unit has a drive-controller that has an Enable input. On the tiller, is a key-switch that applies the battery voltage to the Enable input - ie it turns on the scooter. See Figure 1.

Anyway, the idea is to replace the SPST switch with something electronic that can be controlled with a 5V digital level from a micro-controller.

The scooter drive controller runs off a 24V battery. That voltage (and not some fraction of it) must be applied to the Enable input.

Note that I put an ammeter in series with the switch and there is NO CURRENT when the switch closes - even at 200uA scale.

I tried several circuits. If you're think of using a transistor, note that you must provide 24V to the Enable input.
Thanks.
 

Attachments

  • EnableSwitch.jpg
    EnableSwitch.jpg
    5.3 KB · Views: 177

Harald Kapp

Moderator
Moderator
You could use a small relay with a 5V coil or a photomos relay (that's a trade name, other manufacturers have similar components.
Even a simple optocoupler like the cny17 could do the job, as you say there is almost no current involved. The last suggestion is probably the easiest way.

Harald
 
You could use a small relay with a 5V coil or a photomos relay (that's a trade name, other manufacturers have similar components.
Even a simple optocoupler like the cny17 could do the job, as you say there is almost no current involved. The last suggestion is probably the easiest way.

Harald
Yes, I guess I'll try the opto-coupler. The problem is with the voltage drop from the collector to the base. If that's significant, it will likely not work. I think the Enable input voltage must closely track the battery voltage. The manufacturer simply documents the drive controller as a black box with very little explanation. It likely has an embedded micro-controller.

I have tried resistors and transistors in place of the switch, and had success only with a transistor that has its base and collector tied to the 24V supply and emitter tied to the Enable input - with no control capability, of course.
 

Harald Kapp

Moderator
Moderator
The problem is with the voltage drop from the collector to the base
I'm sure you mean from collector to emitter. That is les than 1V. If the enable input of the controller is constructed in any sensible way, it will tolerate that (and much more).

Harald
 
Harald,

I was just questioning his two statements.

1. The input draws not current.
2. Connecting it through a resistor does not work.

What I was headed for, was to verify the connecting it through a resistor does work , then use an NPN to pull it down to turn off, controlled by the microcontroller.

Bob
 
If it draws no current, a resistor must work! What value were you using?



Bob
Thank goodness for questions. Yours prompted me to go back and check again.

My mistake, fellows. Proper connections for the meter made a difference. There IS current. With the switch closed and only an ammeter in series, the current flows at 10.10 mA. The supply voltage is nominally 24V. That gives an internal resistance of about 2.38K ohms.

I put a trimpot in series with the closed switch and ammeter, and the minimum current is 9.80ma in order to avoid the drive-controller from resetting. Once it resets, the switch must be opened for a period of time. I haven't sat down to determine what that delay must be.

For the 9.80 mA, the trimpot resistance was 710 ohms. Then 24V over 710+2.38K ohms = 7.77 mA. This value is low by a significant 2 mA compared to the observed value but that may have to do with something internal to the drive control.

So... how to replace the switch? I think the opt-coupler is good. But note that the mcu will take power from the scooter's own 24V via a 5V regulator.
 
Last edited:

Harald Kapp

Moderator
Moderator
The optocoupler's primary side (LED) is happy to be driven from 5V using a suitable series resistor.
Using an open drain driver (NPN transistor) you also drive the LED from 24 V).
 
The optocoupler's primary side (LED) is happy to be driven from 5V using a suitable series resistor.
Using an open drain driver (NPN transistor) you also drive the LED from 24 V).
Well...after blowing several DMM fuses (you must disconnect before switching scales). I found a solution that should work. See the Figure 4 (attached).
Since my town is short of all basic opto-couplers, I tried an on-hand H21A1. This has an open air gap between the input diode and output transistor that I closed off with black tape. Once the shipment of opto-couplers arrive, I'll try the circuit again.

What about protection to the Arduino output pin; what is needed?

The nice part about the opto-coupler is that I don't have to worry about sending 24V into the Arduino. The two voltage supplies are separate. So It looks like I'll be using more of them.
 

Attachments

  • EnableSwitch2.jpg
    EnableSwitch2.jpg
    17.9 KB · Views: 125
Top