Software apps and online services
Hand tools and fabrication machines
In this basic tutorial we’re going to learn how to make a simple water level detection for our Coffee Machine using UDOO NEO and the UDOO IoT Cloud platform.
Once you’ve done setting up the CLOUD with the UDOO NEO we can move on to the second step: the hardware setup. Let’s see the items you need to complete the task:
Materials needed in this step:
- UDOO NEO (already connected with the IOT CLOUD);
- Power Adapter 12V 3A;
- Funduino Water Level Sensor;
- Buzzer or LED;
- Jumper wires cables;
- Your Coffee Machine.
First of all we connect the Water Level Sensor to the Arduino Compatible Side of the UDOO NEO.
It’s a simple analog sensor you can connect to one of the analog input pins of the Arduino to check the water quantity inside a container.
The connection is really simple:
- S pin (signal) of the sensor to the A0 analog input Pin of the UDOO NEO
- - pin (GND) of the sensor to the GND of the UDOO NEO
- + pin (VCC) of the sensor to the 3.3V of the UDOO NEO
To recognise the 3 wires remember to use 3 different colors.
The water sensor returns a different value based on how much water is contained in the tank.
Now let’s add the actuator. We could use a simple digital LED connecting the Positive long led to the pin 12 and the negative short leg to the ground.
Of course you can replace the LED with whatever actuator you want to use, and since we are makers we decided to “enhance” one of the funny buzzers we have in the UDOO LAB. WE opened it with a screwdriver and solder 2 male male jumper wires to the 2 contact points, in this way every time the circuit will close the buzzer will buzz and lights up. Just like the “old” LED but with sound for a more effective feedback :)
The connection is the same as the LED above:
- + the positive wire to Arduino digital pin 12;
- - the negative wire to the GND of the UDOO NEO.
Finally we can power on the board. To test the sensor we placed it in a small glass then we added some water.
Go to udoo.cloud, enter with your credentials and you should find your UDOO NEO as gateway. If don’t, follow this guide of how to connect the NEO board with the UDOO IoT CLOUD platform. From the IoT CLOUD dashboard enter the UDOO NEO gateway.
We selected the Arduino device (Arduino - ttyMCC) embedded in the UDOO NEO to see all its details in the dedicated screen.
Selecting “Add New Sensor" we setup the analog water sensor though the popup displayed.
As soon as you press “save” the Water Level sensor will be detected: when it’s inside the water it shows a value of 400 or more but when it’s not the value drops drastically. We’ll use this value to setup the trigger to do the magic in a few moments.
Selecting “Add New Actuator" we setup the digital Alarm Buzzer through the popup displayed.
Now we add the trigger from the Triggers section to let the buzzer sound when the water level is lower than 200.
We set a trigger with this logic: IF the value of the Water Sensor is lower than 200 THEN use the Buzzer Actuator setting the value ON to 0 and the value OFF to 1.
As long as the trigger status is OFF nothing happens but when the status turns to ON, it means that the sensor is detecting a lower water value activating the buzzer.
Easy and useful.
Now let’s see our little prototype in action.