Link to the Node Red Frontend:!/1?socketid=OTC8FF4AVJaE0EMhAABM


An average adult needs to consume 3-4 L of water daily for their general well-being. But, with our fast-paced lifestyle, we often forget to consume ample water. This affects our health and our general well-being. The problem of daily water consumption and the need to remind people about drinking water has inspired us to design this project.

What it does

Our project keeps a log of the daily water consumption and reminds the user to drink water on a periodic basis. The prototype utilizes the temperature and humidity values to determine the required amount of water to be consumed. It monitors the weight of the water flask to determine if the user has consumed water and then reminds the user t drink water at fixed intervals. The user can adjust the water threshold level based on his needs.

How we built it

We started the project by designing our custom-built PCB in Altium and then developing the libraries for the sensors in Free RTOS and developing the web user interface. Our PCB was designed in Altium, a PCB design software. We designed the schematics and libraries for the various components on our PCB. The power supply was handled using power converters that we designed using TI Webench and the MCU pin configurations were designed with the help of Atmel Board.

The PCB board layout was done in Altium after we finalized the schematics and the layout. We designed the board from the ground up keeping into consideration the rules and layout restrains especially for the power converters. We used the best practices for PCB designing while developing the board, such as putting in jumper resistors to isolate different circuits, fiducials for board assembly, etc.

We integrated several different sensors to our PCB. The Load cell IC which uses GPIO pins to communicate with the MCU was used. It has its own clock and measures the weight at fixed intervals, which determine the weight of the water flask at regular intervals and thus determines the amount of water that the user has consumed. The Temperature and Humidity sensor which uses I2C to communicate via the SDA and SCl lines is used to determine the temperature and humidity of the room. The sensor is powered at 3.3V and is directly powered by the MCU. Finally, we used a potentiometer that uses the ADC pin and adjusts the voltage reading based on the position of the divider pin. Potentiometer helps the user to adjust the threshold value of the water level consumption. The sensor drivers were created using the HAL and then the sensors were calibrated to get the accurate measurements. We then implemented a boot-loader that downloads a binary a file from the internet and then updates the firmware based on the binary file. Finally, we leveraged the WiFi connection to the internet to reach the MQTT broker using Node Red. We subscribed to a single topic for receiving information from the MCU. The data from the sensors was sent to the Node Red using the MQTT broker as strings and was then parsed to receive information which was then displayed on the Node Red Fronted that we designed. The user could view parameters like temperature, humidity, water level and the water threshold level.

The overall design for this project was put together and individual segments were designed and tested. Such an approach allowed us to develop individual functions and test their behavior before integrating them. Due to chip shortage problems and time constrain, we could not implement the program onto our PCB, thus we deployed the project using development boards.

Challenges we ran into

With the ongoing chip shortage, it was difficult to get the parts sourced to design the PCB in such a short time. This was the most challenging aspect of designing the project. There was also the problem of the design of power converters as they require particular lay-outing techniques that are specified by the manufacturer. Hence, we needed to make the power converter circuit to be of particular orientation, such as the capacitors and the feedback circuits need to be attached close to the IC with short traces. Another problem that we did encounter was with the initial interfacing of sensors using FreeRTOS. The design of drivers using HAL and then testing with sensors was challenging as during initial testing we found out that the values we were getting were not accurate.We had to calibrate the sensors later on which was another problem that we did encounter. Designing the MQTT and Node-Red cloud interface to send data from the micro controller to the online platform also posed a challenge as the data was not being received by the server and the changes in the variables values were not being updated by the server to the front end accurately.

Accomplishments that we're proud of

We are proud of designing our own PCB from the ground up and to have experienced the process that is used in the industry to design PCB s. Also, using HAL and Free RTOS to design drivers for the sensors and then using an online cloud platform using Node Red and MQTT to control and send data from the micro controller to the net is something that was new to us and we are proud of designing the firmware part of the project.

What we learned

We learned about designing our own PCB from the ground up using Altium design software, in which we designed the libraries and the schematics for the PCB board and later sourced all the components that are required for manufacturing our PCB. By designing our own PCB we became adept at working on Altium and learned the process flow that is used in the industry to design a PCB. We learned to use the HAL to generate the drivers for sensors(sometimes from scratch) and to use Free RTOS to design the firmware aspect of the project. At last, we learned to use the Node-Red and MQTT to send data from the micro controller to the online cloud platform.

What's next for Poseidon

There are several key things that we would like to implement in our project. We would like to use a more secure method than the public MQTT broker for data transfer. Additionally, we would like to use a more secure hardware and WiFi such that the data is still secure even after tampering with it. The main reason for doing this is because the data that we are using is of sensitive nature and we would like to keep the water consumption data of an individual to be secure. Another aspect that we would like to work on is to make the UI and the Node-Red design to be more interactive and allow for a better user experience. We would also like to implement a water dispensing system that complements the project using servo motors, valves and flow rate sensors that would make a more complete project.

Built With

Share this project: