Tymtravler
USA
Asked
— Edited
I have a flash light that uses a 9v battery. I want to be able to have the EZ-B turn the flash light on when the sonar picks up something. Anyone try this yet?
I have not, but I think you could use a switch like what @Rich created in this Transistor Switch Tutorial.
I believe you could run the positive from the 9V to the switch and run the signal and ground out of the EZ-B without any issues.
I was about to say the same thing but I'm not 100% sure if it matters that the voltage to the base of the TIP120 is from a different source. I guess that provided it's common ground it'll be good to go.
@Tymtravler, @Rich and @McJeff0125 are correct. Transistor switches are great for controlling large current or high voltage devices like motors, relays or lamps using a low voltage input signal as long as the ground remains common between them. An output from the EZ-B is only +5v but the device to be controlled may require a 12 or even 24 volts supply. Or the load such as a DC Motor may need to have its speed controlled using a series of pulses (Pulse Width Modulation). Transistor switches allow us to do this faster and more easily than with conventional mechanical switches.
The diagram in @Rich's post mentions the common ground between the external power source and microcontroller.
Transistor Switch Tutorial