nkokkos

nkokkos

Hi everyone,

I decided to do my master thesis using nerves. Basically, the end product is a IoT device that connects to the local wifi and provides readings from an electrochemical C0 sensor through a web interface.

The CO sensor is an a professional sensor from Figaro, therefore I had to create an analog circuit on perfboard to capture the signal and then feed it into a breakout board I2C like asd1115 adc. I also use the breakout board bme680 since I need the temperature to do re-calibration of the sensor using a look up table. I also use the nerves key to do some sort of data push to an IoT platform. I plan to use the nerves cloud too. And finally I plan to use homex to push the data to a home assistant installation.

Most of the things used in the thesis/project have been covered here in the forum, plus in some nerves books that have been published. Through my research, no elixir nerves has been used before in thesis project in our department, so I suggested this proposal and my advisor gave me the ok.

In a nutshell, this is what this project does:

Uses a rasberry pi zero wireless, that connects to the perfboard where the CO sensor and the breakout boards are installed. Gets all the readings, provides all the readings through a poncho project using a web interface, pushes the data to an IoT platform and a local home assistant setup.

The most intriguing part was building the analog circuit interfacing the CO sensor since I had to go back to my undergraduate days and read all about operational amplifiers and low pass filters and all that.

I have started writing the code/firmware and the more I read and learn about nerves, the more amazed I become. Frank and all the people involved with nerves and the hex libraries have done a remarkable job and I thank you all. The documentation is so good.

This thesis is not rocket science but anyway I plan to release everything (source code and perfboard design) as a tutorial series, time willing.

Thank you for nerves!

Showing Posts 1 to 8

lawik

lawik

Nerves Core Team

Delightful! Please keep us updated in this thread and share pictures :slight_smile:

ssd

ssd

Sounds Interesting! We’re working on an IoT cloud platform called Fostrom built using Elixir, and we even have an Elixir SDK that works with Nerves out of the box. If you find it useful, I’m happy to help you set it up for pushing the sensor data to the cloud.

Good luck!

nkokkos

nkokkos OP

Thank you. I will try it!

nkokkos

nkokkos OP

Hi, I am uploading some pictures from the progress I have done so far.

The i2c breakout boards used are the bme680, the nerves key, and a cheap ads1115 adc,

The idea was to take an electrochemical sensor like the figaro tgs5042, which outputs a tiny current and superimpose it using an analog circuit based on an application note, and then pass the voltage produced to one of the adc inputs of the ads1115. I also use the bme680 to measure the temperature, since the temperature is used for a correction factor while calculating the CO ppm range.

I started with the idea to lay everything on a perfboard to reduce EMI but it turned out that was silly. So I kept the i2c boards on a breadboard and the analog part on a perfboard. Got really frustrated with the dupont cables and their connections.

I am currently running on the very first rpi0, one core cpu, sampling the inputs of the ads1115, doing median filtering to remove emi noise and pushing data to liveview using the classic poncho scheme. Code is almost complete and I was impressed that it worked. I am currently doing experiments now with measurements and I will provide a link to github in short time.

On the breadboard, you can see that I had to use coupling capacitors before the inputs. Coupling capacitors are used also on the perfboard to stabilize the voltage source

nkokkos

nkokkos OP

Hi, I tried it and if I remember well it won’t compile for my target, which is the very first rpi0, of 2017. That’s the board I am using.

arjunbajaj

arjunbajaj

Hey @nkokkos, I’m Arjun from Fostrom here.

We do have binaries for ARMv6, and we do test on Pi Zeros ourselves too.

It seems we possibly have a bug in the way the Device SDK downloads our Device Agent binary, related to the cross compiling environment of Nerves. I’ll fix and test it and get back to you soon.

nkokkos

nkokkos OP

I used Docs | ThingsBoard Cloud (EU) , the free version, along with the this mqtt broker {:tortoise, "~> 0.10"}, and I just could not believe how easy it was to transfer the readings.

nkokkos

nkokkos OP

We did some real tests today at the university’s chemistry lab. The screen shots show the phoenix liveview page running on rasberry pi zero wireless sampling every 15 seconds. You can see the CO ppm shoot up at some point and back down again. These are all simple liveview pages, nothing fancy, but it was really exciting to see the immediate response from the sensor.

By the way, I found on youtube this https://www.youtube.com/watch?v=f0VPFwnBOO0 where the guy dissects a classic CO domestic which uses the tgs5042.

— All posts loaded —

Where Next? Top

Trending in Discussions Top

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
mhanberg
Hi everyone! The first release candidate for the Expert language server project is now available! We’ve published a press release detai...
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
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
achempion
I’ve been using Emacs as my main code editor for more than a two years. It’s a custom build version although I’ve tried doom emacs and sp...
New
budgie
I love Elixir. It’s one of 2 programming languages I’ve ever fallen in love with. But I don’t use it anymore. Serverless was the promis...
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
garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
mcass19
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
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

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews