Soemarko Ridwan

iOS & Web Developer ⟡ Coffee Addict ⟡ Scuba Diver


ESP32 RGB LED Controller
ESP32 RGB LED Controller

This is not Project Libra I mentioned in the last post. It’s just a really simple project, I started and finish it in a day. Including the enclosure design and printing it.

A little background, a bit over a year ago I watched this youtube video and thought that it’s a good idea. I love having a night light that’ll lit up a room but not shining into your eyes during the night. However I have a low bed, no way I can put a PIR sensor all around without getting the wires become tripping hazard. So what I’ve done is just getting a cheap LED strip kit (with power supply and remote) and stick it around the bed.

Enters ESP32. I still can’t use a PIR sensor, but turning it on/off everyday becomes a chore. Often I’ve just left it on 24 hours. As you know, I’ve been playing with ESP a lot. Another great thing that ESP has is that it has RTC (Real Time Clock) built in. Along with WiFi, it check with current time with ntp server and will retain time accuracy even after power loss. Which is the example project called “Simple Time”.

This project, as you can see it’s just a remix of 2 guides. Simple Time and RGB LED Controller. All you need is an ESP32 Dev Board, and 3 N-channel MOSFET to run the LED. I just use the 30N06 that I already have plenty of. I added a sweet fade to the sketch so the LED won’t just snap into another color. Oh, and we’ll need a buck converter because the ESP can’t handle 12VDC input.

So, just load up the sketch. Plug everything together. Close the box. Plug everything in. And we’re done. This is one of those project that everything went smoothly. I only need to print the enclosure once. And the code just works. I added the fade later in the afternoon, and everything just went swimmingly.

Github & Thingiverse

Another idea I have was to check for sunset and sunrise time, but I opted against it. What I’d like to add in the future is a light sensor, so the LED strip will only light up when the room is dark.


Katara: Open Source Sous Vide

1. Sous Vide

graph

The main difference of Katara compared to the predecessors is the use of a true water heating element (instead of a crockpot or rice cooker) and the water pump. It is a true immersion circulator. It can retain water temperature within 0.1ºC swing. It as 1500 Watt water heater, so 16 litre room temperature water can reach 60ºC within 15 mins or so. Anyway, Sous Vide is Sous Vide are so 5 years ago, but perfect steak, everytime. Let’s move on.

2. Over The Air (OTA) Update

My favourite feature, by far. Thanks to the AutoConnect library, this thing is amazing. There are many WiFi manager for the ESP32, but it’s the only one I’ve found that has the captive server out of the box.

Sidebar: if you don’t know what captive server is, it’s the pop-up you get when you joined a free wifi in airports or cafe.

It’s the most intuitive way. First you connect to the device’s WiFi, then it pop-up a thing so you can set it to connect to your home WiFi. You don’t need to memorise any IP address. The only downside, this and Blynk took like 70-something % of the ESP32 flash memory. That brings us to the next feature.

3. Blynk

Blynk is like an app (both iOS and Android) for your DIY IOT device for “free” and with minimal coding. You don’t need to roll your own API and server (in a way, I’ll get back to this later), and you most definitely do not need to code your own app. Blynk itself is quite confusing to use and a tad buggy, one thing in my code still causes a kernel panic. And you do BLYNK_WRITE() to read some values off of the app.

Blynk is “free”, upon registering, you get something like 2000 energy. And energy is their currency for buttons, LED, graphs, etc. If you need more, there’s IAP to get more energy. Unless, you roll your own blynk server, it’s dead simple. Just cut and paste a couple of things from the docs, I have mine run on my OctoPi.

And more importantly, I added a Blynk tab on AutoConnect with custom server support.

Final Thoughts

These are the major features that bring Katara works like a commercial product. Technically you can get everything from BOM. Follow the build guide. Figure out the water heater. Upload the released firmware as is. And it’ll work.

