I just got started building my own sensors and stumbled upon the Wemos XI, https://www.wemos.cc/product/wemos-xi.html . For USD1.50 and no leds or voltage regulator they seems to be quite useful for a battery powered sensor. Anyone tried them?
Just ordered a few for testing, thanks for sharing.
I found this part interesting: 1.8-5.5V
Maybe it can be used in a solar powered battery node connected directly to the battery?
Very nice. As you say, looks like a great platform for battery-powered nodes.
Here is the original wemos Aliexpress link btw https://www.aliexpress.com/item/WEMOS-XI/32764817280.html
Some (limited) more information in the wemos forum: https://wemos.cc/topic/820/wemos-xi
I have one already, but didn't have time to play with it yet.
MCU is a chinese clone of the atmega 328 so wether or not it's a good alternative for battery powered nodes is yet to see, as the power saving functions/sleep modes etc might not be as efficient as the original...
@Nca78 from what I can read from the chines datasheet, it is efficient. But of course the datasheet would claim that
I have some PCBs to finish first so I can get them before Chinese & Vietnamese new year, then I'll take time to make some basic tests.
I will see if the "more efficiency" and "more easy" ( ) claims made in the "datasheet" (looks more like a commercial leaflet for me...) are true or not.
@Nca78 there is a "real" datasheet as well, but only in Chinese. http://www.ocrobot.com/lib/exe/fetch.php?media=zh:ocrobot:alpha:8f328d:lgt8fx8d-series-databook-v1.0.1.pdf
The absolute maximum ratings tables at the end are pretty readable though.
Received som WeMos XI modules the other day and I tried to compile a sketch for it but I ran in to some trouble:
WARNING: library MySensors claims to run on [avr architecture(s) and may be incompatible with your current board which runs on esp8266 architecture(s).
Got a little bit further by adding the following to the sketch:
Now I get the following error:
\Arduino\libraries\MySensors/core/MyMainESP8266.cpp:22:22: fatal error: Schedule.h: No such file or directory #include "Schedule.h" ^ compilation terminated. exit status 1 Error compiling for board WEMOS XI. This report would have more information with "Show verbose output during compilation" option enabled in File -> Preferences.
I really don't know what I'm doing here but I will try adding the Schedule.h file from somewhere to somewhere...
Adding the Schedule.h to the MySensors core library folder just makes it ask for the next thing that is missing so I think I will leave this to someone who knows what they are doing.
@korttoma Why use ESP8266? isnt it 328 clone so you could use Mini pro in arduino ?
I got too myself some boards. XI is indeed a 382 clone, but it seems that the XI core library is missing yield() functionality.
I managed to compile my mysensors sketch with first forcing the
#define ARDUINO_ARCH_AVRin the sketch and
with some modifications at the XI core library:
- I added the
void yield(void);somewhere in ..\ARDUINO\hardware\wemos\XI\cores\lgt8f\Arduino.h
- I added the hooks.c file to ..\ARDUINO\hardware\wemos\XI\cores\lgt8f\ from https://github.com/arduino/Arduino/blob/master/hardware/arduino/avr/cores/arduino/hooks.c
However i did not yet upload the sketch to the board, I'll later when I get home.
- I added the
Thanks @lorisc ! I managed to compile my sketch with the changes you suggested. Going to wait for your test results before I load anything to my board.
Missed the post from @lorisc it would have saved me some time as I ended up doing the same modifications
Uploaded to a board and connected NRF24 with the same pin numbers than on normal Arduino: it runs.
Tested the sleep() function from MySensors but it's not so great at the moment, using 1.5mA, I'll have to check why.
I have just tested the sleep modes from the examples supplied with the lgt8 core, and all I can say is it's pretty disappointing
Even in PM_POFFS1 mode which is the lowest power mode possible (only wakes up with external interrupt) it consumes over 80µA.
There must be some settings that can be improved to get closer to what the datasheet seems to claim, but it's pretty hard to guess how we are supposed to do that with a chinese language datasheet...
EDIT: when I force pins to OUTPUT + LOW the power consumption drops significantly, it's below 20µA now. If someone has some knowledge in Chinese to find out if/how we can disable ADC/SPI/... that could get interesting.
But without proper sleep functions the Xi loses most of it's interest as battery powered sensor (low minimal voltage, no regulator & power led to remove etc). Only interest at the moment would be the 2 DACs that the atmega doesn't have, but that's of very marginal interest for MySensors. It doesn't even have a cost advantage as it's only 0.30$ cheaper that pro mini but with shipping fee.