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

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..

Where Next?

Popular in Discussions Top

matthias_toepp
I’d love to hear what people think about Wisp, the new Gleam web framework started by Gleam’s primary creator Louis Pilfold. Gleam, alon...
New
PragTob
Hello everyone, I know we had quite some threads (read through lots of them) about background job processing but it remains a hotly deba...
New
WildYorkies
It seems that the more I read, the more I find Elixir users speaking about all the ways that Elixir is not good for x, y, and z use cases...
New
AstonJ
If a newbie asked you about Phoenix Contexts, how would you explain the basics to them? Feel free to be as concise or in-depth as you li...
New
mbenatti
Following https://github.com/tbrand/which_is_the_fastest |> https://raw.githubusercontent.com/tbrand/which_is_the_fastest/master/imgs...
New
AstonJ
I’ve just started the Phoenix part of the utterly brilliant online course by @pragdave. On generating the Phoenix app he uses the --no-ec...
New
AstonJ
Please see the new poll here: Which code editor or IDE do you use? (Poll) (2022 Edition) It’s been a while since we first asked this, I...
208 31142 143
New
saif
Hello everyone, Long time lurker first time poster here. I’ve recently begun working on Elixir full-time again! :raised_hands: It’s been...
New
New
100phlecs
Are there any downsides, like perf issues, to putting all functional components in CoreComponents as long as you prefix it with the conte...
New

Other popular topics Top

9mm
I am constructing a JSON object (map) and I need to conditionally set a field. I’m trying to write proper elixir-way code… and I’m at a l...
New
siddhant3030
Hi, I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New
lessless
I believe there are people here who are dealing with CSV files import on the daily basis, and since Excel is a really popular tool there ...
New
JeremM34
Hello, how can I check the Phoenix version ? Thanks !
New
johnnyicon
Hi all, I’ve just started learning Elixir and Phoenix Framework, so please pardon my n00bness at this stage. I’m trying to use Postgres...
New
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New
Brian
What is the proper way to load a module from a file in to IEX? In the python world, doing something like this pretty standard: from ....
New
AstonJ
We’ve put together this wiki for Phoenix LiveView - please feel free to add any info you feel is worth including. What is Phoenix LiveV...
New
vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New

We're in Beta

About us Mission Statement