However, this is one of those projects you can’t cheap out on. It has been about a month long journey for me. Stressful but fun project I did in awhile. The final tally for the BOM is a bit under $60 (almost triple my original budget goal). Compared to an Anova (about $130) or a Joule (about $200), it’s a bit of money saving project. Especially over here, Anova is sold for almost $300 in local marketplace.

DIY Sous Vide kit

There are people who are selling these DIY Sous Vide “kit”, a death trap kit is what that is. If you were to build this, approach it with caution and respect. As with any other project that uses the AC line.

There we go, another CoronaCraft in the bag. Be safe, wear mask, and enjoy your steaks.

Build logs:

  1. Prototype
  2. Enclosure Design
  3. Challenges
  4. Water Heating Element
  5. Back to Drawing Board
  6. Build Guide

Bonus: my next project is called Libra, should be obvious of what it is. Another revisit of my project from 5 years ago. Should be easy and fun.


Project Katara - Build Log 6: Build Guide
Project Katara - Build Log 6: Build Guide

Pictured is my simplified (read: sad attempt at) drawing the whole wiring diagram. The wiring is relatively simple. Just make sure you solder it nice and tidy, and crimp things tight.

BOM:

  • ESP32 dev board — $5
  • 0.96” OLED — $5
  • R10 800 L/h aquarium pump — $5
  • KY-040 rotary encoder module — $0.50
  • Switch with LED — $1
  • IEC320 C14 Male Socket with fuse and switch — $1
  • AC to DC 5V 3.6A — $5? (I found this around the house)
  • Waterproofed DS18B20 — $1
  • Water heating element. Choose carefully — $13
  • Good Solid State Relay — $20
  • Total: $56.50 + wires, screws, connectors, etc.
  • Plus a pair of M7 nut and bolt, and a bunch of M3s screws

As you can see, the water pump is controlled directly by the switch and completely skip the ESP. I don’t find it necessary to have it controlled by ESP. I’ll need a button to control it anyway. It is simpler this way.

I have an LED indicator that shows when the water heater is on. I put it in as the same pin as the internal LED pin so it’ll blinks when updating the firmware via OTA. And for simplification, I just get a switch with LED in it. Less things to mount. My pinouts are:

  • DS18B20 — D27
  • OLED — D21 (sda), D22 (scl)
  • KY040 Encoder — D32(clk), D34(sw), D35(dt)
  • SSR — D23
  • LED — D2 (same as the ESP32 dev internal LED).

