I2C with ESP32 - I2C Tricks & Tips with the ESP32

DroneBot Workshop August 17, 2025
Video Thumbnail
DroneBot Workshop Logo

DroneBot Workshop

View Channel

About

Welcome to the Workshop! The DroneBot Workshop is the place where I work with Arduino, Raspberry Pi, ESP32, and lots of other cool microcontrollers, components, and sensors. This is a channel for learning and understanding. While I do build projects, most episodes focus on showing you HOW things work, so you can use the information to bring your own designs to life. Every video has a corresponding article on my website at https://dronebotworkshop.com , along with the diagrams and code samples you’ll need to build your own creations. You can also participate in discussions on my Forum at https://forum.dronebotworkshop.com. Please note that I no longer do any sponsored videos, enquiries for these will be ignored! If you'd like to know more about me or the DroneBot Workshop you can read the FAQ at https://dronebotworkshop.com/about-dronebot-workshop/faq/ And if you have technical questions please ask them on the Forum. Welcome to the Workshop! I hope you enjoy your stay! Bill

Video Description

Let’s take a deep dive into I2C on the ESP32. The ESP32 has two I2C buses, which we can utilize to our advantage. We’ll also build our own I2C peripheral. Article with code: https://dronebotworkshop.com/i2c-esp32/ More articles and tutorials: https://dronebotworkshop.com Join the conversation on the forum: https://forum.dronebotworkshop.com Subscribe to the newsletter and stay in touch: https://dronebotworkshop.com/subscribe/ We’ve worked with I2C many times; it’s the most popular way to interface sensors and displays to a microcontroller. Today, we will explore I2C on the ESP32 and see how we can make full use of its capabilities. The ESP32 has two I2C buses, which we can take advantage of when dealing with sensors that have conflicting addresses. We can also use the ESP32 as an advanced I2C peripheral, making it possible to create our own sensors and custom displays. We’ll also examine the Wire Library. The Wire Library is the key to using I2C with the ESP32, and we’ll learn how it works by manually retrieving data from a temperature and humidity sensor. Here is the Table of Contents for today's video: 00:00 - Introduction 01:11 - The I2C Bus 06:05 - ESP32 I2C Basics 08:48 - Using the Wire Library 14:06 - ESP32 I2C Scan 15:41 - OLED Code 19:01 - Multiple I2C Buses 24:31 - ESP32 as an I2C Peripheral 34:02 - Conclusion Once you have mastered the use of the I2C bus, you’ll be able to interface virtually any sensor to an ESP32. And if you can’t find the perfect sensor for your application, you can always roll your own! I hope you enjoy the video. Bill

You May Also Like