HC-SR04 Ultrasonic Distance Sensor with ESP32: How It Works, Wiring, and a Live Web Dashboard
Wire an HC-SR04 to an ESP32, read distance over Serial, then serve a live dashboard from the chip in one upload. Includes measured jitter and range data.
Tutorials about the sensors and actuators I use in my Arduino and robotics builds. Each one covers wiring, code, and the stuff I ran into along the way — ultrasonic sensors, IR receivers, servos, motor drivers, and more.
Wire an HC-SR04 to an ESP32, read distance over Serial, then serve a live dashboard from the chip in one upload. Includes measured jitter and range data.
This tutorial walks through the HC-05 and HC-06 Bluetooth modules with Arduino. You’ll wire up the module, control an LED over Bluetooth, build a basic app in MIT App Inventor, and then take it further with relay-based lamp control. I also cover the common issues people run into and a few frequently asked questions.
The L298N is a dual H-bridge motor driver, and it is one of the most common ways to control DC motors with an Arduino. Here I go through the pinout, how to wire it up, how PWM speed control works, and how to set motor direction in code. There is also a troubleshooting section for the issues that tend to come up.
How the HC-SR04 ultrasonic distance sensor works and how to connect it to an Arduino Uno. Covers how the sensor times its echo, the wiring, a first program that prints the distance on your computer, a second program that shows it on a small display, the sensor’s limits and troubleshooting.
Servo motors show up in almost every Arduino project I build, so I wrote this to cover the basics in one place. It starts with the SG90 micro servo and how PWM signals control the angle, then moves to running multiple servos using a PCA9685 driver board. All the code is tested and ready to use.
If you have never written Arduino code before, this is where to start. I walk through installing the IDE, explain how setup() and loop() work, and cover the basic building blocks you will use in every sketch. By the end, you will have built three small projects with working code.
Overview of the ways to program a microcontroller: block-based tools (Scratch, Blockly, mBlock), assembly, C/C++, MicroPython/CircuitPython and JavaScript, and the IDEs used to write and upload the code (Arduino IDE, PlatformIO, Thonny, STM32CubeIDE).
Arduino is an open-source electronics platform: microcontroller boards plus free software to program them. The classic Arduino Uno R3 uses the ATmega328P microcontroller.