Power Your Microcontroller With a Battery

Introduction

When your projects start to get more complicated and complex, it can be a good idea to run your microcontroller on , instead of powering it with a power cord. This is because a cord is limiting you to have your project close to a computer or power outlet at all times. With a connected you can power your project wherever you are. For convenience, a switch can be added as well.

In this project, you will learn how to connect a 9V as well as an on/off to your microcontroller.

Before continuing this guide it is recommended that you have read or have basic knowledge about and .

Supplies

Circuit

The Arduino circuit created in TinkerCAD
Start by connecting the connector to the battery. From here connect the black cord to ground and the red cord to either the right-most or the left-most pin on the switch (which should sit on a breadboard to make it easier to connect). Now connect the middle pin with another wire to the pin on the Arduino called Vin. When this is done the light on your Arduino should light up, indicating that it has power. If no lights are blinking, try flipping the switch.

The switch on the above circuit picture might look different from the one that you have, but don't worry. It works the same no matter how it looks.

Should you want to remove the breadboard in a future project, it's possible to the wires together, so that no breadboard is needed.

Further Work

Now that you have completed this guide on connecting a battery to your microcontroller, try to power some of the other projects like the or the with a battery.

Articles mentioning this page