Coming soon - Get a detailed view of why an account is flagged as spam!
view details

This post has been de-listed

It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.

1
Help debugging my Coffee-Maker Filling Contraption... It Overflows.
Post Body

A year or so ago I made this beautiful device. It lives under my kitchen counter. The wire with the green heat-shrink leads to a button. Pressing the button starts the water. The water comes in from the white tube on the right, the round thing is a little flowmeter waterwheel that measures the water, and the solenoid controls the flow.

The code is here: https://pastebin.com/1xPHa6NM

The problem is that once in a while, about one time in 100, the water doesn't stop.

It is supposed to stop after the "requested_amount" is reached. In case it doesn't, it's also supposed to stop if the button is pressed again. This works most of the time, but not always. Sometimes it just keeps going and I have to use a little manual valve to physically stop the water flow. No good.

https://preview.redd.it/exl2ij6ek4fb1.jpg?width=2283&format=pjpg&auto=webp&s=dc3eff3f2ec800a520f82b16db18088e7950842d

I can't figure out how to save the logs so that I can read them later. But I have just figured out how to capture the "status" updates that get sent via MQTT. It looks like this when the water starts and stops correctly:

https://preview.redd.it/yzaspt8765fb1.png?width=972&format=png&auto=webp&s=b0f3d433caf799fd28e1cbec7eb62db54f859d4a

So... troubleshooting. How do I go about figuring out what the problem is?

  1. How can I read the logs after the fact? Would that help?
  2. How can I send more useful information via mqtt?
  3. Are there any flaws in my code that would somehow cause this?
  4. What else would you recommend?

Are my expectations too high? I mean, there must be millions of beverage dispensers out there that start at the push of a button, measure out a pre-determined amount of liquid and then shut off reliably.

Flowmeter: https://www.amazon.com/gp/product/B08ZD85CSK

Solenoid Valve: https://www.amazon.com/gp/product/B016MP1HX0

I'd appreciate any advice. I've come so far with this project, but this is a pretty fatal flaw. Thank you!

If you're curious, it takes 3200 pulses to fill my coffee machine. The reason I have it as a variable coming from home assistant instead of hard-coded is that I want to build a v2 of the device where I can request any amount of water. (I can calculate for example that a cup of water would be 448 pulses of water).

Author
Account Strength
100%
Account Age
12 years
Verified Email
Yes
Verified Flair
No
Total Karma
8,673
Link Karma
533
Comment Karma
8,095
Profile updated: 6 days ago
Posts updated: 2 months ago

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
1 year ago