Is it possible to create a low energy embedded system with Nerves?

Hey there,

I want to build an embedded system with a very low energy footprint :battery:
Ideally, coupled with a big power bank, it should run for weeks.

The system doesn’t need to run all day long, it only requires to be turned on a few minutes per day.

Do you think this is feasible?

2 Likes

Are you planning on using custom hardware or something hobby grade like a RPI?

I’m open to any hardware supported by Elixir Nerves

Raspberry Pi even the W2 one will last days on normal powerbanks, not weeks. You’d have to turn it on and off to do whatever the work is required. Which may be the correct approach here anyway.

I’d look for a timer solution that could be plugged between powerbank and raspberry pi to turn it on/off whenever the work has to be done, and shut it down either by cutting power or the device would gracefully shut down on its own.

Another option would be something like Wake On Lan but I don’t know if recent RPis cupport it. Old ones did not.

1 Like

Hi @cblavier! Your post is really great timing - I have been working on developing hardware/Nerves software for just this problem! I’ll be releasing it here on the forum later this week (today/tomorrow). You can see some of the information on my BlueSky posts:

5 Likes

It appears that none of the RPI models support Wake On LAN.

Nice!
Looking forward to it :slight_smile:

1 Like

wow can I buy that HAT somewhere already?

One of the potential solutions I know of is to use a MCU that has low energy cores, like ESP32.

Needlessly to say, you will have a great time programming using that ghetto assembler and you will have to add a mosfet or something similar to route power to your nerves device.

1 Like

Iirc you might be able to use RTCs to schedule the machine being woken up some time in the future.

1 Like

I’m considering a group buy at some point in the future (around Q2 this year), if there’s enough interest :smiley: it’s all open source so you could also customize and/or order your own at a PCB manufacturer

If you need a product which is available right now, I’d recommend the PiJuice Zero, Witty Pi 4 Mini, or LiFePO4wered/Pi+. These all have on-board microcontrollers which control the power. For each of these you’d have to look into the CLI tools that they ship with and see if you can package them with Nerves or rewrite the communication protocol in Elixir

7 Likes

Esp32 and https://www.atomvm.net - is very suited for this… but depends on what you are actually doing?

(disclaimer: I’m a AtomVM contributor)

4 Likes

while out of stock, have you looked at the grisp boards? grisp.org, there is a smaller version that is being teased to be released soon, they seem really interesting and i’ve got some pmods and just waiting for them to come back into stock to buy one myself. How intense is the compute for what you are doing? would a small solar setup be wanted/needed you may be able to run for extreme amounts of time depending on workload?

2 Likes

You should checkout AtomVM! Its an alternative VM meant for embedded devices and I believe low power, however it lacks some features.

3 Likes

I missed your comment completely!!

1 Like

we want to feed an eInk display with jpg content. Content would be fetched from a remote server at most once a day

for low power you can’t beat an esp32 - an esp32/eink display is a perfect match.

You should even be able to just find some non elixir code to run on the esp32, if you don’t want to get your hands dirty.
Or get something like this, use micropython and be done: Inky Frame 7.3" (Pico 2 W Aboard)
(AtomVM does support Pico - but driver support will be a bit of a struggle I think…)

suppose it depends on your display model?

GitHub - atomvm/atomgl is fully up to date and supports a display like: https://openelab.io/products/7colore-inke-paper

there is also an older driver for a myriad of eink/epdiy displays that probably needs a bit of love to get going - GitHub - atomvm/avm_epdiy_display

There will be some rough edges - but it should be simple an easy eg:

Eg wire things up, put together.
connect to wifi
store secrets in NVS Module esp — AtomVM 0.7.0-dev+git.d4b1c563 documentation
use atomgl to display a hardcoded image
then use ahttp client Module ahttp_client — AtomVM 0.7.0-dev+git.d4b1c563 documentation to download from server, turn wifi off, and spent time updating image, this happens each boot.
use deep_sleep 24 hours (or calculate time until XX:XX) - and you are good.

Personally I’m looking at one of these all in one boards (greyscale) that are coming out soon - as my first foray into eink T5 E-Paper S3 Pro – LILYGO® or PaperS3 Touchscreen Low-Power E-Ink Display - M5Stack | Mouser

There is this project for AtomVM: GitHub - bettio/pocketOS - see video here Add description and video to readme? · Issue #2 · bettio/pocketOS · GitHub bit unrelated but just goes to show what AtomVM is capable off…

so depends…

If you don’t want to solder/wire things up:
this screen with holder for pico:

and then this Pico pins compatible esp32

Battery is really something like 3x AA, or some old usb power bank that doesn’t turn off when power draw is low…

5 Likes

Reluctant to post this here since the ESP32 affcionados are well ahead here. Also disclaimer: I’m the creator of GRiSP

But GRiSP2 is pretty low power too it runs on a single core iMX6ULL (the ULL means its the lowest power variant in the series). We are in the last steps of finializing the battery management extension which uses a standard 18650 Lithium cell and exposes all kinds of chare management functionality (it’s meant as evaluation board for charge management). Off e beefy powerebank one would get much more runtime but no charge management. Also the battery extension has a real time clock for waking up the board. iMX6 comes with a integrated epaper controller but I would need to check if the right pins are all exposed.

Probably will have to switch off the Wifi module during sleep to get more runtime (or atogether if its to run on Ethernet or via some other communication.

GRiSP2 is officially supported by Nerves (we intentionally made it so) and even the secure element that Nerves supports is on the board.

Now if you are really into extreme low power applications: we are already working with the first samples for what we will call GRiSP nano. This is running a ultra low power STM32 controller and has only 16MB RAM. We are currently working on getting the normal Erlang VM working on it no need for AtomVM. This board runs on energy harvesting devices e.g. from temperature gradients and of course also from batteries. Everything on the board is optimized for low power, everything even the PMOD modules can be switched off by software and various wake up hardware is on there. Here we are talking about ~10 mW when its running and extremely low sleep current. Here Nerves wouldn’t run anymore bit the Erlang VM is just the vanilla one which we currently optimize for low memory footprint.

No idea how it compares with a ESP32 since I have no experience with these. But I’m very sure GRiSP nano will beat it by length. We are making these boards as evaluation boards for real products and hobyists we need suppliers that have a track record and also we can’t use a chinese government funded CPU for critical infrastructire. So our CPUs are from European namufacturers (NXP and STM) and the PCBs are made in Germany.

8 Likes

Any idea when grisp 2 comes back in stock? Been chomping at the bit to get one.

End of February 2025, they shouldn’t be marked out of stock since the new batch is already waiting for the new&better default software to get done so they can be installed.

I’ll make sure they can be ordered already.