Food Device Design Derby Challenge: JavAqua!


Nothing like a cup of Java first thing in the morning to get your creative juices going. However, I am too lazy to fill the water container in our coffee maker multiple times a day. So, I made JavAqua.

Hi, my name is Masoud Hamidian. My day job is in healthcare but electronics has been my primary hobby since I was a little kid and I’ve been making things since childhood. JavAqua is an automatic coffee maker water container fill device. It monitors the height of the water column in the coffee maker using a hydrostatic resistive sensor (eTape sensor) and based on the configurable water height levels, it will fill the water container to the desired level. It includes a menu system through an OLED screen and buttons for managing activity and preset levels.

There are other cheap kits available on amazon and elsewhere for this purpose that are just basic float valves which are primitive and dangerous. If the valve gets stuck there is a real risk of flooding. JavAqua, on the other hand has several safety features that reduce that risk significantly.



The system is comprised of a single PCB that contains all the components, buttons, OLED screen and connectors for power, water level sensor, water flow sensor and the solenoid valves. The PCB, flow meter and solenoid valves are mounted in a plastic enclosure with cutouts for water input and output hoses, power connector, buttons and the OLED screen. The buttons and the OLED screen are covered by a 3D printed face bezel for aesthetics. The water level sensor is placed within the coffee maker water container and connected to the box via a 3-wire cable. The water input hose is connected through a water filter to the house water system (usually a tap from the refrigerator ice maker water pipe). The water output hose is routed inside the coffee make water container attached to the side of the water level sensor.


The heart of the system is the Atmel (Microchip) SAMD21G18 ARM Cortex M0, 48 pin MCU. Its inputs are the water level sensor, a water flow meter, menu buttons and configuration data saved on the SAMD21’s flash. The MCU is programmed via an on board SWD connector.

Water Level Sensor

The water flow control is by two separate solenoid water valves (stage 1 & 2) controlled by the MCU via power MOSFETs. The operation of each valve stage is monitored separately during each fill cycle to ensure that a single defective valve does not cause flooding.


Power to the device is supplied by a 12V DC adapter (wall wart) that plugs in the back of the box to a 12V barrel jack. This feeds an LM1117 3.3V regulator that supplies the main board, screen and the sensors. The solenoids are powered by 12V via the aforementioned MOSFETs.

Back Connections


The firmware is written in C/C++. In a loop it will check the water level, if it goes below the preset low level, it will open the stage 1 valve, make sure there is still no flow (verifies integrity of the stage 2 valve in the closed state), opens stage 2 valve, verifies good water flow (verifies integrity of both stages 1&2 valves in the open state), monitors and verifies water level rising per learned and stored timing values. If it detects that the water has been on and flowing too long (per learned timing values from past fill cycles), it shuts the valves and displays an error message (helps to detect pipe or container leaks). Once the water level reaches the preset high value it will close stage 1 valve and checks for no flow (verifies integrity of the stage 1 valve in the closed state) then closes stage 2 valve. If a defect is detected in either valve stages it will shut both valves off and display an error on the screen and the status LED.

Stage 1 solenoid valve control is via an active low GPIO pin that controls an N-Fet that turns on a 12V P-Fet which activates the solenoid. However, in case of a failure in a situation that even the MCU was completely fried and not operational enough to activate it’s watch dog timer, to help reduce the risk of flooding, the stage 2 valve is controlled with a MOSFET activated by a hardware circuit fed by a square wave signal from the MCU. The point of the square wave signal (which is generated in a bit-bang fashion by the firmware) is only to indicate that the MCU is alive and running. Through this circuit the solenoid to the stage 2 valve will be opened only if the input to the circuit is an active 1Hz square wave signal (implying that the MCU is operational). If the MCU stops for whatever reason, the square wave signal will be stuck in a high or low state, either of which will shut the valve off.

The user interface consists of a an inexpensive 128x64 I2C OLED from Amazon, 3 push buttons for the menu system and an RGB status LED. On power up, a splash screen logo is displayed and then the main screen is displayed with the system in Pause Mode.

Splash Screen

The main screen display is divided into 3 separate areas. On the right there is a bar graph that shows the water level. In the lower portion, the solid bar indicates the base water level (the minimum water level in the tank at all times). The shaded bar above this solid bar is the current water level.

In the middle of the screen is the current status area. A graphics display there shows the current status graphically or an informational or error text message.

Pause icon indicates it is in Pause Mode. Water level sensor is active and levels are displayed but no action is taken.

Pause Mode

Hourglass animated icon indicates it is in Run Mode in which the system is waiting on an event to take action (i.e. Brew cycle or low water level prompting a Refill Cycle).

Run Mode

Steaming mug animated icon indicates it is in Brew Mode which means it has sensed the water level dropping.

Brew Mode

Water drop animated icon indicates it is in Refill Mode. Water container is filled until the preset high level has reached.

Refill Mode

On the right hand side of the screen there is a recessed RESET button. Just below this is the status RGB LED:

Solid Blue indicates run mode, in which the system is monitoring water level and ready to take action.

Breathing Green indicates pause mode when no action is taken regardless of water level.

Flashing Red indicated an error.

In the left portion of the screen are 3 blocks that indicate the current function of each of the buttons which are located just left of the screen.

The top button is the run-pause mode button that changes current mode to run or pause mode.

The middle button is the configuration button that activates the water level setup mode where you can select high and low water levels.

On the bottom is the power button that turns the system on or off.

The screen display has a 10-minute timeout screen saver that turns the display off after the last activity. The system is still fully active with the screen off. Pressing any of the buttons, starting a brew cycle or activation of a fill cycle will automatically turn the screen back on.

Post Notes
Unfortunately, due to lack of time I have not updated the firmware in this at all since I fully deployed it. There are a few minor known bugs and a ton of enhancements that I would love to do to this design but life (and other projects) get in the way!


So sorry about the (lack of) quality of the videos! My video production and lighting equipment is limited to my phone \|/


Video-Brew Cycle

Video-Brew/Fill Cycle

Design Documents

Thanks for the entry Sehnsucht!