Posts

Showing posts from February, 2022

External Sensor with ESP32

Image
Hello everyone, I'm back!! This week I'll explain about using an external sensor with ESP32. For this project, I'll be using an ultrasonic sensor. The sensor looks like this: This sensor uses sonar to determine the distance of an object to the sensor. This is how the sensor works: 1. The ultrasound transmitter (trig pin) will emit a high-frequency sound (40 kHz) 2. If the sound finds an object, it will bounce back to the sensor. 3. The ultrasound receiver (echo pin) receives the reflected sound. cr: randomnerdtutorials Basically, the sensor sends sound waves and receives the echo. But how could we know its distance? We can calculate the distance to an object by using this formula: distance to an object = ((speed of sound in the air)*time)/2 Now, let's start experimenting with the sensor! First, prepare the components needed: 1. ESP32 2. Ultrasonic sensor 3. Breadboard 4. Male-to-male jumpers 5. Micro USB 6. Laptop/PC You also need to install the software needed. You can...

ESP32 Internal Sensor

Image
Hello everyone, I'm back! This week I'm going to explain the built-in sensor feature on ESP32 and do experiments with them.  ESP32 has 3 kinds of built-in sensors: 1. Touch sensor 2. Hall Effect sensor 3. Temperature sensor (but not all ESP32 has this sensor) First, we're going to take a look at the touch sensor. ESP32 has 10 capacitive touch GPIOs that can sense variations in anything that has an electrical charge, such as human skin. You can refer to this pinout reference to know where the touch sensors are. Now it's time to experiment! Touch Sensor First, prepare the components you'll need. 1. ESP32 2. Laptop/PC 3. Micro USB 4. Breadboard 5. Male-to-male jumper After that, you can start arranging the circuitry. It's super simple at this point. 1. Attach the ESP32 on the breadboard. 2. Connect a jumper on the GPIO 4. Yeah, just like that. Now, move to your Laptop/PC and do these steps 1. Open arduino.exe. 2. You can use the example provided in the library. Go ...

Simple I/O on ESP32

Image
Hello! I will explain the steps to make a simple I/O on ESP 32. We will learn how to light the LED by pressing the push button. First, we need to prepare the hardware or components needed for this project. 1. ESP32 2. Laptop/PC 3. Micro USB 4. Breadboard 5. LED 5 mm 6. Resistor 330 ohm 7. Resistor 10k ohm 8. Male-to-male jumper 9. Push button After you're done preparing the components, make sure the Laptop/PC you're using has the Arduino IDE and USB to UART driver installed. You can refer to my first post (https://gratgrut.blogspot.com/2022/02/blinking-led-on-esp32.html)  on how to download and install them. Then, you can start by arranging the circuitry first. 1. Attach the ESP32 on the breadboard. If you have a wide type ESP 32 that only left 1 slot in the breadboard, make sure to leave the slot with 3V3 empty, like this picture. 2. Connect 3V3 with the positive side of the power rails by using a jumper. 3. Connect the ground (GND) to the negative side of the power rails by u...