I'm relatively new to Arduino and try to find smart ways to reduce power consumption on my MKR1200.
I'm collecting weight from HX711 and temperature/humidity from DHT22 every hour, using deepsleep (from arduinolowpower.h) between 2 measures (1 measure ~ 5 seconds)
Power supplies at regulated 5V comes from solar power management module from waveshare equipped with 3.7 battery.
I've disconnected the green power led and it now runs in deepsleep at 6mA, which seems to me quite high.
I've read that reducing clock speed from 48Mhz down to 32khz could help lowering power consumption but can't find the appropriate arduino code for MKR1200 to do so.
Can you confirm this action on clock would help reducing power when in deepsleep mode ?
Is there a place to get this code or at least some explanations adapted to MKR1200 ?
I understand clock settings have strong impact on PC communication with arduino board, so I do want to play with fire changing stuffs without knowing a minimum.
You are correct reducing the clock speed will reduce current but from what I can determine not by that much on this board. You need to disable all of the LEDs. Before you start changing "stuffs" purchase a few spares, they do not take kindly to abuse. If you really want some help post an annotated schematic, not a frizzy picture. It is also important to post links to "Technical Information" on each of the hardware items you are using. There are several MKR boards that show up when looking for one.
Remember, when you reduce the processor clock speed, you lengthen the time for your program to execute the same code. Current is reduced, but power to do the job is the same.
Thanks for the code. I've tried it in a simple loop with deep sleep during 1mn + wake up for 10s.
Although consumption in wake mode decreases, it doesn't in sleep mode (still 5.3mA !) whatever the dividor value.
On your own project, can you confirm you've succeed in getting power saving during sleep mode ?
Thanks for your advice. Yes I'm aware of it. My target is to reduce the power specially in sleep mode as it represents more than 99% of the time in my code.
By lowering the frequency of 48Mhz clock as proposed by pcaunegre, it doesn't change the sleep consumption, so I guess deep sleep is managed from another clock.
Have you removed the green led ?
I was not using the low power mode, I just reduced by 16 the clock freq.
Note though that I measured the current through the 3V input.
Using the vin that goes through a regulator may waste some more current.
Pascal
Yes I physically removed the green led and it has saved a lot (~7mA)
I'm using a 5V solar/battery power source plugged into the MKR Carrier 5V input.
I'm aware this is less efficient than a 3V direct input but my power source is only 5V, and moreover DHT22 temperature sensor only works with more than 3.3V, so as far as I understand, I have to do with 5V and not lower