Wort Warden is a little device that measures the progress of beer fermentation from within the fermentation vessel.
It's heavely inspired on the iSpindel, which in turn is based on the Tilt Hydrometer.
Although similar, this model is simpler, since it's using both a I2C gyrometer and an I2C thermometer. The code base is simpler than the iSpindel, since it's based on NodeMCU.
I hope the installation process will be simpler as well, but that remains to be seen :).
- Wemos D1 mini
- Gyroscope: GY-521 MPU-6050 breakout board (Datasheet, Register map)
- NCR18650B Rechargeable Li-ion Battery (3.7 V)
- TP4056 Lithium Battery Charger Module
- Battery holder
- PETling XXL tube
If the temperature reading from the GY-521 are not accurate enough we can always resort to a MCP9808 breakout board.
The first thing to know is that you should have
- A Unix machine (Linux, MacOS)
- Lua 5.1 or newer
- Python 3 (I'm using 3.7 currently)
- Oh, and GNU Make, our build system
- Docker, to support the firmware build process
- CH340 drivers, to communicate with the Wemos device over USB
- Optionally, Fritzing, to view the schematics
Next, adapt the configuration for your (home) environment:
cp src/config-example.lua src/config.lua
And edit the file to match your home WiFi and a Ubidots device token, although you can do the last one later as well.
Once you have that set up, you can run some tests:
make test
This should execute the local unit tests. Very handy if you feel the need to change the software.
If you have your Wemos board plugged into the computer, you can flash it with NodeMCU:
make flash
This will download the NodeMCU sources (the master branch) and build the firmware containing only the required modules.
After the device is set up with the right firmware you should be able to connect to it:
make tty
This should open a TTY connection to the device. If you're using Linux you may need to change the SERIAL_PORT
in the Makefile.
Now you can type some Lua code in the console:
> print('Hello world')
Terminate the session with the key combo Ctrl-]
.
To upload the application onto the device, a simple
make upload
will suffice. There are some other commands available from the Makefile. You can get a summary by typing:
make help
That should be enough to get you started.
The application itself will deep sleep for a period of time before waking. If the reset button is pressed,
the application will wake up (boot reason 5
). If a reset is pressed shortly after, the device will reboot
again (boot reason 6
) and will end up in developer/debug mode.
The application itself makes heavy use of Lua's coroutines. This makes it possible to perform multiple tasks (e.g. setting up wifi and I2C) simultaniously. Through the scheduler, the coroutines can send messages to each other, kinda like actors.
The application is set up to send data to Ubidots (for education) over MQTT. Once you have an account, you can create a new device. This device will be assigned an API token, which can be found under "API credentials".
Backlog:
- Set up development environment
- Deploy minimal app to Wemos board
- Test WIFI, deep sleep
- Test I2C
- Create a toggle to start into dev mode -> Use the reset button
- Disable unused modules in
app/include/user_modules.h
- Test without modifications with a small USB charger
- Build everything into the PETling tube - use foamboard for starters
- Should the I2C device be connected to vdd or to a pin, so it can be really shut off.
- Create a simple construction so I get the same readings for fermentations
- Calibrate vessel
Technical notes: