Connect with us

Help:Replace manual switch with mcu controlled device.

Discussion in 'General Electronics Discussion' started by louarnold, Dec 5, 2012.

Scroll to continue with content
  1. louarnold

    louarnold

    14
    0
    Dec 5, 2012
    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.
     

    Attached Files:

  2. Harald Kapp

    Harald Kapp Moderator Moderator

    10,797
    2,435
    Nov 17, 2011
    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
     
  3. louarnold

    louarnold

    14
    0
    Dec 5, 2012
    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.
     
  4. BobK

    BobK

    7,682
    1,686
    Jan 5, 2010
    If it draws no current, a resistor must work! What value were you using?



    Bob
     
  5. Harald Kapp

    Harald Kapp Moderator Moderator

    10,797
    2,435
    Nov 17, 2011
    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
     
  6. Harald Kapp

    Harald Kapp Moderator Moderator

    10,797
    2,435
    Nov 17, 2011
    @Bob: how would you control a resistor via a microcontroller? He wants the enable input to be switched by a µC.

    Harald
     
  7. BobK

    BobK

    7,682
    1,686
    Jan 5, 2010
    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
     
  8. Harald Kapp

    Harald Kapp Moderator Moderator

    10,797
    2,435
    Nov 17, 2011
    Bob,
    I beg your pardon, I overlooked that statement. You're, of course, right.

    Harald
     
  9. louarnold

    louarnold

    14
    0
    Dec 5, 2012
    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: Dec 7, 2012
  10. Harald Kapp

    Harald Kapp Moderator Moderator

    10,797
    2,435
    Nov 17, 2011
    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).
     
  11. louarnold

    louarnold

    14
    0
    Dec 5, 2012
    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.
     

    Attached Files:

Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-