Smart Bin Project 101: Intro to Robotic with ESP32

This is one of my blog post without using GenAI to help with grammar and such. I know, I did some research using tools, but writing this post, I am doing my best use my all fingers to type the words one by one. 
So in this post, I will talk about ESP32. This is a tool that can be used for beginner who are interested in doing coding and robotic in a cheap way. In Indonesia it self, I bought the kit, available on an e-commerce, it was only Rp200.000 or about $20. 

To make a Smart Bin like in the picture above, we only need 3 tools, and some materials. They are:

Tools we need:

  • ESP32 as the main character, as the brain of the computer
  • Servo SG90, as the motor that will move the bin lead to up and down
  • HC-SRO4 as the movement sensor, look like eyes, but they are distance sensor, will make it read if <20cm, the lid opens.
    ESP32
Servo S90
 
HC-SRO4

Materials we need:
  • A coffee cup
  • Tape
  • Some cable jumper (you'll get it in the package if you buy the kit)
  • USB Cable for uploading the code and also as it's power source

Cable Jumper


Coffee Cup
 
USB Cable


How to make it?

  1. Let's assemble the ESP32 and its extension. 
  2. Plug in the USB cable and make sure both the ESP32 and its extention has red light on.
  3. Connect the Servo to ESP32 using cable jumper with this adjusment:
    • Servo has 3 connectors, all connect to D26.
    • Brown to G
    • Red to V 
    • Yellow to S
  4. Connect HC-SRO4 to ESP32 with this adjustment:
    • VCC to 5V (Oh I forgot, there is yellow jumper on ESP32, move it to 5V instead of 3V)
    • Trig to D5 (choose the S)
    • Echo to D (choose the S)
    • Gnd to Gnd


Time to code!

No worries, I know sometimes coding is boring, thus I asked some help from the most reliable helper, GenAI. So honestly I copied pasted the code to Arduino IDE. Ok, I'll tell you the step in coding part.

  1. Install Arduino IDE.
  2. Install some necessary libraries for supporting our tools (HC-SRO4, Servo, ESP32).
  3. After three of them installed, you can copy paste this code to the coding space.
  4. Click the check mark button on top of the code spase to check whether there's missing or error code. 
  5. Then if all is ok, click the sign right button to upload the code to our ESP32 hardware.
  6. If all is good, you're Smart bin is function.
My cutie pie Smart Bin



Comments