reason for no on/off switch on arduino?

My USB port is starting to die on me from plugging/unplugging the USB cable all the time. I was just wondering why there's no power switch on the arduino (or any clones that I've seen) so we could just switch it off and switch it back on after we've rewired something?

I was looking at a USB hub that has power switches for each port which would eliminated this but wasn't sure if it would be harmful in any way? Would this be fine?

There's a lot of those hubs from China.
And switching the power off is like pulling the plug, so i don't see any problem there.

You could always make one ...

Why not pull the USB cable from the arduino instead of from the PC?

Could totally make a USB cable with an inline power switch.
Or, if you want to be really cool....
Wire an ATTiny (DigiSpark, etc...) inline on USB cable & program it to control power on/off. Then you wouldn't even have to reach over and flip the switch! :smiley:

Then program the Arduino to use the ATTiny to shut itself off after running through a new sketch while testing (like a Debug loop? ) —

void debugTestRun()
{
     Serial.println("Test run complete");
     Serial.println("Goodnight!");
     shutDownUSB();
}

Or, control it from the PC side.

I like it! I may have to try this
....maybe worthy of a Kickstarter?
Arduino-controlled USB cable. Could even build it into a tiny USB Gender-changer like box.
Hmmmm.....
:grin:

thanks for the reply's 8)

I think I'll go the simple route and order the USB hub with individual power switches, and in the mean time I'll switch USB cables from my other port (only two are available for my laptop). It's weird that it's not really a feature on any arduino boards though.

cheers,

Make a circuit to do it for you, that way you wont wear out the switch...

could be something as simple as a Flip Flop and a Transistor or even a 555 timer! (providing you don't require > 200ma for the MCU)

I was just wondering why there's no power switch on the arduino (or any clones that I've seen) so we could just switch it off and switch it back on after we've rewired something?

Why do you need to turn it off and on? Why can't you just press the reset button on the Arduino?

Don't know for certain, but based on what I've read about the overall design philosophy -- it's made to be easy for non-programmers and non-engineers to use -- adding a switch would require an extra step in a noob's startup process. I can imagine a beginner's thought process being something like this: "So, if I plug it in, will it work or not? Oh, I forgot... I have to turn the thing on, too..." It's an unnecessary extra step; a beginner's cognitive load is very high at the start, and adding a switch would increase it. Physically, too, there is the problem of where to put the switch: it has to be on the side, facing out from an edge because it can't be covered by a shield.

Why do you need to turn it off and on?

Because you can't ( should not ) wire things up to a powered board. It's on of the best ways to kill it.

MLeBlanc:
Don't know for certain, but based on what I've read about the overall design philosophy -- it's made to be easy for non-programmers and non-engineers to use -- adding a switch would require an extra step in a noob's startup process. I can imagine a beginner's thought process being something like this: "So, if I plug it in, will it work or not? Oh, I forgot... I have to turn the thing on, too..." It's an unnecessary extra step; a beginner's cognitive load is very high at the start, and adding a switch would increase it.

I thought I was a cynic, but I'll give them more credit than that, especially with a power LED.

I think it's more that you can't really do it. There's five or six places where the voltage can go into an Arduino and no single place where you could put a switch.

(USB connector, power jack, RAW pin, 5V pin, ISP connector ... second ISP connector on R3 ... did I miss any?)

To any one reading this discussion:

ALWAYS use a powered USB hub. You are doing electronic experiments. To err is human. We all generate naughty voltages and short cuicuits on occasion. Smoke up your 20$ hub or your 30-40$ Arduino rather than your laptop.

I think a powered hub is certainly the wisest choice in the development stage, but I have asked myself the same question. I have finished projects in enclosures that use a wall wart and the DC jack. No simple way to turn it off except unplug it, which may wear out the jack over time. But given the myriad ways to connect power there may not be a single easy solution. In my case I may need to have a separate jack on the enclosure that goes to a switch to a plug inside the enclosure. Extra steps and cost, but perhaps that is the only way...

The USB specification requires something like a polyfuse on all ports. The occasional short circuit shouldn't be a problem.

"Naughty voltages" are another matter...

I use naughty voltages all the time!

Experience does make you double-check everything before applying power though. That really means check twice,
once as you go and then again when you think its all wired-up.
The hope is that your brain is functioning during at least one of the checks!

MarkT:
I use naughty voltages all the time!

Really? Which ones exactly?

The boards I like using most have a jumper on them to switch between USB and regulator. It's real easy jut to pull it off to power down. Sometimes you can make things too easy and you loose a little versatility in the process.

atypicalresearchlabs:
... I have finished projects in enclosures that use a wall wart and the DC jack. No simple way to turn it off except unplug it, which may wear out the jack over time. ...

How about splicing an inline switch (such as a rotary one) into the lead from the wall wart? Works for me :slight_smile:

you have to handle naughty voltages with care.

extreme caution !

as for the switch. with multiple power input sources, it seems that the additional circuits for a single cut off, or multiple off switches becomes unwieldy.

also, the cost of switches becomes high. and reliability in mechanical things in miniature, is low.

Get one of these:

7015.jpg

A jumper placed at the right point in the circuit would cost $0.03. Probably less in the quantities they make Arduinos.