Arduino Power Consumption | Ashraf Madhoun | Skillshare
Play Speed
  • 0.5x
  • 1x (Normal)
  • 1.25x
  • 1.5x
  • 2x
11 Lessons (1h 22m)
    • 1. 1 Introduction

      4:30
    • 2. 3 Lower Voltage Supply

      1:57
    • 3. 4 Replace or Remove Power Consuming Components

      4:19
    • 4. 5 Arduino Interrupt Wake Up Mode

      14:01
    • 5. 6 Arduino Timed Wake Up Mode

      6:06
    • 6. 7 Reduce Power Consumpition using External Timer

      17:20
    • 7. 8 Deep Sleep Mode

      6:03
    • 8. 8 Solar Powered Arduino

      5:35
    • 9. 9 Sensor Based Board Control

      8:00
    • 10. 10 Other Power Reduction Options

      2:37
    • 11. Lowering Arduino Clock Speed

      11:11

About This Class

Arduino Power Consumption

Get in depth knowledge on Arduino Power requirements and Power Consumption with advance Tips and Tricks to Power Arduino

What you'll learn

  • Low power Arduino libraries
  • Deep sleep mode.
  • Slowing down Arduino clock speed.
  • Replace or neglect power-consuming components in your Arduino board
  • Lower the voltage supply on your Arduino.
  • Make your Arduino board that consumes away much less power than the one that you will buy.
  • Reduce Arduino power consumption using external timers.
  • More Tips and Tricks to reduce power consumption and you can choose from them.
  • Reduce power using an external timer circuit and how this timer can reduce power consumption.
  • Solar-powered battery charger circuit for your Arduino board
  • Sensor-based power friendly external circuit.

Requirements

  • An Internet Connection
  • Basic knowledge in Programming

Description

Get in-depth knowledge on Arduino Power requirements and Power Consumption with advance Tips and Tricks to Power Arduino

As most of you know, Arduino UNO, Mini, and most of the Arduino boards are not powered efficiently in situations when you have to run them on batteries.

In such situations, every milliamp of current counts, Arduino only draws a minimum of 15 milliamps of current, which doesn't sound like much, but in certain situations, it quickly adds up.

Arduino is a development board built with several different circuits, including a USB converter, regulators, indicators, short circuit protection, a damage control circuit, and a lot of other circuits. All of these internal components use more power than the minimum necessary.

In this course, we will look at different ways we can use to reduce the power consumption of an Arduino by changing some hardware or using special codes, you will learn how to increase your project's efficiency by reducing the amount of power consumption through these tips and tricks that we are going to provide in this course.

We will look at ways to reduce power consumption within the Arduino by changing hardware or modifying code.

However, there are also ways to reduce the power consumption of an Arduino by adding some simple external circuitry.

In this course, we will design some external circuits, some simple and intermediate, and even complex circuits to control the power flow of our Arduino to help externally regulate the power flow.

The circuits that we will present in this course are to be used and work best when you want to multiply your battery life in any Microcontroller project, not just Arduino.

I'm sure that after this course, you will know a lot about Arduino and about its internal structure and how you can reduce power consumption.

So what you will learn in this course:

  • Low power Arduino libraries

  • Deep sleep mode.

  • Slowing down Arduino clock speed.

  • Replace or neglect power-consuming components in your Arduino board

  • Lower the voltage supply on your Arduino.

  • Make your Arduino board that consumes away much less power than the one that you will buy.

  • Reduce Arduino power consumption using external timers.

  • More Tips and Tricks to reduce power consumption and you can choose from them.

  • Reduce power using an external timer circuit and how this timer can reduce power consumption.

  • Solar-powered battery charger circuit for your Arduino board

  • Sensor-based power-friendly external circuit.

I'm sure that you will enjoy this course content. It has a lot of useful information.

In the end, you will gain information not only about reducing Arduino power consumption but also about the Arduino board structure.

You will learn as you practice with real-world examples in this course

Who this course is for:

  • Anyone Interested in controlling Arduino Power Consumption
  • Anyone Interested in Learning how reduce Arduino Power Consumption
  • Anyone Interested in Learning Why Arduino Consume so much power
  • Anyone Interested in make Arduino Battery Powered Project
  • Anyone Interested in learning different ways to reduce Arduino Power Consumption
  • Anyone Interested in Making his own low power Arduino Board at Home
  • Anyone with slight interest in making great things
  • Arduino Geeks
  • Electronics Geeks
  • Hardware developers

Transcripts

