i built the world's worst IOT coffee machine
Вставка
- Опубліковано 15 січ 2025
- ⚠️ DONT TRY THIS AT HOME! 120V AC IS DANGEROUS! RISK OF ELECTRICAL HAZARD! ⚠️
Regular coffee machines are BORING. Sure, you can get a coffee machine with a timer built in, but they're EXPENSIVE.
In this video, I use an ESP32 to wirelessly enable my coffee machine. I write a light-weight HTTP server that lets my phone connect to the ESP32, and power-on the coffee machine using an AC-DC relay and a simple GPIO pin.
🔥🔥🔥 SOCIALS 🔥🔥🔥
Low Level Merch!: www.linktr.ee/...
Follow me on Twitter: / lowleveltweets
Follow me on Twitch: / lowlevellearning
Join me on Discord!: / discord
Kudos for implementing the web server yourself and not using a library, that is very appreciated. However hotlinking a binary resource off Wikipedia is questionable 😂
ONLY HAS TO WORK ONCE LOL
@@LowLevelTV Hey! Maybe if that's just an SVG you can copy-paste the HTML/SVG code into your program. It should be lightweight enough :)
@@aaaa9r Agree, he should've made a scraper to get the image
@@rawallon Or...You know... Copy paste SVG itself?
There's zero need for scraper, and I think you're saying things just to say...
@@brxne Or...You know... Just don't take things too seriously, and I think you didn't undertood that I'm mocking his ability to overengineer
I would be so afraid of a bug that would let the machine on and set my house on fire
LMFAO EXACTLY DUDE
Yes! Bugs are bugs and it can harm you, depending on the project. Implementing a timer and a temp sensor on your code is a good idea... well, your imagination is the limit!
Given that all he did was replace the power switch, you could encapsulate the ESP and relay in a box so that it was effectively an ESP controlled outlet and plug the unmodified coffee maker into that. That might be a bit safer. Certainly UL certification and similar should mean that the coffee maker shouldn't actually catch fire just from leaving it on. But, like someone else said, I could imagine leaving it on while empty might shorten its life. Especially if it's super cheap.
This also has the advantage that if you only turn on the manual switch when the coffee maker has water and grounds in it, the relay can switch on accidentally, but it won't do anything if you didn't set up the machine and switch it on.
I have an ESP32 and I can tell you from experience that it crashes sometimes when you leave it on for several days. It is recommended to add a watchdog in the code to make it restart when it crashes.
Lol, I'd be afraid of an actual bug getting in there.
I always wanted to do this, but since I don't have an EE background, I never had the courage to mess with real appliances, like a coffee machine, since I'm not really adept in electronics. But this video was extremely helpful, so I might try to replicate it!
Lol same
I suggest that you use a SonOff Mini. It has the ESP and a relay in an electrician-approved package that surprisingly small for being able to handle AC. Instead of all the soldering, it would just be some screw terminals. I converted a high-voltage lamp with one of those.
I use this exact coffee machine with a Sonoff S31 lite ZB outlet to just turn it on for 6-8 mins and turn off. When it turns off it plays an alert on my alexa devices.
I was hoping the creator of this vid was going to use the esp32 to control water temps for some extra dank dialed in coffee on a cheap machine.
and good. If u think u can/should build electronics projects that can end up in fire - try to build few 'safer' projects - and u will change your mind.
Writing code that works isn't hard. Hard is trying write code that is safe when it stops working. No timout for wifi connection? Sorry then this heating element that sucks 20A will stay on then.. Or u don't put all relays to low after boot because it's not neccesery at first glance? Then when project crashes some relay could stay on.. And so many other things that works good in 99,9% cases.. And for working with things like coffee machine u need to know a lot more then just software.
Things like don't using cable connectors for relay will not show u any cons at the beggining, but after months/years cable will lose contact surface and there will be sparking.. A lot of houses burned because of little things that 'experienced' electricians forgot to do. If u still want, read electrician code - don't even try to replicate youtube videos made by shady dudes (u can watch videos explaining why they are so, so bad)
I like the part where you forget to put water and fresh grounds into the coffee pot and you wake up in the morning with no coffee and then proceed to crack your hot decanter when you try to fill it with cold water.
I found your channel while studying for an exam and I've loved you since. You put some really quality work out there that I can't stop watching
Welcome aboard!
"Nothing is worse than waking up" should have ended I there
This is exactly what I expected. This is amazing! I'm currently trying to make a furnace for melting metal and this showed me basically everything I needed. Thank you and enjoy your coffee!
Great hack!
Have you considered any upgrade concerning HTCPCP protocol support ? Always nice to implement this functionnal joke
I was thinking the same. I laughted pretty loud when RFC2324 was released :)
To those who dont know:
HyperText Coffee Pot Control Protocal
Safety warning! Live high voltage wires, potential issues if no water in pot or it fails to turn off. No led means no visual indicator of power.
Bimetal thermal protection can be seen at 1:04. He just replaced one switch for another.
Why not leave the manual switch and put a relay in parallel, so you can choose whether to have it automated or manual?
I like to live dangerously
@@LowLevelTV naughty
@@LowLevelTV *house sets on fire*
if you have them in parallel you wouldn't have much control as u would need to turn it off from both the switch and the server for it to actually turn off.
but what a better solution is hooking the switch to the esp32 and use the signal from switch to also control the relay.
Good hack. And you made it look like something even I could do. Thanks.
Glad to help
I hacked my gelato machine with an ESP32 too 😅 with torque sensing capability to figure out when the gelato is ready.
TIL there is such a thing as a gelato machine, and now I want one.
@@criptych OK maybe I should consider making a video then :)
Last time I used a relay, I almost blew up my university's computer but yeah, they're really useful and awesome
Now to fit the ESP32 into the coffee machine and tap the same power input, so just one plug.
Yes my thought exactly. (Other than why not spend the 5 buck on a alexa/home assist plug - and routines. Although i do understand the maker spirit i feel it has do do more :-))
Why 5V Relay, not a 3.3V Relay? Things that are fun to add: Check to see if there is water (Weight sensor), Check to see if coffee has been replaced (Button attach to the coffee grind's lid, and the ESP32 keeps track that the coffee grind's lid has been open since it brewed the last coffee), coffee pot detector - Simple IR proximity sensor, Anit-Fire hack - Temperature check.
Most 5V stuff like relays can be controlled with 3,3V signalling. Just don't think that your ESP32 will survive 5V into its data pins - it probably won't and you may get some magic smoke. Same applies to a raspberry pi and virtually every microcontroller these days.
@@roysigurdkarlsbakk3842 It is bad practice to use a 5V item when use are only using 3.3V to control it. When you use an item out of spec, it make not alway work or stop working over time. I can see using an out-of-spec part, when you already have the part and do not want to spend money on buying the right item.
@@andyniemic4597 I didn't say it was optimal, but it sure works. Better use it temporarily, though. Some new 3,3V relays won't cost much.
The relay he used has a high level range of 12 to 2 volts ( at least mine did and it looked the same as one in the video)
In that board, in between the input pin and the relay there's an **optocoupler** , this means that it's not the output pin from the ESP32 that is powering the relay, the GPIOs of the ESP32 have a low power output and you should not go beyond it's specs to not risk damaging it
The optocoupler uses the 5V separately to activate the relay, and uses the input connected to the ESP32 just as an input signal and nothing else
That board have three connections, DC+(5v), DC-(GND) and IN (signal, which works fine using 3.3v)
Some relay boards don't have the optocoupler, but it is good to buy the ones that have it, both for isolating the two circuits and protecting the microcontroller output pins
That is awesome i never thought of that for a coffee machine with a timer built in.
this is what i live for, projects like these are the best
Incredible production value! Such a cool idea, the sky is the limit for you man!
The fact that you did not use Hyper Text Coffee Pot Control Protocol is disappointing and my day has been ruined
Nice 'smart' coffee maker, you forgot the bit where it sells your data to Facebook 💩
I will not be Zucked.
Wiring the switch in parallel to the relay and keeping the original swwitch would have been a better idea. Also some way to detect if someone was or had been brewing coffee already in the last two hours
Now, add a solenoid to your plumbing, and automatically add fresh water back into the reservoir. Then make a device that readies up a new filter with coffee grounds.
Whoa there mr bunker builder!
After he drinks the coffee, he's already awake and can do all that. It'd be better to spend those efforts grinding fresh beans automatically, so they don't go stale overnight. That's the biggest problem with this kind of coffee maker timer (the grounds aren't fresh, and sit out all night).
Now you can use shortcuts on your iPhone to automatic send a request to your webserver when you wake up
Cool! I use an Ikea tradfri outlet that i plug my coffee maker into. Not home made, but works.
Back in my university ages, me and my friends created something like that, but using LED strip instead of coffee machine and using various voice assistants instead of going to http server from phone.
I believe, you already know it, but you can use MQTT protocol for things like that. Don't know why, but you can)
Now you just need the tiniest Raspberry to put inside the frame out of sight and teach the coffee machine to grind fresh beans on the spot.
Why not using a WiFi-adapter, controlled by phone, to switch the whole coffee machine On or Off. It‘s just Plug‘n Play without any dangerous DIY.
you need more videos they’re great!
I was going to do this exact same thing with a raspberry pi but got spooked at the voltage and stopped there 😂
Wow, this is amazing, a good point to start embedding system learning.
Last time I tried to use cheap relays to control higher voltage circuits - I had problems switching it off, induction currents kept the relay closed. Does your relay turn of easily?
Yup! I’ve had no issues getting it to open again.
Why did you used cheap relays?
I had cheap reasons, obviously
After thinking about this for a minute, are you grounding the other side of your digital input?
of course
Love the uncrimped live wires that are sticking out at the end of the video.
Do you know that you've could use optocoupler module instead of relay to silently do the same task and using much less space and much less power to activate it?
ESP32 I/O pins are not 5V tolerant so you should add a resister and transistor to the output to drive the relay from the 5V supply. Or maybe that relay board has that?
Imagine if your coffee machine gets actually hacked where people can turn on your coffee machine without your consent
you can actually short cut the switch and use a existed smart plug. then you’ll have much more cleaner user interface
or, build a switch on the coffee machine.
Ahh... Into the quircky electronics DIY realm we go
The coffee grind is sitting the whole night in the coffee machine? If this is the case, doesn't the coffee loose flavor? How about adding a grinder to the machine that grinds it just before, like those big Italian coffee machines?
Yes, this is the biggest problem with this kind of coffee maker. He stepped over a quarter to pick up a nickel.
ua-cam.com/video/4V0a9dfkx9Q/v-deo.html
Have you considered using a Shortcut on your phone to automatically bring you to the correct webpage? It might be easier than typing it into safari each time. You’d also be able to put the shortcut right in your widgets so that you wouldn’t have to navigate to an app every morning.
A homescreen widget would be cool, but that's a bit more development.
@@reed6514 I think you could do that with Siri shortcuts (? not sure if it's called that but I'm pretty sure you can make custom shortcuts in iOS)
@@reed6514 In safari there is an “add to Home Screen” button you can use on any web page
Using the webserver is a pretty smart way of easily getting a cellphone to control a microcontroller without having to write and app, idk why i never thought about it it's so simple
Ble is also easy. There are apps that you can save & then send ble preset commands.
ble IIRC uses much less RAM than web server.
I achieved this with a power measuring smart plug with esphome and home assistant.
I can control it remotely and
if the power draw drops it will announce that the coffee is ready on all google home speakers in the house.
1) Those relays are notoriously unreliable.
2) You need a high temperature cutoff or some other method to protect your house in case the relay sticks on.
3) Ferrules at the end of wires or the screw terminal might melt.
The coffee pots I am familiar with shut-off the heating element when the water is gone automatically-the relay is no more dangerous than the original manual switch-if I forget to shut it off, what happens?
Did you handle HTTP error code 418 ?
Safety warning! ⚠
When selecting a relay, make sure you get one that is rated for the voltage and amperage that is required by the coffee machine, especially if you're on 120V, you may require a relay that can handle more amperage than you would on 230V. Check the wattage on the coffee machine label and divide by your mains voltage to get the amperage.
When wiring the mains wires, I recommend using wire ferrules to make sure they sit securely in the relay screw terminals over a long period of time. Do not screw in bare wires! They may look secure at first but over time it will collapse, and will catch fire.
Fun project. I personally tend to avoid things that involve AC. Given that and the simplicity of the coffee maker, with just a single physical switch, I think I'd just add a Smart Outlet and plug the coffee maker into that outlet. The smart outlet is easy to control / automate from my phone or Alexa or Google Home or my Home Assistant setup. What I'd REALLY like to do, is control my toaster oven with an ESP32 (knowing remaining cooking time, etc.). I've settled: for my Microwave and Toaster Oven, I use Contact Sensors on the doors and an outlets what can monitor power (Sonoff S31). This way I can monitor when they start cooking, stop cooking, and know when the door has been opened. If they complete cooking but the door hasn't been opened, it sends a nagging notification via all of my Alexas.
This is such a cool idea, might as well try doing similar sometime
Well done
where was this channel all this time
Yes this right here is what i needed to stay alive
Really cool and simple project
Cool project, but I think using HTTP POST would be a better solution than just GETting a url. The reason is that GET is expected to be "safe" (i.e. performing the request has no side effects), and therefore some browsers may pre-cache the url whenever they want. If you haven't encountered the issue of your coffee machine randomly turning on I suppose it's not a problem, but if you have, it might be this ;)
I hacked my trashcan now it can violently open up the lid and scare the sh**t out of people in my house
Maybe would great to add small ac-dc converter to the project and put everything into the machine. No wires outside. Video format is nice, I like it :)
"As a hacker you try to toast your toast with a coffee maker"
I think you can also write an android deamon that will send the request once you dissmiss the alarm
Ooh.... nice!
2:11 My brain sees stars: oh shit, pointers again...
bro please make more of these
My CS department had a web-controlled coffee machine in 1998.
top notch video as always!
Those wire strippers are awesome what kind are those?
Nice little project!
I tried following this tutorial, but I keep getting a 418 error. Any tips?
Perfect usecase for HTCPCP
Short and fun video. Nice editing. Cheers
More to come!
... and then you could easily make a fancy-looking app in Swift that would automatically send HTTP request when certain button gets pressed
I want to do this lol
What about water? What about filter? What about ground coffee? Who adds all this to the coffee machine in the morning?
The night before :)
@@LowLevelTV Or do what i did: get a wife ;) Ofcourse its way more expensive, runs on a higher voltage, wastes energy ... so in the end i might reconsider this decision ;)
Btw, how would you solve the power supply to the ESP from teh 120V AC So one could make look this pretty and fully hide it from the eyes ?
Also wouldnt it be a good idea to leave the original switch and let it also trigger the ESP to have the option to turn if off manually ?
Interesting, The old percolated coffee machine, basic in operation. Now let's program an expresso machine (better taste you see and increased complexity, pressure, temp, duration, not including a grinding feature) 😉🤩
can I get source code plz I have esp 8266 run TCP server
It's a simple matter to make it standards compliant; RFC 2324, "Hypertext Coffee Pot Control Protocol" *does* exist, after all.
Man made an internet cafe
you could use apple shortcuts for sending the HTTP request
Never directly stick the braid (the bunch of thin wires) directly into the connector! A bunch of them can break off and then the diameter gets too thin. In bad cases this can lead to something catching fire!
You have been warned. Kiss, Kiss, Bang, Bang
There are some http status codes for coffee machines lol
wait what
RFC 2324
@@micahraney732 absolutely blew my mind
@@LowLevelTV HTCPCP: Hyper Text Coffee Pot Control Protocol!
IT got some of it's own method's and status codes! Here is a Wikipedia article. nl.wikipedia.org/wiki/Hyper_Text_Coffee_Pot_Control_Protocol
You could program a interface for it if you have a android of course.
i would recommend using ESPhome to generate the firmware for you, then you could control the relay via MQTT and other protocols as well. cool project tho!
you see, this is the coffee maker IBM was worried about the Microsoft employees having.
Great video !!
Can you make a video about state machines?
That would be a nice video
If your wire this to a teapot you get a 418 - "I'm a teapot" HTTP status code instead?
This dude deadass said “DIY IoT”
Error 418 may become a reality if the project expands. I can sense the HTCPCP coming closer.
Awesome! Will the Coffee machine turn of by it self after some time or do you have to go in and use the "turnmeoff" command for it to do that. A thing that would be great to add is that the "turnmeon" would only leave the coffee machine on for a set amount of time (The time to make a pot of coffee) and then turn of automaticaly afterwards.
I made an automatic plant irrigation system and figured out something:
When you want to water your plant, you need to specify the quantity on the app and a function will convert it to a period of time depending on your pump, so you will only pump for a specified time and turn it off instead of turning it on and off manually.
I think you could do something like this if you know the period your coffee maker should be turned on in order to get your desired coffee quantity? Like (127.0.0.1/turnmeon?period=20s or something like this)
omg I am halfway through my project doing the exact same thing XD
The best channel on UA-cam.
Awesome video sir
This is cool, what's next automate the call to the web server based on a timer or your alarm going off?
My wife has that same alarm tone. I wanna punch her every day at 5am. This video makes the tone a bit more tolerable.
My roommates in college poisoned me the same way
Use Home Assistant.
Well you you a NFC tag will trigger the URL to turn ON or Off by just putting your NFC enabled phone on the tag
Awesome!!
Very cool DIY AYOR project (do-it-yourself-at-your-own-risk).
love it.
I have a question
that how that C++ code compiled that is in ESP32 ?
Is it possible to link this with ifttt (aka corperete greed)
BTW a mosfet would have done the job for less money than a relay
How did you write the program for that? Is there any reference for it?
How did you find all those informations about the wires and voltages? If i would do something like that, my paranoia would kick in, and i would be 24/7 afraid that my house could burn down anytime because i wired something wrong
what main concepts are Involved here for doing this stuffs ?
Involved, not "evolve". Ohm's Law and breadboarding on the electronics side. On the programming side, this is C++ code written to the controller using Arduino. Networking wise, it's basic HTTP/TCP stuff. Those are your basic website protocols for getting your phone to talk to the controller through the web browser.
Edit - actually he appears to be writing and uploading his code straight from a Linux terminal, but Arduino would work just fine.
@@micahraney732 thanks 🌹❤️
Have you heard of TP-Link Kasa smart sockets
Amazing!
But I should add an arming switch to make it ready for the next day in case you forget to fill it
would*
If you forgot to fill it, the element will turn on and almost immediately shut off because the element will not be cooled by the water in the reservoir. Same as if you turned on the original switch.
I don't recommend you use the screw terminals with the mains voltage, consider soldering on.
I have an annoying Q: I'm familiar with the Arduino programming with the ESP32 (easy / hobby mode), the information on using the ESP-IDF is not in a format that I can really understand. Do you know of a resource that bridges that gap? Great videos, you can go far in this world, you have the brain power for it.
how does the coffee machine get powered? does the relay step up the voltage from the 5v side to 110v?