Electronic – arduino – How to use an Arduino to turn a supply voltage to another device on and off

arduinocircuits

The Question:
With what kind of extra components if needed, can I use to output a signal out of one of the Arduino pins to turn the voltage on and off to a device. The goal is to output a HIGH or LOW on a certain OUTPUT PIN to turn this device on and off.

The Limitations:
I can't power this device with a pin from Arduino directly(I think..). Trying to find a simple solution, I don't have access to too many intricate parts, other than a NAND gate and a bunch of resistors and capacitors.

The Solutions??:
I can get my hands on some additional components such as relays or if there is some sort of a voltage control switch with a transistor I can be setting up here to turn a 5 Volt supply on an off, if the max current I can deliver from my arduino pin is 40 mA, how would I go about setting up that circuit if thats a possible solution? Help much appreciated!

extra details:
https://www.walmart.ca/en/ip/laser-x-2-player-blasters/6000196696362
The device I am trying to turn on and off, if a certain OUTPUT pin on my Arduino is set to LOW.

Best Answer

As @dandavis said, a MOSFET as a switch would be the easiest solution. In your case, go for the P-Channel mosfet (explained in the guide under P-channel MOSFET Switch). That way you can get output 0 Volt with arduino pin HIGH and a 5V output when pin is LOW. Since MOSFET would be voltage driven you do not need to worry. If you have further questions check this guide.