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 😂
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!
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)
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.
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.
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!
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.
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
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.
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
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, 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.
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).
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.
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.
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 ;)
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?
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?
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.
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.
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.
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 :)
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?
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) 😉🤩
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?
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
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?
... 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
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
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!
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.
@@LowLevel-TV 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
seems a bit over the top considering you can buy outlet switches with esp8266 compatible modules in them for cheap. You probably spent more on relays than you would have on a wifi outlet switch
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)
@@LowLevel-TV 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 ?
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.
Hey man, I saw this and the video about the baby monitor. I am studying computer science and soon I'll have to choose the direction(major?) I want to follow. I was absolutely sure I wanted to do Cyber security but one of my latest courses was Systems Labs which made me consider my options and look towards embedded systems. My question is, what does one need to study, or what courses are needed to acquire the knowledge to do what you did in this video? Thanks