0
\$\begingroup\$

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

\$\endgroup\$

2 Answers 2

2
\$\begingroup\$

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.

\$\endgroup\$
1
\$\begingroup\$

It is not practical to control non-motor devices (example:siren & pump) using H-bridge IC. For simpler solution, you can use a simple transistor circuit that work as a switch.

But if for a specific reason you want to control the non-motor devices using H-bridge, you can use this circuit: H-brigde as a switch Note:

  • original picture from here
  • siren = motor 1 (forward/backward), pump = motor 2 (left/right)
  • Diode: 1N4001/1N4002, maximum load 600 mA for L293D

With this circuit:

  • Forward: siren ON, backward: siren OFF.
  • Left: Pump ON, right: Pump OFF (or vice versa).
\$\endgroup\$
6
  • \$\begingroup\$ Why do you say it's not practical? \$\endgroup\$ Aug 23, 2015 at 10:37
  • \$\begingroup\$ @Vladimir Cravero, I mean "not efficient". Consider editing? Sorry for my bad english. We can connect 'the pin that originally connected to the input H-bridge' to simple transistor switch. \$\endgroup\$
    – Oka
    Aug 23, 2015 at 10:43
  • \$\begingroup\$ Your english is not a problem at all, but 'practical' and 'efficient' mean two very different things. I'd ask why is it less efficient then? I believe it may actually be more efficient. Just forget word definitions and expand your idea. \$\endgroup\$ Aug 23, 2015 at 10:44
  • \$\begingroup\$ Instead of using L293D + 4 diode (+flyback diode), I think it is more efficient (price, power) if we use 2 NPN transistor + 2 resistor (+flyback diode). \$\endgroup\$
    – Oka
    Aug 23, 2015 at 10:51
  • \$\begingroup\$ FYI, the pump is a normal electric motor, and the siren is coupled with a number of small light bulbs (not LEDs), so driving them through an H-bridge is very much justified. Also, thank you for your help, I'll test with both above circuits. \$\endgroup\$ Aug 24, 2015 at 9:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.