hi im making a project and since i dont want to be constantly draining the battery and plugging it in and out of the board i want to use a 3 pin 3 prong toggle switch to turn the board on/off.
its a 9v battery and battery clip connected to the toggle switch, the battery and board wires share a common GND on the switch. im then using wires to connect the switches ground and accessory to the GND and Vin pins in the power section of the board.
I should then be able to turn the board on/off with the switch. ive tested it out and it seems to work.
my question however is whether or not this is a good idea? i dont want to accidentally hurt the board somehow by doing this?
i would be grateful for some advice
I have no idea what that is, but since you write that you have already wired it up and it works, why the question? Just use it as you wired it.
its just a toggle switch really. Fair point, honestly im just scared ill break something but ill just continue as is then. Thanks!
Really! What is the worst that could happen?
Whereas it might indeed work as it is, there are a number of concerns about your description so far!
You describe connecting the ground to the switch. If that is simply a convenient place to join wires, I suppose that is OK, but it is a bit odd.
You refer to a "9 V battery". We frequently see people using a "PP3" to power an Arduino system.
This is a very bad idea as even the alkaline versions have a quite limited capacity.
If you must use a 9 V supply (unwise for a start) then a battery carrier of six alkaline "AA" cells is far more sensible. Now using "Vin" or the "barrel jack" of a UNO is bad because the on-board regulator can supply only the UNO itself and little else in practice.
But the Arduino actually operates on 5 V, so wasting another 4 V in a regulator - almost half of the power - is quite silly. Also, for a UNO or Nano (more practical form factor), you are wasting battery power in the USB interface.
A Pro Mini has only the ATmega chip to use power (and you can disable the "pilot LED" and remove the regulator, allowing it to use very little power indeed if put in "sleep" mode). It will operate on 4.5 V supplied directly from three "AA" cells. You do need a USB adapter to program it - but of course you then only need one such adapter for multiple projects.
Sadly, tutorials often recommend the most impractical approaches, a UNO rather than a Nano or Pro Mini, powering with a battery and a smoke alarm battery at that, and using "Vin" or the "barrel jack".
It will be just fine. You get a fairly clean power on and power off cycle with a switch, plugging and unplugging wall warts etc does not.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.