Help building a scheme (involves L293D H-bridge)

arduinocontrolh-bridgeremote controlschematics

I'm making a bluetooth-controlled fire truck for my son based on an old wire-controlled truck I bought at a yard sale. It didn't have its wire-remote.

I already got Arduino Nano to drive 2 motors using a L293D (wheels forwards-backwards, steering left-right). It is being controlled from my phone via HC-05. Works like a charm.

Here's my problem. There are three wires sticking out that control the truck's siren and water pump. By using a battery pack, I tested different combinations and found two that make the truck do what I want. When I connect battery '+' to purple and '-' to black wire, siren sounds. When I connect battery '+' to purple and '-' to orange wire, water pump works.

My question is, how do I control (switch on and off) these two functions using another L293D? See attached picture. I need to understand which of Outputs 1,2,3,4 should be connected to Purple, Black and Orange and enabled for it to work.

Appreciate your help! It was far easier with the two motors 🙂

enter image description here

Best Answer

You do not need a full H bridge, just a couple of relays.

You can connect the purple wire to your positive power supply, while the other two wires should be connected to the negative via two separate relays. To hook a relay to an arduino just search the web, there literally are dozen of tutorials.

If for some reason you want to use the H bridge you can proceed as follows:

Hook the purple wire to your positive power supply, then power the L293D as usual. As Vcc you do not need a stiff power supply, as if you were powering the motors, you just need the digital Vcc.

Enable 1 and 2 drivers connecting pin 1 to Vcc, then hook the black and orange wires to the outputs (1 and 2). Now you can control your alarm and water pump via in1 and in2, please note that the device will turn on when the input is low, i.e. a digital zero.

When you turn off the devices there is a sim chance of damage since you are putting Vcc on a terminal that is probably meant for ground or high impedance. If you are concerned about this problem please add a protection diode in series, pointing towards the L293D.

See the schematic:

schematic

simulate this circuit – Schematic created using CircuitLab

Please note that I connected pin9 to gnd to disable the 3 and 4 drivers.