Use the exact pins and you can just upload the firmware as is. Remember to upload it to you ESP at least once (. And you can connect it to your home wifi and use the OTA update.

Thingiverse & GitHub

Print the things. I highly recommend a 1mm nozzle to speed things up. These are mostly square shaped. Support is not needed, and it should be obvious where the print orientations are (hint: just select the largest flat surface as bottom).

I’ve left the centre blank so you can design your own mounting points / holes.

Putting it together is easy. First do the centre, mount everything inside. Next screw bottom to centre with a transparency plastic in between. Then mount the water heater, pump and DS18B20 to bottom. Clamp both things together.

Plug everything from top, and snap it shut. And you’re done. Get a container / a bucket. Clamp it to a side. Pour water. Plug it in. Turn it on. Turn pump on. Start PID.

AutoConnect

Also configure WiFi, the default SSID is the one with “SV-“ prefix. default password is “SousVide” (note the case). Click “Configure new AP” to assign the ESP to your home WiFi.

Then configure Blynk if you like. Start from the app, you’ll need the auth code first. At the minimum you’ll need 800 energy. Graph (super chart) +900, another label for ESP temp +400, and heater LED indicator +100. Definitely not enough for everything without paying for more energy. But the graph is not necessary, and you can just use the “Value Display” instead to save some energy. Or self host blynk server for unlimited energy.

Next will be the final post, the official release of Katara: Open Source Sous Vide Cooker. Yeah, I kinda married to the name.


Project Katara - Build Log 5: Back to Drawing Board
Project Katara - Build Log 5: Back to Drawing Board

… mostly. I’ve failed to achieve the $20 Anova since the heating element price jumped almost 10x. I planned on using the one that costs $1.50, but it was zappy and splodey, so scratched that. This project felt cursed, it’s one problem after another. But I’ve spent a lot of time designing in Fusion 360, and writing codes. Weeks worth of work, and those are sunk cost. I want to see this through.

As posted in Build Log 3, I have soldered all the components and all the connectors, after my 1mm nozzle arrived, I decided to redesigned and reprint the enclosure so the new parts have their proper mounts. I have to reprint the bottom part because of the new water heater anyway. And oh boy 1mm nozzle is fast, 0.5mm layer height. Cut my 12 hours print down to 6 hours.

After that’s done. Putting it back together, that god-dammed Fotek SSR decides to bite me in the ass… again. That shit leak current. During testing I noticed the water temperature kept on rising despite it has reached the target temp. So I stop the PID. Still rising. Kill everything. Put the main wire through an amp-meter, it pulled 3 amp when idle. It’s only supposed to power the ESP32. ESP32 doesn’t need 3 amp on 220V. But when I turn on the PID I saw the current draw jumped to 6ish amp. So confirmed FOTEK is the problem. Some leaks are common with SSR, but 50%?!

Good SSR

The very next day I decided to test it with one of my good SSR. It’s a dual SSR, so quite an overkill, but it’s the only non-Fotek SSR I have. Night and day. 15mA on idle, 40mA when I turn the pump on, and 6-ish amp when everything is on. Which is about right, 1500 Watt / 240V = 6.25 A. MK3 is finally done.

Next post: Build Log 6: Build Guide.


Project Katara - Build Log 4: Water Heating Element
Project Katara - Build Log 4: Water Heating Element

Just a quick update, I’ve figured out what I want to do with the water heater. I bought that pictured thing, which I believe is a spare part for a water boiler or something, costs like $13. I’ll do wiring myself, so I know for sure that it won’t electrocute me. This image shouldn’t never exist as a commercial product. Search on Aliexpress, led me to products that has a DO NOTE TOUCH DURING USE warning in their description. And it’s a 3000 Watt water heater, insta death. I’m done with those cheap-ass water heater.

Putting it together was simple enough. Put AC wires in, ground included. It has a DN25 pipe thread, so I just design and print a thing with that thread to surround the exposed wires, and enclosed it with epoxy resin to waterproof the wiring. Works like a charm, completely submersible, no more splodey things. And it’s 1500 Watt.

water heating element


Project Katara - Build Log 3: Challenges
Project Katara - Build Log 3: Challenges

Listed is the problem happened in chronological order.

1. 5VDC power supply module

You know that cheap-ass PSU module that’s scrapped from other things and sold on marketplaces, yeah. Got it, tested it, it works, screw it in, plug it in, then it stopped working.

Solution: noticed that I have a pretty small 5V 3.6A power brick, it still fit in the box, so I’m going to use that instead.

2. DuPont connectors aren’t stable enough

You can see it on the design post, I plan just mounting the ESP32 upside down, crimping female DuPont. It’s too unstable. The screen is flickering. Encoder will not detect turns most of the time.

Solution: crimp JST plugs on the parts, and solder everything on perf-board.

Downside: I did not plan my positioning tight enough, so it’s too far apart, too large, and awkwardly mounted on the designed mounted parts. Messy but everything still fits inside.

3. Fotek SSR cannot be driven by 3.3V

Despite what it says on the label (IIRC, 3-25 VDC). Despite the LED lit up. It cannot open the gate at 3.3V. I’ve mentioned how terrible Fotek SSR was multiple times. But it its dirt cheap, and I already have some around. I’m not going to get a better SSR for this. There are two ways to go about this.

First, the easy but may kill the ESP way. Splice the 5V to + on Fotek, and - to a pin. So setting the pin to LOW will trigger the SSR and turn on the heater. A quick google will tell you that some pins on the ESP can handle up to 6V. But on spec, all pins are limited to 3.3V. This worries me, I believe by doing this, if (or when) the ESP fail, the SSR will remain triggered and it’ll become a fire hazard. So I went with the second solution, the “right” way.

Which is adding a MOSFET as a relay to control the 5V. So I have the ESP to control the 5V for the SSR that control the AC line. it’s like relay on top of relay.

4. Water heater isn’t grounded

Once everything is fixed and device is up and running, I did a test run, and want to confirm the water furthest away still has the same temperature, I felt electric current when pulling out the type-K probe. Curious, grabbed my test pen to confirm, lit up like a Christmas tree. With the amount of projects using these out there. I honestly cannot believe people hasn’t noticed this problem yet. After confirming that, a quick google led me to this water heater on Amazon, “no electric shock during use” was literally in one of the pics. JFC!

Solution: grab a piece of wire, attach it to a metal thing and ground. Problem solved.

5. The water heater goes POP!!

It exploded! (the hero image) After #4 is fixed, I went on testing another thing, only the coily part that is submerged in water. Because I plan on using a wide but low container, I don’t want to use too much water. After 15 minutes or so, the LED goes pop, plastics melted. Everything else still works okay, though I noticed the ESP kept on restarting. Seems like the water heater has shorted something. To the bin it goes.

Solution: back to the drawing board. Hopefully I have something to update...


The Power of Flat File CMS
The Power of Flat File CMS

I am forced to take a break from Project Katara. Pictured above, this blog suddenly broken for whatever reason. As I finished writing the next build log, I want to post it, I just notice that it’s broken. Not DNS settings, I’ve tried other paths, DNS are fine, FTP is still up and running. Tried re-downloading Bludit and overwrite the core, still messed up.

I have backups both on server and behind Bludit admin, but they’re old. The ones on the server stopped backing up because my host disabled php’s zip during one of their maintenances. I never notice this until today. I’ll fix this after I fixed the blog.

I noticed that I can upload a clean Bludit and have a new installation up and running without issues. So I just copy everything from bl-content over. Broken again but in a different way, /admin led to 404. So something inside the contents are causing this. Let’s do over, go slower.

Clean install, move my custom plugin and theme, all good. Next just copy everything from /bl-contents/pages and /bl-contents/databases (except for the plugins database). It works. And since all of my pictures I hosted it on imgbb, I’m done. All good. The broken copy is still available on /blog-broken, but I don’t think I care enough to do a post-mortem, it’s there if and when I feel like doing something about it.

Everything is sorted within 15 minutes. Can’t even imagine what I need to do if something like this happen to a WordPress blog, which is an argument for paying to be hosted in WordPress.com, or you know, use Bludit.

I need (and want) to continue working on Project Katara.


Project Katara - Build Log 2: Enclosure Design

Not much to write. Now that the parts have arrived, I can find most of the exact models on GrabCAD, and the ones that aren’t available online are simple enough to design myself.

  • R10 800l/h Aquarium Pump
  • ESP-32
  • IEC320 C14
  • 0.96” OLED
  • KY-040 (don’t need the model for this, I just need to cut 7mm hole) — designed my own a knurled knob though.
  • Toggle switch (also no model, 16mm hole)
  • 1000 Watt submersible water heater (poorly designed, can’t find my exact measurement in GrabCAD, but I need to design this to align the water pump)
  • Chinese scavenged AC-DC power supply 5V 2A (just need to add mounting points)

I’ve split the enclosure into 4 parts,

  1. bottom for mounting the pump, sensor, and water heater. Screwed on to centre. 7.5 hours print.
  2. Centre the main enclosure. 12 hours print.
  3. Top is the lid, snap on to centre. 5 hours print.
  4. Clamp to clamp this to a container (the water bucket), and it also clamps centre and bottom together. 2.5 hours print.
  5. I’ve also added 0.2mm gap so I can add a transparency plastic between bottom and centre, you know the ones we use for 3D printed face shields. This is to protect the electronics from hot water vapours.

Total: ~27 hours of print time. I’m getting Volcano hotend + 1mm nozzles.

To be continued...