Controlling throttle signal wire on Chinese E-bike Speed Controller

Hi,

I'm building a large Zoetrope. 18 wooden artists mannequins are set around a 1.2 meter diameter disc. These get animated as the disc turns, and strobe lighting kicks in.

I'm hoping it ends up as a permanent build, to be started and stopped many times a day, running for a minute each time, over the course of years.

I have the lighting side under control, with magnets set on the disc under each mannequin, a reed switch that triggers for each 'frame', going to arduino, mosfet and LED white tape, with delayMicroseconds to adjust the pulse time of the strobing.

It's the control of the motor that I need some help with, a little bit of advice on...

The disc will be heavy-ish. So I bought this Chinese e-bike hub motor, with a speed controller and a thumb throttle, which apparently are everywhere in China (and can take the load of a heavy Westerner!)

http://www.petrolscooter.co.uk/front-wheel-e-bike-hub-motor-with-speed-controller-24v-250w.html

(That's about as much documentation as comes with it! lol)

The idea was: once the zoetrope was built, the disc and mannequins all in place, to set the final speed by physically fixing the thumb throttle at the desired position; then, to turn it on and off for one minute, at that set speed, using a relay at the power supply end. (I'm using a 24v 360w LED power supply instead of batteries).

However, I found that there's a safety feature with these controllers: you have to bring the throttle back down to the 'off' position, before you can get the motor going again. (I guess it's to prevent a situation where the thumb throttle is jammed, or the spring on it broken, where you go to fix a loose connection on the battery at the back of your bike and then find the bike runs away from you ..??)

So that was my idea of stopping and starting the thing, through powering on and off, out the window.

Next, I took the thumb throttle apart, and found that it works with a hall-effect sensor. Three wires go to the hall sensor: a supply of about 4.6V, a ground wire, and the signal wire.

The signal wire ranges from 0.8V when the throttle is in the 'off' position, to 3.6V when in the fully on position. The signal operates at about 20mA.

Basic making and breaking of this wire allows me to turn the motor on and off when the motor and power supply have power, and for the motor to turn on at the speed that I have pre-set with the thumb throttle. I'm back in business .. .I think...

So, I'm basically down to: how to switch this signal wire through the arduino, so that both the lighting and the motor can be controlled from the same arduino sketch.

I've tried using:

i) a N435 optocoupler.

and

ii) a standard electromagnetic relay rated for far heavier loads.

Both work, and work well. When I apply 5v to these, they get the motor running at the desired speed.

The output signal from the emitter of the optocoupler is near enough identical to the input at the collector, and this holds for all positions at the thumb throttle (0.8-3.6V)

I haven't tested the output on the relay (simply assuming that it becomes again one and the same 'wire' when the contacts are closed.)

However, during testing, every time I hear the relay click, and re-read the data sheet for the relay, I realise that there are only so many operations left on it! Am I likely to come anywhere near the electrical life limits of this relay (100,000) with such a light 'load'?

If both of these work well, is there a better of the two? (I'm sure of course there's an even better way, but I don't know about it because I'm not very experienced with any of this!)

I guess the very short question to my very long winded description is:

What's the most reliable way to make/break an (external) signal wire that runs 0.8v-3.6v at 20mA: an optocoupler with a 330ohm resistor in series, or mechanically switched with a suitable relay?

The optocoupler is here:

And the relay is here:

(This came in a module with flyback diode from Ciseco).

Thanks, if you are still reading this long-winded post ... But any help much appreciated.

There is no "best way". Whatever works for your application should be used.

That life limit for the relay is when it's switching its maximum load under the most arduous temperature and humidity conditions specified in the datasheet. Then large numbers of relays are tested to many times that, to make sure that there are only a tiny percentage of failed relays coming back for warranty claims. Switching a 5v logic signal at low current is no work at all for the relay. Once a minute for several years is no problem.

Even optocouplers wear out. Specifying an optocoupler for reliable operation some years from now is actually more complex than you think.

Thanks for that, MorganS.

Nah ... I've been trying to get my head around Current Transfer Ratios and what, so definitely not underestimating what an optocoupler involves.

But I guess I didn't really understand what's involved in those life expectancy tests for relays.

Guess the relay is the cleanest solution, and relatively easy to identify a failure with. Was just wondering if there was any problem running too low a load on them, e.g. if there's not enough to keep contacts clean.

Think it's time to suck it and see. Relay it is.

Thanks again for your thoughts.

The normal throttle potentiometer is 4k7 or 5k with current sensing in the
ground and supply leads to detect open and short circuit and other error states.
This is why you see about 0.5V and 4.5V at its ends, there are small resistors on
the controller in series with it to sense the current.

The simplest way to handle one programmatically is provide a 4k7 or 5k resistor
in place of the pot and drive the signal that was connected to the wiper directly,
since that takes negligible current and is purely voltage sensing. An RC low-pass
filter from a PWM output would do it.

Worth trying this as a test:

Connect a 5k resistor in place of the throttle pot. Connect the original
pot between 0V and 5V and keep its wiper wired as before. Now you have
a throttle pot (which doesn't need to be 5k) without the safety features.

If that works you should be able drive the wiper signal from PWM / RC-low-pass
instead.

All assuming the controller 0V is the same as Arduino 0V.

Cheers Mark,

I thought I could just set the thumb throttle into position once in the final build, then have power applied to the motor as part of the sketch.

Visitor approaches:
Presses button.
Surround lights go down.
Motor comes on.
Disc turns.
Reed switch go high.
Strobe for every frame.
Then, one minute later:
Every powers down,

all through arduino.

However, with these chinese e-bike controllers, things are a bit different.

They will not get the motor running from just a simple power up.

There must be something in the sub-routine written to the CPU, that wants to see zero-throttle before it gives anything else.

And yes, I expected to find a variable pot in the thumb throttle, but its def hall sensor based.

In short, I can get this thing working to suit by powering up the motor with the throttle signal wire disconnected, effectively reading 0Volts, then apply any voltage/speed I want (to suit the final animation), and hopefully it'll work at that speed always.

That's all I wanted. Was just stressing about how to switch that signal after the power up, after the controller has read a 0V (or really a 1.8V) - either using relay or optocoupler.

The relay is now clicking away; and I'm hoping, that it'll hold for something approaching it's mechanical as opposed to electrical life as given on the data sheet... lol.