empowering creative people

Videos / How to Conserve Battery Life with IoT Projects

If you’ve ever created a project that uses batteries, you’ll be well aware how hard it can be to decide on elements in the project which can affect the battery life.

Search Videos

Related Content



Hey Guys, how are you going? Sam here from Core Electronics and today I'm going to be running through some tips and tricks I picked up along the way on how to conserve power in your battery-powered IOT projects. So if you've ever put together a project that relies on batteries or even one where you've got a limited power available then you know that it's all about conserving the juice, when you want to use, when you need to use lots of power versus when you don't and so I've put together four main points that I think everyone can follow for their projects to look at getting the most life out of their batteries and from their projects.

So first up and it might seem a bit obvious a few of these but there's there's a bit more depth than you may realize depending on your platform, first up is using sleep modes so I was just using particle gear for a project I'm about to provide on this site and it's basically I'm monitoring the soil moisture content from I'm using a Particle Photon and it's battery powered so it runs off a 2,400 milliamp hour lipo battery and the idea is that it uses sleep modes really well and I talked about using duty cycle sensing a little bit later on but using the sleep modes is a big energy saver when you don't need it to be constantly running so I'll use the particle IDE as an example but sleep mode can be found on any device any micro controller will have Hardware sleep modes that you can engage with and there's three particular different styles of sleeping available for the particle gear now which is sleep which has decent power savings that drops it from in fact there's a chart here, where is the milliamp s It drops it down from 80 to 100 milliamps and then the sleep current drops to one or two milliamps big savings huge savings then you've got deep sleep which puts that down again by, by at least another another decimal place so you're almost dividing by 10 your power consumption so in deep sleep the operating currents between 80 and 100 microamps a huge gains to be to be had and then the stop mode which of course is the one maybe not of course but what it does is it freezes the clock of the microcontroller it stops it and if there's no clock cycles going no activity can increment on the microcontroller, it shuts the Wi-Fi down it shuts everything down and it's got them because it's not doing anything at a is the most energy-efficient sleep mode available and sleep load the standard sleep is good at you still get to keep all of your RAM context registers, deep sleep you don't so when it comes out of that sleep mode it will actually reset and so you lose the contents of your registers. So Hardware pins reset and also your RAM is wiped so any variable data you had going on there won't be there at all doesn't it doesn't like your code it's all that still there on the flash but it because it drops power to the to the RAM. Stop mode is cool it doesn't actually reset when it powers back up and it maintains your SRAM and you're registered so it's really good for waking up doing something and then going back into that stop mode where you know that you want to just conserve power for a while. Something that can get you unstuck though is almost the highest power usage for example particle photon is when it's searching for the Wi-Fi network and trying to establish connection to the cloud that's when it's going to be during heaps of power so you want to minimize that so going to sleep so let's say you know 0.1 of a second and then going through the whole connection process which can take a good second or two isn't isn't a very energy efficient way because any potential benefits you might have gained in that 0.1 seconds of sleep time are going to be lost by having to re-establish that connection so something to be aware of.

Now the next point I want to talk about is reducing led power consumption so LEDs everywhere almost every project you'll be using LEDs either as indicators or for a lighting of some sort but what a lot of people don't know is you don't actually have to run the LED right at its limits so a standard red LED, for example, will want to consume between 1.8 and 2 volts and it hasn't some current of 20 milliamps of 0.02 or and I've got with me here a Rigol power supply and actually you can see that the LED, yep and I'm using this to control the to control the current and the voltage and set those limits and I'm going to show you what the LED looks like at when it's allowed different levels of current because it might surprise you it's a really nonlinear response especially how our eyes pick that up. So I've got that set at 3 volts, for now, I'm going to turn now so I'm allowing it to draw 3 volts because of the way of that controlled. So I've got my Rigol power supply hooked up so I can control the current and actually limits that here now that is that 20 milliamps so it's it's consuming 1.96 volts at the moment and it's drawing all of those 20 milliamps now let's take a look if I want that down so at 20 milliamps here - So 19 you can see that brightness there, now that drops down but I'll zoom in a bit on this camera so you can see that a little better we drop that down so that's at 10 milliamps there so I'll bring that back up to 20 so you can take a look at the difference there's always no difference in brightness between 20 and 10 milliamps so again we're at 10 now let's drop it down to 5 and see what happens. So there again still a perfectly visible LED indicator and now we're here on 1 milliamp so just consuming a small amount of current when you look at it head on it looks exactly the same you can see that it is not quite as bright, I'll wind that current back I mean see it does get brighter but if you're using this as an indicator LED for example just mount it on a panel you can see that perfectly well in a well-lit room like we're in now or especially in shadow and at 1 milliamp that using one twentieth of the power that it would be consuming it was a twenty milliamps and so you just cut down your power consumption drastically on those LEDs if you have a couple you're going to get huge power savings and that is how you can really easily increase the battery life of your project by controlling the current to your LEDs and of course if you're using resistors like you would in most projects to use a set current, ill turn that guy off he is a bit noisy, so set that current for your LEDs then you're just going to be using Ohm's law to calculate the new resistor value you cannot run that check out my tutorial all about LEDs it walks you through the process there.

So combining in this third point, combining in with other sleep modes we were talking about is duty cycle operation and the idea is most IOT projects or battery powered projects don't need to be running all the time for example my soil moisture sensor the amount of moisture that's in soil isn't going to noticeably change or measurable change over the course of a second even in a minute it's probably not going to change very much, in fact, I only really need to monitor it once every six hours or once every hour just so we can get some nice smooth readings. The idea is when the content drops too low it shoots me an email saying "hey you need to water your plants!" and I go water them, it's all good.

But I only really need to be checking out every hour and that's really, really overkill for monitoring the soil as it is and so I can wake it up and then I check, check the sensor data if, if one of the plants is low then it sends that notification to the cloud doesn't its thing on a cloud server there and then it just goes back to sleep and that's all it needs to be doing and it's probably only awake and only doing things for five seconds if that and so when you're active for five seconds out of an hour you really, really cut down your power consumption and that's going to change for every project of course but duty cycling your sensors readings how often you're doing tasks that don't need to be constant is really going to help keep those batteries going for a lot longer in your project.

Now the last point, and again, this might seem a bit obvious but it's often overlooked how easy it is to integrate a rechargeable feature into approaches such as a solar panel there's an Adafruit solar lipo charger which is just phenomenal. You plug your solar power in you plug a micro USB port in if you want to power it elsewhere and you just plug your load in and you're plugging battery in and charge as the battery supplies the circuit and away you go keep the topped up I've got one here from Seeed studio we've got different sizes available different options and it's real it's actually really easy with boards like that we don't have to worry about using individual chipsets, everything is almost plug-n-play it's really really easy to integrate rechargeable features into your project so that's it for the four main points that I found to be really useful when you're trying to conserve battery life or just drop that power consumption for IoT projects and portable projects.

If you found these useful let us know in the comments down below I would love to hear from you and see what sort of projects you guys are doing and be sure to check out some of our other tutorials. Have a great day.