1. 1 Introduction: Hello and welcome to this new course in which we will discuss Arduino power consumption. And this is a shot from educational engineering team. As most of you know, undoing or ONO on proline. And most of the Arduino balls are not powered efficiently in situations when you have to run them on batteries. In such situations, every milli ampere of current counts, Arduino Uno draws a minimum of 15 milli amps of current, which doesn't sound like much, but in certain situations, it quickly adds up. I'll do in normal development ball built with sovereign or several different circuits, including a USB serial converter, regulators, indicators, processor, a short circuit protection, damage control circuit, and a lot of other circuits. It uses more power than the minimum necessary. In this course, we will look at different ways we can use to reduce the power consumption of an Arduino by changing some hardware or using some special codes. You will learn how to increase your projects efficiency by reducing the amount of power consumption through these, let's say, tips and tricks that we are going to provide in this course. We will look at ways to reduce power consumption within the Arduino by changing hardware or modifying code. However, there are also ways to reduce the power consumption of an Arduino by adding some symbol external circuitry. In this course, we designed some external circuits, some symbol and intermediate and even complex circuits to control the power flow of our Arduino to help externally regulated the power flow. The circuits that we will present in this course and the tips that will, will present in this course are to be used underworld pissed when you want to multiply your battery life in any sensor based Arduino projects. I'm sure that after this course, you will know a lot about Arduino and about its internal structure, and how you can reduce the power consumption. So what you will learn in this course. First, we will talk about the low power Arduino libraries and the deep sleep mood. After that, we will explain how you can easily slow down Arduino clock speeds. You will also learn how to replace or neglect power consuming components in your Arduino board and how to lower the voltage supply on your arduino. After that, we will explain how you can easily make your Arduino board that consume much less power than the one that you will buy. We will also explain how to reduce Arduino power consumption using external timers. And we will show you some options to reduce power consumption. And you can choose from them. In the last section of this course, we will explain how this power can be consumed with external timer circuit and how you can utilize 55, five IC, which is the time or IC to reduce power consumption. And at the end, we will exit plan the solar-powered battery charge our circuit for your Arduino board and the sensor based external workup circuit. I'm sure you will enjoy this course content. It has a lot of useful information. And at the end, you will gain information not only about reducing power consumption, but about the Arduino board itself. Thanks for watching this introduction. This is rational from educational engineering team. 2. 3 Lower Voltage Supply: Now one of the easy fixes to reduce power consumption is lowering the voltage supply on your Arduino board. Arduino can work at a low voltage of 3.3 volt. And by dropping the sublime voltage from five volt to 3.3 volt. Current drawn drops from formerly arm to less than one milli amp. Using 3.3 volt. The recommended maximum frequency is around 13 megahertz according to the ATmega data sheet. So lowering voltage too much without reducing clock speed makes the microcontroller behave strangely. High clock speed of eight megahertz is the best option here. So make sure that when you want to lower your evolve from five volt to 3.3 volt. To choose that crystal oscillator speed to be eight megahertz. And I think about this might cause you problems because you are running at low voltage and Mark more speed and more mega house and the clock speed requires more power and your arduino won't be able to provide such power because you already lower the supply voltage to 3.3 volt. So there is a downside for this, but if your application doesn't require high-speed processing of data, you can lower the VT_2 sublime to 3.3 volt and work with the eight megahertz crystal. And you will save yourself a lot of power. That's it. This is an easy tab that you can use to reduce Arduino power consumption. 3. 4 Replace or Remove Power Consuming Components: Hello and welcome to this new lesson in which you are going to discuss replacing power consuming components to save Arduino power. Now, the onboard voltage regulator limits the input voltage to the DC and bookmark, the regulator is not very efficient and it's around 58% or 60% of the input energy is lost in the form of heat or used for internal supply. It is better to replace this component with more efficient DC to DC step-down converters. Some DC to DC converters can be as efficient as 90 or 92%. So you need to make sure that when you choose a DC to DC step-down converters to check the efficiency of that converter. Now, Arduino Uno uses a small linear voltage regulator as an, AS andy bucket and you can see it. And this image, as you can see here. This is thus I'm the voltage regulators. Now powering your Arduino using five volt. External voltage regulator, like the 7807 IC is far more efficient way than using disk and terminal voltage regulator. Its habitat option to remove the onboard regulate or for highly reduced power consumption without a voltage regulator, around 2.7 million of current will be saved. Now, the power LED is on all the time when your Arduino board to indicate that the board is getting enough power. Now removing this bar lid can also save you 2.8 milliohm of current in normal mode. And you can easily remove it using a soldering gun and some heat, then you can attach it from the board. In sleep mode without the lead, the Bar consumption of Arduino all is just thirsty. Micro amps. So it's not even in miliamp. So what do you need to do is simply remove the lid. And you can remove this lid easily by removing it from this port using a solid organ, like we already mentioned. And you can even remove all of the other lives if you are using Sierra communication, you can remove these toilets to save far since they will keep blinking whenever they're a serial data coming in or out. If you are turning pin number 13 on or off for your project, turn on our motor or unearthing girls. The associated LED will turn on as well, which will take about 25 million or 2.8 milliohm. So you can save 2.8 milli amp pair lead. And here we have four lids. So you can't save up to ten milliohm by just moving these four. Let's, so this is the first step which is removing a voltage regulator and using an external one, all using DC to DC step down converter. And the second step is removing these three limits. And in the coming sections we are going to submit and how you can even make your own Arduino board without all of this circuitry and additional things that you want need or do you want use. So stay tuned. Keep watching until you find what you are looking for. And the method that works for you. We are showing you all of the methods in this course. And it's up to you to choose the one that you want to use. That's it for this lesson. And this is how you count replace power consumer components, or remove them from your Arduino board. Thanks for watching. This is Asherah. 4. 5 Arduino Interrupt Wake Up Mode: Hello and welcome to this new lesson in which we are going to discuss low-power Arduino libraries. Now, in low-power Arduino mode, there is a lot of functions that you can use to enable low power consumption. And in this lesson, we are going to discuss two main modes that are very useful. The first one is external work up mode, and the second one is timed workup mould. The first one, which is the external workup mode, is basically a code that we can use to work up our Arduino from sleep when an external button or external sensor is pressed, paulson, so detected a signal. You can use this code as we'll tune up your Arduino using a sensor. Now, the second one is the time to wake up mode. In this mode, you can wake up the Arduino after a set amount of sleep. So you can make it sleep for one hour, then work it up for five minutes. And we are going to exit plane and both of these chords in this lesson. So let's get started. First, you need to open up new projects. Using Arduino IDE software. We already explained how to download and install Arduino IDE software. Now we will start with external work up. The first step is defining what we want to do. In the void setup. We need to set the mood. For fin number 13, which is our lives, will be output. We are going to use it as an output. And it will demonstrates our, let's say Arduino on states. Now, to use the low-power moment, you need to write low power dots, then a dash. Interrupt. Pull it up. Now, the interrupt workup is basically a function that takes three parameters. The first one is that PIN number, which is, let's say bin number eight. The second is a function that we need to call when the device turns on all work sample. So let's call it work function. Okay? Now, the third thing that this function will take is them ought. The moon is basically the transition to sense on the indication, indication pin. It can be one of these or falling, rising or change. So if any change happen. And pin number eight, we need to call this function, which is wake-up function. Now to enable that. Low-power library. First we need to attach the library. And we can do this by simply writing this line. Here. Collide hashtag, include and include the Arduino, low off the tics. Now a fever finds the code, let's save it. And let's call it. And Tara up through a command, save k. Now as you can see, it's having problem finding this library. So we need to copy this library and go to Tools, Manage Libraries. And here we need to look for this library. Okay, power, right power. And you will find that the first result, Arduino low-power in a storm, install all k. So now cyber is stalled. Click Close and verify again. K. Now we have another error. List check. Now when the old verify your code, you will most likely get an error if you have chosen arguing all. Now the low-power Arduino libraries work for Arduino boards. As you can see here, the library is not compatible with AVR bolts. So if you want to use this function, you need to use the Arduino board. And if you don't have it and this menu and the board's menu. This is the Arduino 0. You can simply add it by go to Tools, Board, managed boards. And here we can write how would we know 0? And as you can see, this is it, you just have to click install. And it's almost full support for Arduino 0, Arduino, I'm KR, and other Arduino supported packages. Once you install it, you can simply go to the Tools, chairs, the poll from here, and choose Arduino 0. Now, when you verify your codes. After choosing Arduino 0, you will see that it's asking you to add the work-up function here. As you can see. And since we add it's here, but we haven't defined it yet. We are getting this error. So we can write here boid, wake up function. Now let's verify the code again. Okay, let's see the error message. Well done combining we don't have any errors. Now, the next thing will be adjusting or calls. What we need to do is symbol. We already attached to the interrupt to be number eight. Now inside the void loop, we want to turn on and off our lid. So five, there's the right. And inside it are 13 high. Either delay. Let's say three hundreds fights. 13. Same here. Did a 300. That's it. Now we are turning our lid on and off. Now after this, we need to add low-power loosely function, which will put our Arduino board to sleep. Now, if you want to control the number of times this lid is turning on and off, you can add a for loop. Using this four loop, you can define exactly how many times you want this LED turn on and off. Now why did we add this work-up function? Well, it's very simple. This function will be called once on device workup. You can do some little operations here should like changing variables which will be used in the loop. And you need to remember to avoid calling delay inside this function and long running function, since this function executes an Interrupt Context and using delay in interrupt is very bad. Now, we can hear defining a variable here. Let's call it i. Now we can say that i equals five here. So I'll win all workup. It will take I value from here. And we can make it blink the lid five times. This is just an example. I equals 0. I is less than, let's say five, or let's collect ten. By blessedness. Okay, now let's make it i. J, k is phi is minus, is less than j, and let's call this j. Now, this for loop will run until i is bigger than j, and j here is five. We can change it with any other value. Now, will verify your code. Here we need to define, I click verify. That's it, done combining. This is the coding section. Now let's do a quick revision. Now this sketch and this called demonstrate the usage of external interrupt on Penn number eight to a cup at ship in sleep mode. Sleep mode allow a significant drop in the power usage of our board while it does nothing. Waiting for an event to happen. Battery bought application can take advantage of this mode to enhance battery life significantly. In this code, we are using pin number eight as an interrupt then. And if the processor is in sleeping mode, you need to consider this when loading your code. If the processor of your Arduino board is enslaving mode, you cannot load and upload a new sketch. To overcome this, you should manually set the bolt, usually with a single or double tab to the reset button, depending on the type of all that you have. So to upload a new code, you will need to receive that code that you have. Understood the whole board. And after that, you can hook it up and upload your new code. Now, who used the Arduino low-power library. And we used pin number 13, which is the lead. Here. What we did is we attached our cup interrupt on pin number eight. And we call a function when a change happens from rising to falling or from falling to rising at pin number eight, from 0 to one or from one to 0. It will call this function. And this function, when it's cold, it will execute this line. It will add five to the variable j. And inside the void loop, once this happen, inside the while loop, we are calling this four loop that will run this number of times to turn the LED on and off. After that, we added the low bar to sleep function. And this will basically regards an infinite sleep, the device will be woken up only by that I just thought, wake up source, which is pin number eight, the power consumption of the chip will drop consistently. So I think that not everything is clear. This is how easy it is to use the low-power mode, but you need to make sure that you are using a supported bold abort that supports this mood. And I already explained how to use the Arduino 0 and how to load it using the Boltzmann is, if you have any questions please ask in the Hyundai board. This is Asherah. 5. 6 Arduino Timed Wake Up Mode: Hello and welcome to this annular zone in which you are going to explain how you can use the sleep mood when your Arduino board. Now, in this course, we are going to demonstrate the usage of internal interrupts to a cup, a chip, and sleep modes. Sleep modes allow us significant throb in the power usage aboard while it does nothing waiting for an event to happen. But the rebel application can take advantage of v smoothes to enhance battery life significantly. Now in this code, then, then I'll RTC on our Arduino ball would wake up process or every two seconds. You need to know that if the processor is in sleeping mode, a new sketch can't be uploaded. To overcome this, you need to manually reset the bold, usually with a single or double tab to the reset button. Now, let's get started. The first step here is including the low-power Arduino library. So art Arduino, low bar dx. Now, if the library Caleb doesn't change here, you need to manually add it using tools, manage libraries, and you need to look for low power. And once you find it is the first one here, you can't install it. Now. N here, who need to choose the pinMode for pin number 13, which is the internal lids. And we want it to be o or we want to use it as an output. Now, inside the void loop, we can't simply hide digital rights. And inside it we cannot thirsty and to turn the LED on. And then we can add the other day. And we can either Willis accounts. After that, we can add the rights. Fear three and we want to turn that off. Delay 500 milliseconds. Now, this will turn it on and off. If we need to trigger 2 thousand milliseconds sleep, the device will be woken up only by that I just solved woke up source and by the internal RTC, which is responsible for timing, the power consumption of the shape will be drop significantly. Now, just right, low power. Those sleep. Now 2 thousand milliseconds, which is basically do seconds. Now, this is our codes. Every two seconds, our board who will wake up and we'll execute this code. Then it will go to sleep after two seconds to wait up, execute this code, then go to sleep. And we'll keep doing this. If you want to add, let's say, improvements. If you want to improve this codes, you can't simply align here unless its methods, the carbon, low power, Dothraki, and total up, way up. And in the previous lesson, we explained how you can easily attach the external interrupt to opt in. But in this example, we are not using external interrupt. You are using internal RTC and our lab. So you can write RTC, alarm, wake up, alcohol that you can't call any function. Dominant function. And you need to call the function when the are the CLR wakeup changes. Now the dummy function need to redefine here by void dummy function. And you are good to go. Now you can write anything inside this function. And this function will be called once on device wake up, you can do some little operations here, life changing variables, which will be used in the room. And you need to remember to avoid using delays and lung functions. Let's verify our code. Let's call it in Thayer null. Four times. Become mold. Ok, done compiling. As you can see, it's very easy. Now. This is the code. You can't change it according to your needs. And you need to make sure that when you combine the code, you are choosing a supported Arduino board, like the Arduino 0. That's it for this lesson. If you have any questions, please ask that lambda board. This is rational. 6. 7 Reduce Power Consumpition using External Timer: Hello and welcome to this new lesson. And we're going to use Arduino power consumption using external timers. Now, as most of you know, an Arduino based projects like a car or we'll say our weather station. I'm monitoring system and other data logging application. It isn't necessary to our your Arduino Project 24 hours a day. And instead, we can power our project or our device for a few seconds at our chosen time interval. For example, we can power the project for 30 seconds or 60 seconds every ten minutes. This will turn the Arduino system completely off for the measure of the, of the time, saving a lot of power. Now, when you are turning your project on for 30 seconds, every ten minutes means that in 60 minutes running time, which is one hour, you will be running your Arduino for three minutes. So you would be saving a lot of power. Now in this situation and in such projects and devices such as weather station and data loggers. Arduino reads sensor values periodically and stores the readings. All transmits them via Bluetooth or any other communication protocol. And then Arduino board in terms an idle state. Putting the attuned to sleep for some time can save some power. But we will save more power when we turn the Arduino off for nine minutes or none and a half minutes. Now, most of the time that regulators and other peripherals on the board consume most of the power and turning the whole Arduino board of will help save your battery life. Now, to save power, we need an external timer circuit that will turn your Arduino board on for, let's say, 30 seconds every ten minutes. And lower case. And in this scenario, we are going to use the 555 times or triple five timer, which is a very known and commonly used IC for timing applications. Now as you can see, this is a schematic where we have five-by-five timers, and these are the connection pins. We have two capacitors, two men resistors. This is an optional diode. And the two capacitors are connected to ground plus pin number one and bends number 48. And this resistor are connected to five volts here. And number three is the output or the timer IC. Now, to do this, we are going to create the circuits and protest simulation software and see how it works. But before forming the simulation, we need to discuss a very common problem. Now, the five-by-five IC in the stable mood is used to determine the on and off timing. However, the problem is that that duty cycle of the five 55 can never be 50% or lower. So we need a logic inverter at the output and we will allergic inversal here and the circuit design. Now, knowing this, let's say that we need to adjust the 5-5 five timer, icy high time for 30 seconds and low time or off time for five minutes. That five-by-five in stable mode is a very popular circuit where we need to select the values of these resistors and these two capacitors to determine the length of time for the on-off cycle. Now, tiling capacitor C and C dash will increase the cycle time. Now, these two resistors, R1 or RA and RB are one will increase time high. R2 or RB will increase time high, increase time law, and decrease the duty cycle. So you need to select the values for these two combustibles and these two resistors to be exactly the way you want. And there are online calculators for calculating these capacitors and resistors values. To get the on-off, you decide that you want. Now for the sake of our last one here, we will use 0.1 microfarad capacitor here, or 0.1 nanofarad capacitor here. Now regarding these three main components, that tool is the stores and the combustor. We will use a 200 microfarad capacitor here, brutalized one, and we will use two mega ohm capacitor for RA and 220 kilo-ohm resistor value for R2. With this arrangement, we can achieve a duty cycle of 91%. After using a logic inverter, it would be around 9% according to our applications need. Now, we will add a NOT gate after the output that will make sure to trigger the output and turbulent on when it receives a high signal from the output here at pin number three. And it would make sure that when you give a low signal, it will turn off the output. Now, sometimes people use relays to adjust the Arduino output. And at the end, you will send a signal from this output to your Arduino board, reset pin. Now, to connect what we have. Discussed in this lesson to the practical approach of this power consumption reduction for consumption methodology, we need to do the circuit design and simulation. So let's go to protest simulation software. And go to the start menu. And right protests. And we already explained how to download and install protests when your operating system. Now let's create a new design, new project. And let's call it 505 dimers. Arduino. Let's save it and less specific location. K, power consumption. Now inside this, let's add another folder and code of circuits. Now click Next. We need to create it. Click Next, Next, Next, and then Finish. Now, in this lesson, first, we need to click on the component mode, then select appeal letter. To start selecting components. Add the 555 times. As you can see, this is it, and we have more than one. We will use this one. We will need a combustor, salami capacitor. And we will need polarized clusters, so you need to write it down, okay? And this one will work. We need resistance. And we will need a Really, this is it. We will need transistor. For the output list views the 547 transistor, NPN transistor. And that's it. And this is everything that we need for this circuit. Now let's start by adding the main component, which is the diamond. And let's add that as a stores. We need tools installed. And the first one will be here. And the second one will be here. Now, we need a capacitor. The salami cluster will be connected to bit number five here. And closed capacitor looks like this. We need to connect it to pin number six. So let's add it here. And that's it. Let's connect these. Then we can connect the output. Now. We know that bins number 84 are connected to five volt. So all you need to go to the terminals board, select power and add power here. Plus five volts. Now, we also know that this resistor is also connected. Here. Let's draw an m. And this is also connected to five volts. This resistor and these tools are soils are connected together and pin number sovereign is connected between them. Now, pin number six is connected to pin number two. And pin number six is also connected here between these two components, the resistor and the capacitor. To number one is connected to ground. So we need to add the ground and connect pulp print number onto ground. This combustor must also be connected to ground. And this 12 will be connected to ground. Now, we have for number three, which is the output, and we will connect it later. But now let's do a quick revision for the connection. Pin number one is connected to ground, then number two is connected to bit number six and is connected and bin number six is connected. Movies that is still unthinkable. Now, pin number three is the output for number 48 are connected together and connected to five volts. Pin number five is connected to the ceremony Callisto, and the semiconductor is connected to ground. Sorry, pin number six. We want to discuss this. Pin. Pin number seven is connected between these two resistors. Pin number eight, again, is connected to five volts. That's, it's now let's change the values. Now. This one is to omega, and this one is 220 kilo on. This capacitor is 200 microfarads, and discover store is ten microfarads. And that's it. And this is our timer circuit. And now we will connect our relay circuit here. Okay, we need, they would follow the relay. Sorry. This is well known to use. Now let's add the relay. And this is it. Now we need five volts when you ground. And we need power, Choose File volts. And here, when we connect it, now, this pin will be connected to our Arduino to deliver five volts thought Arduino bolt. Now we need to other diodes. Let's rotate it and its altitude higher than M. That's it. Now we need to add that transistor Under attitude that side than m. Now this node will be connected to this transistor here, and this side will be connected to this transistor here. We also need a resistor that is this total B one kiloohm. And now this Liz's totaled reconnected to five volts. And this side will be connected to ground. And here we need another resistor. One kiloohm resistor will be connected here, and this side will be connected to the output of our timer circuit. So the tunnel will send on-and-off signal to the base of this transistor, which will turn the relay coil and on-and-off, which will change the contact state. Now, this is it, this is our circuit. Let's save it. Let's just sit out. Here. We have our circuit. As you can see, we are receiving on signal from and the timer circuit. Now to make sure that everything is working correctly, we need to it, it's few things. First, we need to add, I'll end here. And let's show that this combustor and megatsunami combustor. So let's copy this here and connect it here. This will be 200 UAV microphone. Now, at this point, we need to change or to take eyelid outward just to see what will happen to the array when the output, the time onchange. So let's single bright limbs and choose an active lead. Here it is. And that is this term. And this is connected here. This would be $220 is four. So let's draw this line from here and connect it here. Now, as you can see, the LED is on. If you want to change this, you can, if you want to share the timing, you can play with that is unthinkable, still valuable. To choose. Your styling during the on time. Or Arduino board will be on. Tool starts collecting information and data and storing it in the memory. So thanks for watching this lesson. This is astronaut. 7. 8 Deep Sleep Mode: Hello and welcome to this new lesson in which we are going to sublet in deep sleep mood. Now, what you need to know is that using the normal sleep mood is efficient, but it's not very efficient. Deep sleep mode helps an Arduino consume a lot less power than sleep modes. It puts the MCU and deep sleep and everything except the RTC peripherals is stopped. The CPU can be woken up using the RTC or any interrupt encode. Now, to create a deep sleep, what you need to do is the following. The first step is assigning number 13 as output. Now, Linux tip will be turning on and off using the dot function. And then we need to turn it off. Now, here we turned it on, and here we turned it off. If you want to enter the deep sleep mode. There are two functions, as you can see here. The low-power, the deep sleep function, post them CuO in deep sleep mood and allows power optimization with the slowest workup time. All but the artists EPFL are stopped and you can easily walk your Arduino using RTC or workup on interrupt capable pins. Now you have two options. You can either use deep sleep or deep sleep undefined the milliseconds. Now a few define them milliseconds. This will be the number of milliseconds, both the bolt and deep sleep mood. If you didn't write anything between these two parentheses. This means that void was chosen and you need to look up your Arduino board using our cup event, like RTC or external workup like the previous lessons. Now, you can simply write the following. Here. After that code runs, you can't write low-power dot the sleep. Now, if you highlight 2 thousand milliseconds, this means that your Arduino will execute this. Then it will go for deep sleep for 2 thousand milliseconds, which is basically two seconds. Then tool turn back on and phalanges, and then we'll turn back off to deep sleep for two seconds and vice versa. Now, if you lift this without I think, anything, then you have to recover your Arduino board using an interrupt, either pi, external interrupt or empty or non RTC. Now to use the internal RTC First we need for the deep sleep mode. What we need to do here is include the Arduino low power Library. And inside the void setup you need to write low power. And a dash are wrapped it up. Now here we need to enable the RTC internal alarm wake up. And the second will be the function. Any function. And here we will need to initiate the action if anything changes from high to low or from low to high, and the RTC alarm wakeup. And basically this will turn on our Arduino board using the internal RDC. Now if you want to take control and if you want to wake up our Arduino ball, use external interrupts using our button or sensor. We can connect the sensor to be number two or three or four depending on what we want. And any action that will happen on this pin will call this function, which is called Any function. And you need to define it here. And the function that sets. Now let's verify the codes and let's call it deep. Now, everything is enabled and we have a 100. That's it for the deep sleep mode. Thanks for watching. 8. 8 Solar Powered Arduino: Hello and welcome to this new lesson. No2 are going to explain that solar power battery charged our circuit. First. We know that solar power if is for free. So it's really easy to use it to power anything if you have the right tools. Now, most of the time finding a power outlet and remote locations like a farm or a factory where the other stations or data loggers are generally used is a big problem. Because of this, you will need a battery and a solar panel without charging model and a boost converter module. And we will explain why you need all of this. The main goal here is to make a solar powered battery charged our circuit. Now, we will be using that TB for 0 5-6 lithium battery charge on module, which is this one, the one in the middle. And you will use lithium battery and an old work. And here we are using 18650. And you can choose Addie, other lithium battery now. And this module can be bald using USB and also can take an input from a solar panel, a small solar panel. So let's use the markers. Now. It will take a plus sign from here and will take a minus here. These are the two points for a solar bound. Sometimes they are the diode fall protection. Now, the battery will be connected to these two terminals. This is the blast, and this is the minus. Now the output power will be taken from here, and this will be the output plus. This will be the output minus. Now this output must be, can connect it to our boost converter. Because most of the time, this module doesn't provide five volt. So we need to take or to buy a boost converter unconnected to these two terminals. And the output of the boost converter can be connected to our Arduino board. Now, to give you a quick look about how this thing will lock. As you can see, this is our solar panel. This is the diode, and it's connected to the plus and minus terminals of the module. And here we have two terminals for the battery charging. Some of them would use comes without outward for the boost converter, which is this, these two pins. So you have to take the output directly from the battery pins. And as you can see, it's sort of the coming out of this board. And from this board you will take the output to a boost converter and you can find it online. It will take the 3.7 volt and it will step up that DC volt to appoint that Arduino can work with. Using this circuit. You are saving power and you are providing backup battery for your Arduino board. So you won't be afraid or power loss. Now, this is a very useful solution, especially if you have a project that is outside in a farm or in you are controlling a car or any other remote location. And it will save you a lot of far. Now, solar energy is trending and everyone is trying to use free energy. And this is one of the ways is by using a solar cell to power up your Arduino. Now, if you combine both methods, if you combine the C and the method that we mentioned using an external time or to turn on and off your Arduino ball depending on the timing schedule for your project. When do you want to collect data? And if you combine this time much external timer circuit with this solar power. But at a charter circuit, you will get to save a lot of power. And you'll get your Arduino Project to work even more using this backup battery. So you can choose any two methods, mixed them together to get the most out of them and to reduce the amount of power consumption. And that's it for the solar-powered battery charging circuit. Again, this is a small solar panel and that you can't purchase online. This is battery charge on module that takes n will form a solar panel and charge about a lithium battery. And this is a voltage boosts are that will take a 3.7 volt from the battery or from the module to enable that type for you that you have. And it will convert it to a voltage that Arduino can use or can work with. Thanks for watching this lesson. This is Ashraf from educational engineering team. 9. 9 Sensor Based Board Control: Hello and welcome to this new lesson in which we are going to discuss how you can work up Arduino using external sensor circuit. Now, the main working principle for this circuit is very simple. And this circuit will cut off the ball to the Arduino until it gets a high signal from a sensor. For example, when you are using a PIR motion detector sensor, it usually provides an on and off signal. It will power Arduino, something is detected by the sensor. And technically when the sensor, since a high pulse and the type of sensor, it will turn on the Arduino ball to react to the sensor. Now, let's split the circuit using proto simulation software. Now, file new project. Let's call it certainly sensor. Rouse. Now lets certain side, I'll do Nepal consumption circuits. Okay? Now we need a few components for this circuit. First, we need fuel, the transistors to n 390 for k less than order to unfold here. Okay? And variable. Now this is an NPN transistor. As you can see. We need two of them. And we also need a diode. We will need a resistor. We will need alludes to this, the circuit outputs. And we will need a p-channel MOSFET. Now, light IRRs and choose UNDP channel MOSFET. You can specify the amount of current unfold that you weren't fully MOSFET. But since we are doing with this and the simulation phase, I will choose une p-channel mosfet. Here we have this one. Now. Let's start by adding the components. The first thing is that transistor, two transistors known as lumen. And we need ground. You also need power. These resistors. This one will be placed here. And this one won't be placed here. We need either on here. And then under law right here. Now this will be one kilo ohm. And this will be available from the sensor to the first transistor. This will be 220 kilo ohm. Now, we also need either beyond two years, let's hide the name. Now it will take the output from here and a total provided here. And the base of this transistor. And here we need a ground. We need another ground. Here. Now this resistor will be 200 hero on. And we also need the MOSFET, which is the main component in our circuit. As you can see, this is almost fit. Let's rotate it. That's it. Now let's conduct this print here. And this print here. Connect this pin. Although almost flip gates and transistors will be connected here. Here we have ground. And this will be the outputs all MOSFET. So all we will connect a resistor, 220 ominous sort with a lid. We might do your modifications to our circuit. This is the man. Okay, now we need to simulate a sensor here. So you'll use something called legit states. And it's basically an object that gives 01 for the simulation. Now, let's run the simulation to see if we have any errors. Now as you can see, when the sensor sends 0 through this transistor MOSFET. The MOSFET will turn Arduino ball of. So imagine this to be your Arduino ball. Now the sensor sends one. It will tear lawn the Arduino board. So this is basically a circuit where the sensor is the turning point for our Arduino board. So if this is always on, it will turn on. If the sensor is off, it will turn all Arduino board off. And this will help serve a lot of power since our, our little ball would only work when a sensor detects a signal. Now what really happens here is that this circuit is built around a p-channel mosfet and a couple of NPN transistors. When a high pulse is applied to the circuit, which is one transistor, Q one becomes active, and there is power reaching the base of transistor Q2, which is this one. So that gate pin of the MOSFET is bold law. And this allows the current to flow through the MOSFET and the ball gets power. This is the main working principle for this circuit, and this is the schematic. If you have any questions, please ask in the ground airborne fast sloshing this lesson. And this is Ashraf. 10. 10 Other Power Reduction Options: Hello and welcome to this new lesson. Now, there are so many power consumption reduction options. We already discussed a lot. We discussed the sleep mode, the deep sleep mood. How to replace or remove components that you don't need. How to make your own Arduino board, how to lower the voltage, and how to use external timer to turn off the ball for a specific amount of time. We will also talk about how to reduce that lock speed. Some of these methods might work for you while other mice not. So you'll need to make sure that you choose the one that works best for you. Now, you can consider other options like not using a backlit devices. Most of the LCD is come with a backlight. And if your project is Bowery as battery bars, you shouldn't use a backlit LCD, especially that the LED will turn on for a very long period and will consume a lot of power. And the backlight usually have more than one lead. So you need to make sure that you only use back. Let us see this ablaze when you need them. Now there's also indicating this ablaze. The VCE shouldn't be on all the time. You can use them to turn on and calibrate your project. Then you can attach them and attach them again whenever you need them. Sometimes we add an LCD display just to make sure that we get the lights readings. When we run our project for the first time. After that, it's not necessary to use it. So you can't remove it and use it whenever you want. But that's it. If you are not using it for real time data logging, don't keep it attached. You can also turn off the external devices connected to your board. Like SD cards and other modules using a MOSFET circuit that we explained in the previous lessons to make sure that you are saving more power. Turn these devices on when you need them. Don't turn them on all the time. That's it. These are the main ideas that I have for saving power on your Arduino board. If you like this course, don't forget to review it. Thanks for watching this lesson. This is Ashraf. 11. Lowering Arduino Clock Speed: Hello and welcome to this new lesson in which we are going to discuss another method to reduce Arduino power consumption. Slowing down your Arduino crystal All clock speed. That looks feeding your Arduino board determines how many operations it can perform per second. Most Arduino balls r1 are 16 megahertz clock speed. And reducing this to eight megahertz can droop that current needed trumped willingly arm to 8.5 million. In the long run. It can cut off much of the power consumption and extend battery life. So when you don't need to execute a large number of instructions, lines of codes in a short amount of time. It's meaningful to reduce your clock speeds for saving power and to perform some operations. How far. However, this method is not very convenient in most cases. And if you can't put your bold in deep sleep, this muscle is far more inefficient. Now, changing clock speed can cause bootloader issues and your Arduino may get damaged. By this is only if you did something wrong. Now to change the Arduino clock speed, you have more than one option. Now, the first method that are usually used to change the clock speed for my Arduino board is basically using the CLP register. Now. Now this is the data sheet for the ATmega 328 p board. As you can see in this table, we have I'll just hold CLK p. It's responsible for the us. Please kill or select. And depending on all choice, we can divide the clock speeds for our Arduino board by 248 or 16. So if we have 16 megahertz, Arduino bald, if we used these four bits, all of us ya'll KB register, it will become eight megahertz. And the same thing if we have chosen these 4-bits 00 1-0 tool be 16 by four, would be four megahertz. So this is the easiest way to use that clock speed for our Arduino boards. Now, in code, what you need to do as syllable, you need to go to your goals. What you sit up and inside that you can write C alkane APR, and right, 0 x It's 0. Now if we want to divide it by two, if one to have an eight megahertz Arduino clock speed, we can write 0 x 01. But we need to make sure that we know what's happening here. Now if we have a lived here. And this lead is on the number 13 on again, let's turn it off after that. Now, let us high, but let's slow. This lead is running and the delay is 1 second. If we are running this command, this means that we are running our Arduino board at half of its fall speed. So it's eight mega is sort of 16 megahertz. So this delay will become slower, which means that the LED will be on for two seconds, not one, not one seconds. Because all Arduino board is learning slower than usual, which is basically half the speed. So in order for this lid to turn on for 1 second, we need to add this symbol divided by two. By dividing the one by two, we are running our lives. We are turning on outlet for 1 second. Now, this is because we are running at half the speed, which is eight megahertz. Now, where did we get the 001? It's very simple. We are running to. So we are dividing our crystal speed, which is 60 megahertz by two. So we are using this line 0001, and this equals 0 x 01 n hexa, which is basically the line written here. Now, let's define that digital been the pinMode here. For pin number 13 to be outlawed. That's it. Now you can fill a fire codes. And as you can see, CLK PR was not declared in this scope. So we need to declare it. But again, this method is not recommended. And if you can use the deep sleep mode, it will save you our much more power. And running at half the speed for your Arduino board is basically slowing down everything to have speed. So everything in your code that if there are delays, you need to make sure that they all change to me than your speed. Plus, if you misuse this function, you might damage your Arduino board. So again, I'm explaining it, but I'm not recommending. Now there is another way to apply this. Let's first save this code. The other way that you works most of the time when applying the very same principle here is basically. Now what you need to do is first you need to create a custom board, the text file. So you need to go and open up your Arduino folder, go to C program files. Arduino hardware, then undoing our game. And you will find, if you are inside it, here, you will find bars look text, which is a foreign key that you need to edit. Now, right-click and select edit will open up like this. And you will simply need to copy a certain quad. I'll paste it. And the resources section, just click Paste. And this code will be Pasted. As you can see, this code will change the bootloader and we'll define a pre scalar. Now after copying this code, you need to save your work by simply clicking File, Save and close the file. Now, here, if you need to do the following, you need to include the file that we just edited, a VR slush. Now, after including this line, let's comment this line because we are using another method, and let's call this 1. Second. Now, let's verify variable. Now done combining. Now you need to use and inside this if statement. So if F underscore CPU equal equal, you need to write eight megahertz. So 8123123. And this means if the oscillator speed is eight megahertz, you need to use the pre scalar clock that we would select here, pre skill set. And here we need to select cloak division by two. Now this is the line that we are going to use to select a pre scalar. Now let's verify. If we don't have any arrows, risk knew that everything is working just fine as you can see, done humbling. Now you can't put with the same line and paste it here, here, here, and here. You can change this to four. This 22, and this 21. Now, one means one megahertz. And here we change this to four, it and 16. And the way this works is the honor first boots up initially at 16 megahertz. So the default bootloader would work properly. And you can do sketch uploads as normal. But then your sketch is combined are the prescheduled clock rate. So when your sketch starts up, the first thing is to adjust that look pretty scale. And then you're called showed execute at the correct speed. And keep in mind, depending on which core you use, it may not have the support for some clock speeds. So again, use these chords with great caution because if you did anything wrong, this might break your Arduino board and you won't be able to use it again. Now, this will sit all pre scalar speed to eight megahertz and a set of 16 megahertz, which will save power. And this means that our Arduino consume less power. If you have unequal Austin, you can ask in that yonder board. Thanks for watching this lesson. This is Ashraf.