Project 3: Internal Sensors

Faiza Kamilah
3 min readFeb 20, 2022

--

We’re finally down to sensors! Today we’re gettin dirty on ESP32’s internal sensors which are touch sensor, hall effect sensor and temperature. Lookin simple yet tricky at the same time. But, let’s get into it!

In today’s project we’re going to start off with touch sensors. For the hardware, we’ll keepin it simple with only the ESP32, breadboard, LED, male-to-male jumper, and lastly our mighty 330 ohm resistor.

Next on, hardware are need to be arrange on a certain circuit, connect a jumper wire to the ground at GPIO 4 and connect jumper to resistor to led to the negative pole. It will look like this.

After all of our hardwares are in place and secured, we coded the program we’re using in this program. It should be looking like this:

And this is what the Serial Monitor shows when we touch and un-touch the sensor.

Our next test on this project is about the hall effect sensor. Much simpler, all we need is ESP32 and a magnet! How do we know how’s the sensor doing out there? Try to run this code on our Arduino application:

After that, we check on the serial monitor. Serial Monitor on the Arduino IDE is a tool that can be used to control or monitor what is happening on the Arduino mainboard via our computer. Here’s how we’re accessing it.

Tools → Serial Monitor (To see the numbers), and Serial Plotter (To see the graph)

As we can see, numbers we’re getting are pretty different and how could it be? If we brought our north pole magnet to the sensor, Serial Monitor will show high number around >40. On the opposite pole, we’ll get small numbers under 0. 0–20 will shows when we don’t put any magnet around the sensor.

The other experiment we’re testing today is on Temperature Sensor. Similar to Hall Effect Sensor, (but much similar) all we need now is our mighty ESP32! We’re gonna find out the temperature INSIDE the ESP32.

To see them, the program we need to code should be like this:

We need to do nothing on the hardware, the temperature will show by opening Serial Monitor and Serial Plotter.

--

--

No responses yet