element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
IoT: In the Cloud
  • Challenges & Projects
  • Project14
  • IoT: In the Cloud
  • More
  • Cancel
IoT: In the Cloud
Blog The Windchillator - Reducing the sleep current of the Arduino MKR WIFI 1010 to 800 uA
  • Blog
  • Forum
  • Documents
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join IoT: In the Cloud to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: bernhardmayer
  • Date Created: 27 May 2019 6:54 AM Date Created
  • Views 5444 views
  • Likes 11 likes
  • Comments 7 comments
  • arduino iot cloud
  • p14 mkr 1010
  • iotcloudch
  • sleep_current
  • windchillator
  • iot cloud
  • arduino mkr wifi 1010
Related
Recommended

The Windchillator - Reducing the sleep current of the Arduino MKR WIFI 1010 to 800 uA

bernhardmayer
bernhardmayer
27 May 2019

In an IoT sensor application the sensor usually sleeps most of the time and wakes in regular periods for a very short time to send its measurements to the cloud. This should reduce the average current consumption to 10 - 100 uA and enable a long battery lifetime.

 

Concept of Arduino IoT cloud and misuse

Based on my previous experience of the Arduino IoT cloud I think this cloud aims at another target. It wants to connect your Arduino to the cloud and keep the connection online all the time so that you can always control your Arduino through the cloud. So after startup the Arduino connects to your WiFi and the internet and the Arduino IoT cloud server. Then it exchanges its certificates with the server to authenticate itself and then it keeps this connection online. If this connection is lost it immediately reconnects itself. This comes with the cost of a high current consumption. In my test setup the Arduino MKR WIFI 1010 needed about 125 mA with an active WiFi connection. This Arduino is a dual microprozessor board which consists of a SAMD21 Cortex-M0+ 32bit Low Power ARM MCU for the main program logic and a U-BLOX NINA-W10 Series WiFi module for keeping the connection to the internet and the cloud. One way to reduce the power is to send the microcontroller to sleep mode. In this case this helps only a little bit as it sends only the SAMD21 to sleep mode and reduces the current by about 10 mA. This is good but the overall current is still over 100 mA. The next possibility is to reduce the power consumption of the WiFi module. This can be done with the command WiFi.lowPowerMode (https://www.arduino.cc/en/Reference/WiFi101LowPowerMode ) which reduces the power consumption as far as possible while still keeping the connection. This reduces the overall power consumption to 50 - 125 mA and the power consumption is highly fluctuating but still far from our goal.

 

Disabling WiFi

The next possibility is to disable the complete WiFi module during sleep mode and enable it only for transmission. This can be done with the command WiFi.end (https://www.arduino.cc/en/Reference/WiFi101End) and reduces the overall power consumption to 15.5 mA and brings us a big step closer to our goal. During transmission the power consumption stays at 125 mA but this is OK. Unfortunatelly this changes the whole logic of the programm as the setup of the Arduino cloud has to move from the setup function to the loop function:

 

  ArduinoCloud.begin(ArduinoIoTPreferredConnection);
  
  /*
     The following function allows you to obtain more information
     related to the state of network and IoT Cloud connection and errors
     the higher number the more granular information you’ll get.
     The default is 0 (only errors).
     Maximum is 4
 */
  setDebugMessageLevel(2);
  ArduinoCloud.printDebugInfo();

 

At the start of the loop function the WiFi module has to be enable again with the command digitalWrite(NINA_RESETN, LOW); After this command you have to wait a least 2.6 seconds until the WiFi module has fully booted. At the end of the loop function you have to wait 10 to 15 seconds and call ArduinoCloud.update(); several times to allow the transmission of the data to the cloud before you disable the WiFi module again. If you change the variables in the Arduino IoT cloud to update on change it seems like they are transmitted faster.

 

image

 

It would be better if this time interval would be shorter but at the moment I haven't found a way to achieve this.

 

Further optimizations

The next improvement is to use the ArduinoLowPower library and a timed wakeup as described here: https://www.arduino.cc/en/Tutorial/LowPowerTimedWakeup This reduces the sleep current to 5.5 mA.

 

Now it gets tricky. The next energy waster is the green ON led (DL3) which is directly connected to the battery and burns all the time. When you disable the LED by desoldering the LED or R27 the current is further reduced to 1.7 mA

 

The next step is to remove R7 which is a pull up to the reset of the WiFi module. This resistor is unnecessary as the WiFi module has an internal pull up. This reduces the current to 1.4 mA.

 

image

 

My final step is to send the ECC508 to sleep mode. The Arduino IoT library enables this IC but it is never disabled. To send this part to sleep made one has to first connect to it and the end the connection with the following commands:

 

  ECCX08.begin();
  ECCX08.end();     // power down ECC508

 

This step brings the power down to about 0.8 mA or 800 uA.

 

Potential

This is not the 10 - 100 uA I wanted to achieve but until now I couldn't find further ways to reduce the current and now it is way better than it was before.

 

If you add up the current consumption of all the parts (microcontroller in sleep mode, battery charger, LDO, pull ups) you get to about 300 uA. So there should still be some potential to reduce the current and maybe I will find new ways in the future.

 

The new code with all power optimizations can be found here: https://create.arduino.cc/editor/generationmake/a59ef69e-2c73-458d-a6ed-b2cb6c120b0b/preview

 

What's next?

As next part I will build the anemometer and do some wind speed measurements.

  • Sign in to reply

Top Comments

  • bernhardmayer
    bernhardmayer over 6 years ago in reply to ralphjy +2
    Hi Ralph, sending data over the air will always draw 50 to 100 mA because somehow you need to get the hf power regardless if it is WiFi, Bluetooth or anything else. The only thing that is different with…
  • mayermakes
    mayermakes over 6 years ago +1
    Very helpful findings! I will keep that in mind for future projects!
  • ralphjy
    ralphjy over 6 years ago +1
    Very useful data. I guess that's why it makes sense to aggregate sensors using lower power mesh communication like and then having a single WiFi gateway.
  • L0cutus
    L0cutus over 1 year ago

    if you disable the ECC508 chip you disable the I2C interface, at least i have discovered on my skin this thing, lost lot of hour to found the problem :)

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • scottd.nerd
    scottd.nerd over 4 years ago

    Thanks for this. By the way, your labels for R7 and R27 are swapped according to the board layout here -> https://store.arduino.cc/usa/mkr-wifi-1010

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • bernhardmayer
    bernhardmayer over 6 years ago in reply to ralphjy

    Hi Ralph,

     

    no big deal.

    I just wanted to show that there are different stakes in sensor networks.

    Everyone wants to achieve different things. And someone has to pay the prize or in this case supply the current or live with shorter range.

     

    But getting the nodes to as little power a possible is always a good thing.

     

    Bernhard

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • ralphjy
    ralphjy over 6 years ago in reply to bernhardmayer

    Hi Bernard,

     

    I guess I was just thinking out loud.  Although I have not tried implementing such a network I was actually thinking of a hybrid mesh network like you just described where only some of the nodes (sensors) are battery powered and repeater nodes (actuators like light and other power switches) would have local power (like Z-Wave switches) and the WiFi gateway would also have an AC adapter.  The problem that I would like to solve is having portable battery powered sensors that have long battery life and have reasonable location flexibility due to repeater proximity.  I'm not trying to reduce the overall network power consumption but that's also a great thing to do.

     

    Ralph

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • bernhardmayer
    bernhardmayer over 6 years ago in reply to ralphjy

    Hi Ralph,

     

    sending data over the air will always draw 50 to 100 mA because somehow you need to get the hf power regardless if it is WiFi, Bluetooth or anything else. The only thing that is different with different protocols is the time needed to setup a connection and transmit the data. At this point WiFi is not very good. But this also depends on the WiFi implementation of the router. With a different setup I managed to get this done in under 1.5 seconds with a ESP8266 and a FritzBox WiFi router.

     

    When you use a mesh network you need to have a gateway node and some relay nodes and of course the sensor nodes. The sensor nodes are very low power because they need to transmit when they have new sensor data. With the relay nodes it is already different. They need to leave their receiver running all the time since they don't know in advance when a sensor node wants to tranmit something. Because of the receiver running they constantly draw about 1 to 10 mA. So not very low power and these devices usually need an AC adapter. With the gateway it is even worse because it needs to be connected to two different networks all the time and this needs a lot of power.

     

    That's why I like sensors which directly connect to my home wifi. They directly connect to my router which is anyway running all the time and no additional energy is wasted. The only draw-back is the limited range of the WiFi.

     

    Bernhard

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • More
    • Cancel
>
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube