Firmware to connect Sensors and Actuators

mfacen
Posts: 3
Joined: Thu Mar 20, 2025 7:06 am

Firmware to connect Sensors and Actuators

Postby mfacen » Sun Jul 27, 2025 12:16 am

I work for an ag-tech company designing equipment for shrimp production. For the past 8 years I have used Esp32 and Esp8266 in almost every project I designed, they are powerful devices and I love working with them. In 2024 we won Gold at the Edison Awards https://edisonawards.com/2024-winners/ with the Shrimpbox in the FOOD & AGRICULTURAL ADVANCEMENTS category, an automated system to grow shrimp in urban settings based on the footprint of a 40 ft shipping container, the main controller in it is an ESP32 running custom libraries that I have been developing for years for my projects. You can look for some videos of it on youtube. The code for it is still working on all Shrimpboxes but there was a lot of spaghetti code and patches in it as I started coding it when I had not a good understanding of memory management and the use of modern C++ features.
3D Rendering of Shrimpbox
WhatsApp Image 2020-03-20 at 8.12.25 PM.jpeg
WhatsApp Image 2020-03-20 at 8.12.25 PM.jpeg (100.68 KiB) Viewed 9477 times
ShrimpBox control center. The Esp32 controls 16 relays by Modbus and the 2 VFDs also by Modbus. Also has an ESP8266 device called Jellyfish that monitors the PH, Temperature and Salinity of the water.
WhatsApp Image 2025-07-26 at 5.56.29 PM.jpeg
WhatsApp Image 2025-07-26 at 5.56.29 PM.jpeg (186.05 KiB) Viewed 9477 times

Last year I started a new personal project based in what I learnt, I want to create some kits to build some cool gadgets but want to allow users to create objects in a dynamic way with the preinstalled firmware. My old libraries had all kinds of classes I could chose from at compilation time, the downside is that requires reprogramming the ic, I'm creating a firmware where the user can create the interfaces to build many different devices to make it easy for new users and maybe get interested in this kind of stuff. The firmware can run in ESP8266 and ESP32 development boards.
Image
The idea is that the user is going to be able to build many different devices with the same firmware just setting up different panels as inputs and outputs.

I'm working on a prototype for a gravimetric liquids dispenser based on the Esp8266 on a Wemos D1 Mini with a 12 volts pump driven through a transistor by PWM from D5 of the mini, a load cell connected to D0 and D8 and a push button to D7. I'm using the custom Firefly firmware to build this machine.

Liquids Dispenser 3D render
Liquids_Dispenser_3D.png
Liquids_Dispenser_3D.png (28.47 KiB) Viewed 9477 times
Prototype Video
https://youtu.be/bmZOhdgTDt0
Creating Dispenser Panels
https://youtu.be/s1iO_enHbHg
The website Im setting up for this project is critter-devices.com , in the documentation page there are links to download the firmware as zip files that include web and python installers, there is a version for esp8288 and one for esp32.
There are some examples on how to create panels here: https://www.critter-devices.com/wp-cont ... nels_2.pdf
I have a lot of work to do with documentation, if you want to try it and get stuck send me a msg and I'll help you out. If you have esptool.py running in your machine it should be easy to upload to your device check the instructions at https://www.critter-devices.com/wp-cont ... load_2.pdf

Happy programming !!!

Edit: I changed the title of the post as I'm posting mostly updates about the firmware in this thread.
Last edited by mfacen on Wed Oct 08, 2025 11:37 pm, edited 2 times in total.

mfacen
Posts: 3
Joined: Thu Mar 20, 2025 7:06 am

Re: Liquids Dispenser Application

Postby mfacen » Wed Sep 17, 2025 1:51 am

Hi! I have some updates since my last post.

- I created a simple web uploader to flash the firmware and now compile for both ESP8266 and ESP32 devices correctly. It makes trying the firmware very easy as there is no need for libraries or dependencies. https://mfacen.github.io/firefly-web-installer

