mlainez

mlainez

Driving a car powered with Nerves and Elixir

Since the beginning of 2024 — together with my two partners in crime, Loïc and Thibault, at our company Spin42 — we started a project that aims to tackle vendor parts lock-in in transportation by redesigning the embedded systems in a vehicle. We want parts from different brands to seamlessly talk together and create an abstraction layer on top of them that we can standardize and use to extend a vehicle’s capabilities, or simply monitor them.

That’s how the Open Vehicle Control System was born. And because we wanted to use Elixir for this project, we decided to do as much as we could with Nerves. Since such a project requires a platform to experiment with, we used a 2007 Volkswagen Polo that we had at our disposal and started “hacking” it.

We thought it would be fun to convert it to an EV, so we started by getting the second hand electric motor we received to spin with the original gas pedal — our first big milestone. This was done using our “plank” prototype.

Then we reassembled the mechanical parts in the car (engine and gearbox) and got the wheels turning. This is what we explained in our ElixirConfEU 2024 talk back then — another big milestone for us.

In order to really drive the car, we needed to iterate on this first prototype, make it as safe as possible, and put everything back in the car. We eventually ended up with a more reliable setup. However, back in February, when we gave an update on our project at FOSDEM 2025, we didn’t have the battery fully completed. We could, however, show a moving car — powered by a very long extension cord :wink:

The whole embedded system we have in the car has several parts:

  • The Vehicle Management System (Nerves on rpi4) — it’s the car’s new brain. It translates and orchestrates all car parts and seamlessly makes them work with the original ones. For instance, the RPM on the original VW cluster comes from the Nissan Leaf engine we put in the car. We wanted to keep as much as we could from the Polo while making the integration as seamless as possible.
  • The infotainment system, which allows us to select the gear and get information about the car’s equipment status as well as our own OVCS components. It’s also a Nerves system, with a frontend built in Flutter that runs on a nice 10-inch touchscreen.
  • Several generic controllers, which are built using Arduinos. No Elixir here, but they get their configuration from the Vehicle Management System through an adoption process we designed over the CAN network we created between OVCS components.
  • The remote control bridge (Nerves on rpi0), which allows us to control the car using a Mavlink compatible transmitter.

There were, of course, lots of things not Elixir- or Nerves-related in this project, such as:

  • Fabricating and welding junction pieces to fit the Leaf motor to the original VW gearbox
  • Fabricating and welding new supports for the Leaf motor on the Polo chassis
  • Building and wiring the new battery from Nissan NV200 used cells, which we put in custom-made aluminum boxes
  • 3D printing all components, boxes, pieces, and cases, plus fitting pieces in the car
  • Redesigning and rebuilding the cooling circuit
  • Swapping the old brake system with a Tesla iBooster
  • Welding a new Polo steering column onto the old one and swapping the original servo motor with a new one we can control
  • And many more smaller things…

But since May, we can finally say that the first Nerves car actually works and can be driven both manually and remotely. We managed to create a new embedded vehicle system from scratch using Raspberry Pis and Arduinos, powering the whole thing using Elixir and Nerves — all without prior experience working on a significant embedded computing project. We think it speaks volumes about what you can do with Elixir and Nerves in the embedded world :smiley:

We won’t be able to bring the car to NervesConfEU for obvious logistics reasons :sweat_smile: but here’s a small teaser we made to give you a heads up of what we will be talking about.

Most Liked Switch mode

mlainez

mlainez

In case you didn’t see it yet, we actually built a small scale version of the car on a Traxxas 4WD. The idea is that the software and hardware stack is exactly the same and that allows us to test remote control features or the ROS2 layer we’re working on before deploying it on the full scale car. Loïc gave a short talk (5 minutes) at FOSDEM about this specifically.

mlainez

mlainez

The software part is open sourced, the OVCS vehicle composer for it can be found here. But we haven’t made any schematics yet so it’s indeed complicated to guess what you need to build one today.

We are looking into writing some getting started guides, which would include instructions on how to build the RC version and maybe also a tutorial on how to plug the VMS or Infotainment on a simple OBD plug. The information is limited on OBD but it would allow anyone to just build a couple of components and test them on their own car without modifying it.

AstonJ

AstonJ

This is awesome! I used to build/race RC model cars in my teens!

It’s great to see you are using Nerves to build the underlying system - I reckon quite a few govts or organisations might be interested in funding projects that aim to dismantle vender lock-in..

Last Post!

lawik

lawik

Nerves Core Team

Awesome!

Where Next?

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...
2976 91332 914
New
byu
@chrismccord : I just saw the Extract AGENTS.md from Phoenix.new into phx.new generator commit to the phoenix project. My initial shotgu...
New
arcanemachine
I was working on an Ecto migration and I needed a timestamp. So, for the nth time, I looked up the different data types for timestamps, a...
New
AstonJ
Just a general thread to post chat/news/info relating to AI/ML stuff that may be relevant for Nx now or in the future. Got anything to sh...
New
type1fool
I just stumbled on a newly redesigned elixir-lang.org. :tada: It looks like @Software_Mansion did the work, and I think it is generally a...
New
juhalehtonen
There has been a thread to discuss the Stack Overflow Developer Survey on this forum every year since 2018, so here’s yet another one for...
New
alexslade
Fly’s CEO posted this recently - Turn And Face The Strange · The Fly Blog It says that Fly is going all-in on sprites, which is a worry ...
New

Other Trending Topics Top

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
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve. They are GUI (Emerge) and State management (S...
New
ausimian
Emily is an Elixir library that runs Nx computations on Apple’s MLX. Install it as the default Nx backend and Nx, defn, Axon, Nx.Serving,...
New
akoutmos
@hugobarauna and I (Alex Koutmos) have been hard at work on writing a book on Nerves that takes you from simply blinking LEDs to building...
New
bjorng
We want to introduce a new native datatype to Erlang: native records. Although replacing all tuple records with native records is not our...
New

We're in Beta

About us Mission Statement