Soemarko Ridwan

iOS & Web Developer ⟡ Coffee Addict ⟡ Scuba Diver

ESP32 RGB LED Controller MK2
ESP32 RGB LED Controller MK2

A small but significant update. I ordered a few photo resitors, aka LDR (Light Dependant Resistor) right after I finished writing MK1. It’s quite common for me to get ideas pop into my head as soon as I write things down.

Adding the LDR to the controller is a super easy task. I just modified the enclosure lid to have 2 tiny holes towards the edge, so it’ll pick up on the room light. The energy saving with this tiny sensor is significant. MK1 will automatically turn itself from 5pm to 11am, this will cut that on time by at least 50%.

Wire it to the ESP32 is also simple, just remember that we can’t use ADC1 when we need the WiFi. Any pins on ADC2 will work. On the code I also added more colours, so it’ll also lit up if I darken the room for nap time.

Sidebar: if you notice in the sketch, I also tried to use the mounting screw as capacitor button to turn all the LEDs into bright white (all 255s) to quickly brighten the room for a bit. But I'm having issues that it won't turn off consistently. I left the code in, I just don't wire the pins to the mounting screws.

Updated code and enclosure are at the same links: GitHub & Thingiverse.

Project Libra: DIY Coffee Scale MK2
Project Libra: DIY Coffee Scale MK2

About 5 years ago, I made this BLE coffee scale. It's hacked off of a scale I had. It was good enough to be used daily. The problem is that it's a bit tiring to have to use my phone as the screen, even though I have the calculator built into the app, sometimes I just want to pop open YouTube and watch something while brewing my coffee.

And here we are, a re-do of a project I did half a decade ago. The goal this time is:

  1. Screen.
  2. Speed / responsiveness.
  3. Fit underneath my espresso machine.
  4. 2-3 kg capacity.
  5. 0.01g accuracy if possible.
  6. App optional

As you can see from the pic on top, the prototype is pretty much ready. In reality, when brewing coffee, we don't need 0.1g accuracy. Definitely do not need 0.01g, but as a project goal, it's nice to aim high. The problem at this time is, the load cell I have lying around was the shitty one. Even worse than MK1's. It was just added to cart when I bought other things on Ali. It swings and wobbles at ±3g. Not practical as any kitchen scale, definitely not good enough for brewing coffee. I don't even know why they sell these. So what I did next was look for a good load cell. After I found it, I printed an adapter so I have a functioning place holder load cell as I design and print the enclosure. Pictured below. The load cells are ordered and on a slow boat from China. So, the expected project completion will be in 2-4 weeks.

load cell placeholder

1. Screen (and 6. App optional)

No 1 and 6 go hand in hand. But I don't plan on adapting this project with the previous app. I have other plans for the app side of things and it is very low on the totem pole atm. Screen just to address MK1 pain point. Also, as I mentioned in my Sous Vide post, it's a household device that only I can use. It is annoying.

Sidebar: I notice there were a surge of people making IOT window blinds. It has the same issues. No one else can open or close the blinds. If you want to make IOT devices, the app has to be optional.

2. Speed / responsiveness

Easy, dump HX711 and use ADS1232. This is the biggest hurdle of this project, there aren't many examples or tutorial that we can just simply follow to get numbers out of our load cell sensors. I plan on making a dedicated post for ADS1232. It is much much more responsive than HX711, and totally not as succeptible to noise compared to HX711.

3. Fit underneath my espresso machine.

Now that I have a 3D printer, I can print the enclosure in any shape I like. As you can see the picture, I made it "sideway". The screen is on the bottom right, because I'm left handed. I pour with the kettle on my left hand, so I still can clearly see the screen.

4 and 5. 2-3kg 0.01g accuracy

2-3 kg because my main brewing device is the 6-cup Chemex. The Chemex alone is 600ish grams. Most days, I brew 45g of coffee with 750g of water. That's almost 1.5kg total. 3kg limit gives be a bit of headroom, and I can still use it for baking or something.

0.01g are technically unrealistic unless I spent serious dollars on the load cells. Like getting a special order class C6 load cell. But that's entering the unlimited budget project territory. I'm not that crazy. In the end I ordred these load cells (Ali link: one and two). One is larger footprint but shorter, the other is smaller footprint but taller. Both are 3kg, both are class C3, and we'll see which of these fare better at 0.01g (or even at 0.1g) after they arrive.

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


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.


  • 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.


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...