gus

gus

Nerves Core Team

Hello everyone,

I’m super excited to announce the first release of my passion project, Soleil! :tada:

What is Soleil?

Soleil is a power management and sleep control board for Raspberry Pi, specifically built for use with Nerves. It allows you to power your project from a battery, charge the battery with USB-C or a solar panel, and features a low-power mode to save battery. There are three wakeup sources so you can control exactly how and when your board powers on.

Additionally, Soleil has the ATECC608A chip (aka NervesKey) onboard to support secure connections to NervesHub.

And finally, the v0.2 board also features a Qwiic connector which allows you to easily plug into a huge ecosystem of third-party electronics. Soleil allows you to focus on building your portable or low-power project without worrying about how to power it.

Software

There is a Nerves system to support Soleil, as well as an Elixir driver library which includes convenience functions for interacting with the hardware.

Getting started is quite easy. From a new Nerves project, add the dependencies and target:

defmodule MyApp.MixProject do
	use Mix.Project

	@app :my_app
	@version "0.1.0"
-	@all_targets [:rpi3]
+	@all_targets [:soleil_rpi0_2]

    # ...

	defp deps do
		[
		    # ...
-			{:nerves_system_rpi3, "~> 1.29.1", runtime: false, targets: :rpi3},
+			{:soleil_system_rpi0_2, "~> 1.29.1", runtime: false, targets: :soleil_rpi0_2},
+			{:soleil, "~> 0.1.1", targets: @all_targets},
			# ...
		]
	end

Then, in your config/target.exs add the following config:

+ config :nerves_time, rtc: Soleil.MCP7940

Finally, add Soleil to your application tree:

defmodule MyApp.Application do

  def start(_type, _args) do
    children =
      [
	    # ...
+		{Soleil, battery_capacity: 2000, battery_energy: 7400},
      ] ++ children(Nerves.Runtime.mix_target())

    opts = [strategy: :one_for_one, name: SoleilDemo.Supervisor]
    Supervisor.start_link(children, opts)
  end
end

The parameters battery_capacity (in mAh) and battery_energy (in mWh) depend on the battery you connect to the board. These values are used by the onboard fuel gauge chip to estimate the remaining battery life.

From here, you have access to all of the Soleil helper functions. You can read the battery info:

iex> {:ok, info} = Soleil.battery_info()
iex> info
%{
	voltage: 3.82,             # volts
	current: 0.202,            # amps
	temperature: 29.34,        # °C
	state_of_charge: 82,       # % battery remaining
}

To control the Soleil low power mode, you can use:

iex> Soleil.sleep_for(5, :hour)
:ok
iex> Soleil.sleep_until(~N[2026-01-01 00:00:00])
:ok
iex> Soleil.power_off()
:ok

On boot, it is often useful to know why Soleil woke up (was it a scheduled alarm, or a manual override?)

iex> Soleil.wakeup_reason()
:alarm

Customization

This project is completely open source with a permissive license. Not only do I want to share it, but I hope that people who need this type of power solution for their projects are enabled to modify the hardware themselves. That’s why, in v0.2 of the hardware, I have moved all of the components to the left side of the board, allowing for a significant open space for you to add your own sensors, connectors, etc.

The source files are available in GitHub, with a well-documented schematic. If you want to make changes, you can easily do so using KiCad, the open source PCB design software.

I will make a video about how to customize Soleil soon!

Project Next Steps

  • If there is enough interest, I want to organize a group buy of the hardware for Q2 this year. I expect that the price would be around $30-35 USD + shipping. Fill out the waitlist form or send me a message to confirm your interest :slight_smile:
  • I am going to discuss more about Soleil (and open source hardware for Nerves in general) at the February edition of the online Nerves Meetup. This would be a good place to learn more about the project and ask questions (plus it is full of cool people!)
  • I’m considering developing other variants of Soleil, such as a LoRa version or a weather station variant. If these interest you or you have other ideas, let me know!
  • I think there’s a lot more interesting and useful projects for this model of open source hardware - stay tuned for more info soon :eyes:

Links

Some of the resources for this project are spread across multiple repositories, so I want to list them all here:

Project homepage

Hardware:
Soleil Hardware
Hardware technical overview and schematic

Software:
soleil_system_rpi0_2 (hex)
soleil (hex)
soleil demo project

If you want to follow me, I post project updates on BlueSky:

Most Liked

Margaret

Margaret

Really cool! Also, great timing with the other poster @cblavier who was asking about power management.

@gus if you’d be interested in authoring a short project-based book like: Build a Binary Clock with Elixir and Nerves: Use Layering to Produce Better Embedded Systems by Frank Hunleth and Bruce A. Tate
and
Build a Weather Station with Elixir and Nerves: Visualize Your Sensor Data with Phoenix and Grafana by Alexander Koutmos, Bruce A. Tate, Frank Hunleth
that focuses on a project that uses Soleil, hit me up: margaret.eldridge@pragprog.com. Both are modest sellers, but I think the readers who bought those books really enjoyed them.

jordan0day

jordan0day

This looks really great, nice work!

BigTom

BigTom

This looks like exactly what I will be needing in Q2! I have signed up.

(BTW, any chance you could fedibridge (https://fed.brid.gy/) your bsky account?

Where Next? Top

Trending in Discussions Top

AstonJ
As the title says, please share what you’ve been up to with Elixir. Whether that’s been learning it, looking into it, making stuff with i...
2977 94592 917
New
cblavier
Hey there, It’s been more than a year since we started using LiveView as our main UI library and building a whole library of UI componen...
New
mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
heathen
Quite interesting article Google brought me. Didn’t find any mentions about it here. What do you think in general? Would you use togethe...
New
mhanberg
Hi everyone! The first release candidate for the Expert language server project is now available! We’ve published a press release detai...
New
axelson
Hi there! :wave: @frigidcode and I (but mostly him) have been running an Elixir Book club, we’re almost done with Designing Elixir Syste...
New
budgie
A little off-topic, but I feel like people here have a good head on their shoulders. I used to be quite good at making software. Was luc...
New

Other Trending Topics Top

GenericJam
Edit: 2026 May 15 - This post is archived. Mob is alive!! Main docs: mob v0.7.11 — Documentation A bit of explanation for the slightly c...
New
JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
georgeguimaraes
Just published claude-code-elixir, a plugin marketplace for Claude Code with Elixir support. These are the plugins I’ve been using for my...
New
Dmk
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New
webofbits
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself. My main conc...
#ai
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews