Maker Pro
Maker Pro

Two analog inputs to 1 output (+logic)

Sorry in advance, I'm not familiar with a lot of the electronics terminlogy. I haven't even known what to search for...

I have 2 analog inputs (0-5v). Lets call one gopedal and the other killswitch. The analog output is going to a motor controller. So what I want is for the gopedal value to go through to the motor controller *unless* the killswitch is pressed. If the killswitch is pressed, I want it to send 0v to tell the controller to stop spinning the motor.

Sadly the motor controller doesn't have inputs/logic to do this itself. I'm lost in the electronics world. Can you help me with what is required?

Thanks
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
The kill switch can control an analog multiplexer which either allows the analog "go" voltage through or selects 0V.

A simple version might be a series resistor to limit the current from your "go" voltage and a MOSFET which shorts output when the kill signal is asserted.
 
Thanks, I think that's helped set me on the right path. I've been off reading about multiplexers (yep, i'm that noob).

So, if I had, say a 4 to 1 multiplexer, i could set the logic so that if something is detected on the killswitch input, then select say input 3 which is empty and would be 0v?
 

Harald Kapp

Moderator
Moderator
It could be as easy as this:
upload_2017-3-17_7-39-19.png
Provided the input impedance (resistance) of the motorcontroller is high (a few kΩ) and the series resistor shown above is small in comparison (e.g. < 1/20 of the controller's input resistance).
When the killswitch is open, the input voltage is fed to the controller, onlöy slightly attenuated as teh input resistance of the controller and the series resistance above form a voltage divider.
When the killswitch is closed, the input to the motorcontroller is 0 V. The current from the GoPedal is limited by the series resistor to an uncritical value.

The value for the resistor depends on both the input impedance of teh controller and the max. output current of theGoPedal. For a maximum output value Imax of the GoPedal calculate R as R= 5V/Imax. Then check the result against the input resistance of the controller. To avoid unnecessary atennuation the input resistance of teh controller should be at least 20*R (an estimation). If it is lower, check the bavior of the setup at max. GoPedal position.
 

Harald Kapp

Moderator
Moderator
An even better solution, without the potentially problematic series resistor:

upload_2017-3-17_13-49-36.png

Use a SPDT (Singe Pole Double Throw) kill switch. In the upper position (kill switch inactive as shown) the output from the pedal goes directly to the controller.
In the lower position (kill switch active, position not shown) the input of the motor controller is connected to common (0 V).
The resistor here serves a purpose only during switching when the upper contact has opened and the lower contact has not yet closed. During that brief period (typically a few milliseconds) the input to the motor controller is floating as it is connected neither to the pedal nor to common. The resistor forces a defined low potential in that case.
 
Is "killswitch" a signal coming from a circuit, or a physical switch? If it is a switch, how many pins does it have?

Is "gopedal" a signal that can be any voltage between 0 V and 5 V, or is it more like a logic signal with only high and low values?

ak
 
Top