- Created a list of Panels available ( not complete yet: https://www.critter-devices.com/wp-cont ... tion_1.pdf )

- The Interpreter in the Program panels is now working with basic syntax.

- Programs can reference other programs to create complex logic.

- Now you can create variables in the GUI and reference them in your programs.

- I created 2 system variables time (seconds) and millis (milliseconds) that can be used in programs.

- The Firefly firmware integrates seamlessly with the Tasmota protocol. The device automatically accepts POWER, DIMMER, and STATUS messages on its panels. The panel name becomes the device name in Tasmota, so it can be integrated into existing Node-RED or similar systems. This system is very powerful as the ESP can handle critical logic that doesn't depend on the network while also being commanded by Tasmota commands. Firefly Tasmota Documentation: https://www.critter-devices.com/wp-cont ... ration.pdf


For example, a critical pump that drains a basement can be controlled by Firefly so that even with no network it will still work, but in the presence of a network it can be managed both ways. Another advantage is that you can centralize multiple Tasmota devices in just one Firefly as each panel becomes its own device. For example, you could add to the Firefly's pump controller a pressure sensor and a flow sensor and integrate them into your Node-RED network.

Here is a list of sensors you can integrate:

Input Interfaces:
• BMP180: Atmospheric pressure sensor (I2C)
• DS18B20: Temperature sensor (OneWire)
• HX711: Weight/load cell sensor
• DHT11: Temperature and humidity sensor
• Analog Input: 0-3.3V analog sensors
• Digital Input: Switch and sensor states
• RPM Counters: For liquid flow sensors, hall effect sensors, etc.
• IR sensor: For Infra Red receivers
• US sensor: Ultra sound distance sensor.


Output Interfaces:
• Digital Output: For controlling relays, LEDs, actuators, etc.
• Servo Control: For controlling servo motors
• PWM Output: Implements PWM on specific pins for dimming, speed control

https://mfacen.github.io/firefly-web-installer
Attachments
Opera Snapshot_2025-09-16_191631_mfacen.github.io.png
Opera Snapshot_2025-09-16_191631_mfacen.github.io.png (56.81 KiB) Viewed 9236 times
Last edited by mfacen on Wed Sep 17, 2025 4:02 pm, edited 1 time in total.

Minatel
Espressif staff
Espressif staff
Posts: 433
Joined: Mon Jan 04, 2021 2:06 pm

Re: Liquids Dispenser Application

Postby Minatel » Wed Sep 17, 2025 11:40 am

That's amazing! Thank you for sharing your project journey, @mfacen.

mfacen
Posts: 3
Joined: Thu Mar 20, 2025 7:06 am

Re: Liquids Dispenser Application

Postby mfacen » Fri Oct 03, 2025 8:27 am

I added Home Assistant Auto Discovery features, now the panels you create in Firefly show automatically in the Home Assistant Dashboard.
Made a small video showing how it works: https://youtu.be/JSUjlUwRUj4
Also added a more flexible mqtt system with wildcards you can use to format the mqtt topic and payload. For now you can use:
$PANEL_NAME
$VALUE
$UNIT
$DEVICE_ID
$TIMESTAMP
$UNIX_TIME
$ISO_TIME
for example in the settings you can use:

mqtt_topic,stat/$PANEL_NAME/STATE
mqtt_message,$VALUE
for tasmota.

Also worked on the settings system now is easier to use as a text file to modify directly on the web app.

If someone wants to try it and give me feedback the installer is here for esp32 and esp8266: https://mfacen.github.io/firefly-web-installer
Almost all the examples are running in an ESP8266 and hence refer to pins as D0 to D8 but it all works the same if you run it on an esp32 the web interface shows IO numbers.
Attachments
You_Tube_Banner_HA.png
You_Tube_Banner_HA.png (670.64 KiB) Viewed 9077 times

Who is online

Users browsing this forum: ChatGPT-User and 1 guest