Toggle Switch ENERGY consuming ?

Hi , quick question, having a toggle switch ( i.e. with a lever) wired to arduino, when the switch its' OFF it is an open circuit , but when the switch is on we got current and voltage passing by.

Is the energy consumption of the switch high ? I have the arduino connected to a battery and i want the battery to last longer , should i just use a normal button instead of the switch ?

So long as the switch contacts are clean, the energy dissipated by the actual switch will be so negligable as to be practically unmeasurable. With the switch close you have effectively just another wire.

For almost any practical purpose a close mechanical switch can be considered to use no energy.

A switch with dirty contacts however will high higher resistance and that would lead to some power being lost as heat, but its likely that your electronics would fail to register the switch and your code stop working properly long before the energy lost became significant

G7MRV:
So long as the switch contacts are clean, the energy dissipated by the actual switch will be so negligable as to be practically unmeasurable. With the switch close you have effectively just another wire.

For almost any practical purpose a close mechanical switch can be considered to use no energy.

A switch with dirty contacts however will high higher resistance and that would lead to some power being lost as heat, but its likely that your electronics would fail to register the switch and your code stop working properly long before the energy lost became significant

If you question this, try oiling your switch.

Paul

sandorrrh:
but when the switch is on we got current and voltage passing by.

Just to clarify, voltage doesn't pass by: it's the pressure which causes the current, and would be across the switch even when it's open. And current is the passing by of charge.

sandorrrh:
Is the energy consumption of the switch high ?

Easiest way to check the possible energy consumption is to measure the resistance across the closed. It should be zero, or at least so low your meter probably won't register; just like wire as previously mentioned.

Well, what are you doing with the switch?

If you're using it to directly switch something - yeah, the switch doesn't use any energy unless it is severely undersized for the load or something.

If you're using it as an input to an Arduino pin, so the Arduino would be reading the state of the switch, then you'd need a pullup resistor to keep it in a known state when the switch was open, so when the switch was closed, a small amount of current will flow through this pullup resistor, through the closed switch to ground. The current can be calculated by ohm's law.

G7MRV:
So long as the switch contacts are clean, the energy dissipated by the actual switch will be so negligable as to be practically unmeasurable. With the switch close you have effectively just another wire.

For almost any practical purpose a close mechanical switch can be considered to use no energy.

A switch with dirty contacts however will high higher resistance and that would lead to some power being lost as heat, but its likely that your electronics would fail to register the switch and your code stop working properly long before the energy lost became significant

I highly recommend not answering questions if you don't know what you're talking about and are incapable of basic reasoning. I'm usually not this much of a dick, but your entire post contains literally nothing worth reading and is just wrong.

While it is true that an ideal switch will never dissipate power (since it will either have infinite resistance and pass no current, or 0 resistance and drop no voltage), that is an irrelevant fact. Given that OP is concerned about a battery powered circuit, the important metric to be concerned about is the delta of current consumption of the whole system when the switch state changes. And actuating the switch really does make a difference to that.

SPST switches used as inputs to a digital circuit require a pullup (or pulldown) resistor, and that will have current drawn through it when the switch is closed. Selecting the right resistor value becomes a balancing act between noise rejection (smaller is better) and lowering power consumption (higher is better).

So now to helping the OP:

The internal pullups in the Arduino Uno are between 40k-60k. Worst case, each switch will pull out 125 uA of current when closed. This might not seem like a lot, but considering that the processor itself can easily get down to single-digit microamps or less by using sleep modes it's quite significant if you're trying to conserve power. If you have several switches that are going to be closed for long periods of time, those few hundred extra microamps can blow your power budget right out of the water depending on how stingy you want to be.

There are other options. You can reduce the frequency of reading the switch. Human reaction time is extraordinarily slow by the standards of a microprocessor, even a low-end one like an Uno. For inputs that are part of a human interface, as long as you respond within 100 ms (an eternity in microprocessor-land) a human will perceive that as instantaneous. You can do something like only checking the switch every 5 ms and keeping the pullup resistor disconnected when you aren't reading the switch. That way even if the switch is held closed, it draws no power when you aren't reading it.

However, all this is academic so far. Have you calculated your power budget? What type of battery are you using? What is the voltage and capacity? Are you using any voltage regulators? What amount of lifetime are you trying to achieve? What other parts of your system are using power from the battery, and how much?

Until you have a proper power budget, you're just flailing around in the dark. If you don't know how much power is being using in what parts of the system, you end up being "penny wise, but pound foolish". If you do something stupid like dump 20 mA into a "power on" indication LED, there's not much point fussing about a few hundred microamps somewhere else. Always address the biggest problems first. If you don't know which component is your biggest problem, then that's a problem in and of itself.

should i just use a normal button instead of the switch ?

Switches and buttons are all fundamentally the same, just two pieces of metal that are pressed together (NO) or separated (NC) when the switch is actuated. The type of actuator (button or level or something else) doesn't really matter.

DrAzzy:
Well, what are you doing with the switch?

If you're using it to directly switch something - yeah, the switch doesn't use any energy unless it is severely undersized for the load or something.

If you're using it as an input to an Arduino pin, so the Arduino would be reading the state of the switch, then you'd need a pullup resistor to keep it in a known state when the switch was open, so when the switch was closed, a small amount of current will flow through this pullup resistor, through the closed switch to ground. The current can be calculated by ohm's law.

Absolutely correct,

In this case, although current flows through the switch, it is not the switch itself that consumes power, but the pull-up resistor (I2R=P that is, the square of the current multiplied by the resistance equals the power consumed, so if you assume a 40k pull up at 5v, the current is 125uA, so the power is 625 microwatts)

It is true that most things you connect to your Arduino will consume some power, ie resistors, any active devices etc. But so long as they are in good condition wires and switches/buttons do not. The power used to sense the switch is used by the pull-ups.

It would be interesting OP to know what your applications is? Bear in mind that if your project is seriously limited for available power, such as by very low capacity batteries like tiny button cells, or even energy harvesting systems, that the power dissipated by the processor itself could become significant, and is dependent on the number of instructions being processed (a tiny slow program consumes far less power than a complex, fast and hungry number cruncher!)

It would be nice to know a little also about you and your experience, so its easier to pitch answers to you at a level your comfortable with

Cheers
Martin

Thanks to you all!

I got a lot of information here. It sure clarifies what to do and what to know.

The switches/buttons that i use are connected to arduino pins yes.

Hi Sandorrrh,

Im guessing that your very new to electronics in general?

It can be a steep learning curve, but the basics dont take too long to grasp.

I started age 10 with a copy of a book called 'Getting Started In Electronics' by Forrest M. Mimms III ! That was over a third of a century ago! I still have a copy of that book!

Never be afraid to ask a question! Ive spent two thirds of my working life in RF electronics, and a third in Military Ordnance, and its still right back to school for me learning to write code for the Arduino!

We all started somewhere!