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?
Upgrade to ARC Pro
Harnessing the power of ARC Pro, your robot can be more than just a simple automated machine.
Based on your post activity, we found some content that may be interesting to you. Explore these other tutorials and community conversations.
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.
@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