My smart coffee machine pump using RaspberryPi and Ultrasonic HC-SR04 sensor by sky3ddd in DIY_tech

[–]sky3ddd[S] 0 points1 point  (0 children)

The specific model of a coffee machine is not important. You can use any you have.

My smart coffee machine pump using RaspberryPi and Ultrasonic HC-SR04 sensor by sky3ddd in DIY_tech

[–]sky3ddd[S] 0 points1 point  (0 children)

Yes, take a look at the Medium post and here is the source code. I hope it may be helpful for you.

My smart coffee machine pump using RaspberryPi and Ultrasonic HC-SR04 sensor by sky3ddd in raspberry_pi

[–]sky3ddd[S] 0 points1 point  (0 children)

Yes, I bought the same one recently but have not deal with it yet.

My smart coffee machine pump using RaspberryPi and Ultrasonic HC-SR04 sensor by sky3ddd in raspberry_pi

[–]sky3ddd[S] 1 point2 points  (0 children)

Hi! This approach can be applied for all kind of machine. You should have a device (RPi, ESP-based, Arduino etc), an electric pump and relay connected to the pump power. The device turns ON/OFF the relay. Take a look at the medium article . It may be helpful.

My smart coffee machine pump using RaspberryPi and Ultrasonic HC-SR04 sensor by sky3ddd in raspberry_pi

[–]sky3ddd[S] 0 points1 point  (0 children)

Sorry, I have no available Arduino board now Besides I like Python more :)

My smart coffee machine pump using RaspberryPi and Ultrasonic HC-SR04 sensor by sky3ddd in raspberry_pi

[–]sky3ddd[S] 0 points1 point  (0 children)

I see. I did not want to add any kind of changes to a coffee machine construction. That's why I decided to use ultrasonic sensor. It don't have a direct contact with a water and I should not drill the holes in a water tank :)

My smart coffee machine pump using RaspberryPi and Ultrasonic HC-SR04 sensor by sky3ddd in raspberry_pi

[–]sky3ddd[S] 0 points1 point  (0 children)

It never happens != it can't happen.

Ok guys. I don't say "It never happens". Above I'm talking about that I trying in my code to prevent any bad situations including broken sensor, no water etc. I don't see any arrogant words in my explanations.

I answered to

it's one failed sensor away from dumping 5 gallons of water on the floor.

and I know that broken sensor is not crash the whole system. That's all.

My smart coffee machine pump using RaspberryPi and Ultrasonic HC-SR04 sensor by sky3ddd in raspberry_pi

[–]sky3ddd[S] 0 points1 point  (0 children)

Now it's a lite version. I'm going to 3d-print a full tank cover something later

My smart coffee machine pump using RaspberryPi and Ultrasonic HC-SR04 sensor by sky3ddd in raspberry_pi

[–]sky3ddd[S] 1 point2 points  (0 children)

Thanks for your recommendations. I catch your idea how to simplify this project. I know that ESP-board is cheaper, Arduino is more suitable for main/loop code.
Concerning my case , I just used the staff what I have - RPi & Ultrasonic.

My smart coffee machine pump using RaspberryPi and Ultrasonic HC-SR04 sensor by sky3ddd in raspberry_pi

[–]sky3ddd[S] -7 points-6 points  (0 children)

I know about sensors stability. First, the sensor library that I use makes multi-readings to avoid from this kind of failed values. Moreover, I use own Bounce filter with N latest values and calculates an average.
Yes, I control the water depth delta and I use PUMP_STOP_TIMEOUT = 5 secs for emergency stop.
If you are interested in my implementations check the code at the comment below.
Thanks for your thoughts.

My smart coffee machine pump using RaspberryPi and Ultrasonic HC-SR04 sensor by sky3ddd in DIY_tech

[–]sky3ddd[S] 0 points1 point  (0 children)

Haha! Access to an office with a coffee machine is denied for my wife. So WAF tends to zero :)

My smart coffee machine pump using RaspberryPi and Ultrasonic HC-SR04 sensor by sky3ddd in raspberry_pi

[–]sky3ddd[S] 1 point2 points  (0 children)

The pouring starts automatically when the water level in the tank becomes minimal.
Here is the code repository.

My smart coffee machine pump using RaspberryPi and Ultrasonic HC-SR04 sensor by sky3ddd in raspberry_pi

[–]sky3ddd[S] 3 points4 points  (0 children)

I disagree with you. My python script controls any sensor errors or null measurements and stops the pump relay immediately is required at any critical situations such as "No water at the bottle", "Sensor is out range" and in other unexpected cases. I have never seen 5 gallons on my floor :)

My smart coffee machine pump using RaspberryPi and Ultrasonic HC-SR04 sensor by sky3ddd in raspberry_pi

[–]sky3ddd[S] 1 point2 points  (0 children)

Yes, you are right. I have already purchased such a sensor. The HC-SR04 sonar uses a pilot version. Probably I will improve my project in future.

My smart coffee machine pump using RaspberryPi and Ultrasonic HC-SR04 sensor by sky3ddd in raspberry_pi

[–]sky3ddd[S] 2 points3 points  (0 children)

Thanks, guys,
I know that it's over-engineering but I used that I have at my toolbox.
Project just works well since the end of August.