Tag archive for: Arduino IDE

How to show the temperature and humidity of your room on a Heltec WiFi Kit 32 attached to a DHT11 / DHT22 sensor

When you have a DHT11 / DHT22 sensor, you can measure the temperature and humidity of your room. If you attach the sensor to a Heltec WiFi Kit 32 development board, you will be able to put up the readings on a 0.96 Inch OLED screen.

Given these points, let’s look at how we can show the temperature and humidity readings of your room on a Heltec WiFi Kit 32 development board attached to a DHTXX sensor.

How to post JSON data to a HTTP server endpoint from your ESP32 development board with ArduinoJson

When sending data from your ESP32 development board, you may choose to send the data in JSON.

In such a situation, you can consider using ArduinoJson to help you construct the JSON data.

Given that, let us look at how we can post JSON data to a HTTP server endpoint from a ESP32 development board with ArduinoJson.

How to send a HTTP Basic Authentication request from your ESP32 development board

When you connect your ESP32 board to the internet, you may need to send HTTP Basic Authentication requests.

In this situation, we can rely on the HttpClient library from the Arduino core for ESP32.

Given that, this post shows how you can send a HTTP Basic Authentication request from your ESP32 development board.

How to control a servo motor with an ESP32 development board

When I try to reuse the Ardunio Sketch to control a servo motor with a ESP8266, I encountered the following error during compile time:

WARNING: library Servo claims to run on (avr, sam, samd, nrf52, stm32f4) architecture(s) and may be incompatible with your current board which runs on (esp32) architecture(s).
In file included from /Users/i309663/Documents/learning/Arduino-sketches/sketch_arduino_servo/sketch_arduino_servo.ino:1:0:
/Users/i309663/Arduino.1.8.7/Arduino.app/Contents/Java/libraries/Servo/src/Servo.h:73:2: error: #error “This library only supports boards with an AVR, SAM, SAMD, NRF52 or STM32F4 processor.”
#error “This library only supports boards with an AVR, SAM, SAMD, NRF52 or STM32F4 processor.”
^
exit status 1
Error compiling for board ESP32 Dev Module.

Therefore, I had to find another way to control my SG90 servo motor with an ESP32 development board.

Given that, this post shows how to control a servo motor with an ESP32 development board.

ESP32 devkit-c v4 connected to sg90 servo motor

How to use an ESP32 development board to read from a VCNL4010 Proximity/Light sensor

If you have a Proximity/Light sensor, you will be able to detect how close an object is. When your range of detection is within 200mm, you can use the VCNL4010 Proximity/Light sensor.

Given that characteristic, you can use the VCNL4010 Proximity/Light sensor as a contactless switch to trigger some action.

For example, you can use it in a soap dispenser that will dispense some soap when a palm is near the nozzle.

In case you need it, this is how to use an ESP32 development board to read from a VCNL4010 Proximity/Light sensor.

VCNL4010 Proximity/Light sensor

How to use an ESP32 development board to read RFID tags from a SparkFun RFID USB Reader

When you have an RFID starter kit from Sparkfun, you will be able to read RFID tags through a serial connection.

Although the SparkFun RFID USB Reader comes with a USB port, you can also read RFID tags with an ESP32 development board.

In case you need it, this is how to use an ESP32 development board to read RFID tags from a SparkFun RFID USB Reader.

SparkFun RFID USB Reader