Posts

Interfacing Blynk with ESP32

Image
  MOHAMMAD SAIFIQUL AIMAN B MOHAMMAD ALI 192011145 R2427-MICROELECTRONIC ENGINEERING Blynk is a new platform that allows you to quickly and easily design interfaces for managing and monitoring your hardware projects from your iOS or Android device. After downloading the Blynk software and placing buttons, sliders, graphs, and other widgets on the screen, you may construct a project dashboard. Objectives : 1.     configure and interface Blynk with ESP32 2.     How to code and link the Blynk with Arduino IDE TASK 1  Source code :  /*************************************************************   This example shows how value can be pushed from Arduino to   the Blynk App.   NOTE:   BlynkTimer provides SimpleTimer functionality:     http://playground.arduino.cc/Code/SimpleTimer   App project setup:     Value Display widget attached to Virtual Pin V5  *************************************************************/ // Template ID, Device Name and Auth Token are provided by the Blynk.Cloud // Se

MINI PROJECT - AUTOMATIC WATERING PLANT USING BLYNK

Image
  MOHAMMAD SAIFIQUL AIMAN BIN MOHAMMAD ALI 192011145 R2427-MICROELECTRONIC ENGINEERING Have you ever worried about your plant when you are away from them? afraid not as this project will make sure that your plant receives the necessary amount of water with a one-click of your phone. Here's a list of component that you need : ESP32 1CH Active H/L 5V OptoCoupler Relay Module Micro Submersible Water Pump 3v-5v Tube 4xAA Battery Holder C/W Cover 4xAA Battery Jumper Wire Source code : #define BLYNK_PRINT Serial #include <WiFi.h> #include <WiFiClient.h> #include <BlynkSimpleEsp32.h>   // You should get Auth Token in the Blynk App. // Go to the Project Settings (nut icon). char auth[] = "YourAuthToken";   // Your WiFi credentials. // Set password to "" for open networks. char ssid[] = "YourNetworkName"; char pass[] = "YourPassword";   #define WATER_PUMP 27 boolean state = false;    void setup() {  // Debug console  Serial.begin(960

ESP32 Hall Effect Sensor

Image
MOHAMMAD SAIFIQUL AIMAN B MOHAMMAD ALI 192011145 R2427-MICROELECTRONIC ENGINEERING A hall effect sensor is included in the ESP32. A hall effect sensor can detect magnetic field differences in its environment. The output voltage is proportional to the magnetic field strength. To operate as a switch, a hall effect sensor can be paired with a threshold detector. The majority of the time, Hall effect sensors are utilized to :  - Detect proximity;  - Calculate positioning;  - Count the number of revolutions of a wheel;  - Detect a door closing;  Here’s a list of parts you need to assemble the circuit  ESP32 DOIT DEVKIT V1 Board Read Hall Effect Sensor  Reading the hall effect sensor measurements with the ESP32 using the Arduino IDE is as simple as using the hallRead() function. In your Arduino IDE, go to File > Examples > ESP32 > HallSensor:  Copy the source code below Source code : // Simple sketch to access the internal hall effect detector on the esp32. // values can be quite

ESP32 Reading Analog Inputs

Image
MOHAMMAD SAIFIQUL AIMAN B MOHAMMAD ALI 192011145 R2427-MICROELECTRONIC ENGINEERING When using the ESP32 to read an analogue value, you can measure voltage levels ranging from 0 to 3.3V. The voltage measured is then allocated to a value between 0 and 4095, with 0V equaling 0 and 3.3V equaling 4095. Any voltage between 0 and 3.3V will be assigned the value in the middle. Here’s a list of parts you need to assemble the circuit  ESP32 DOIT DEVKIT V1 Board Potentiometer  Breadboard  Jumper wires touchRead()  Reading the touch sensor is straightforward. In the Arduino IDE, you use the touchRead() function, that accepts as argument, the GPIO you want to read.  Assemble the circuit shown below Copy the source code below Source code : // Potentiometer is connected to GPIO 34 (Analog ADC1_CH6)  const int potPin = 34; // variable for storing the potentiometer value int potValue = 0; void setup() { Serial.begin(115200); delay(1000); } void loop() { // Reading potentiometer value potValue = analogR

ESP32 Pulse-Width Modulation (PWM)

Image
MOHAMMAD SAIFIQUL AIMAN B MOHAMMAD ALI 192011145 R2427-MICROELECTRONIC ENGINEERING In this part, you'll learn how to dim an LED with the Arduino IDE and the ESP32's LED PWM controller. The ESP32 LED PWM controller has 16 separate channels that may be programmed to do a variety of things. PWM signals with various qualities may be generated. The following are the methods to dim an LED with PWM using the Arduino IDE: 1) First, you need to choose a PWM channel. There are 16 channels from 0 to 15.  2) Then, you need to set the PWM signal frequency. For an LED, a frequency of 5000 Hz is fine to use.  3) You also need to set the signal’s duty cycle resolution: you have resolutions from 1 to 16 bits. We’ll use 8-bit resolution, which means you can control the LED brightness using a value from 0 to 255.  4) Next, you need to specify to which GPIO or GPIOs the signal will appear upon. function accepts two arguments. The first is the GPIO that will output the signal, and second is the

ESP32 TOUCH SENSOR

Image
MOHAMMAD SAIFIQUL AIMAN B MOHAMMAD ALI 192011145 R2427-MICROELECTRONIC ENGINEERING There are ten capacitive touch GPIOs on the ESP32. These GPIOs can detect changes in anything that has an electrical charge, such as the skin. As a result, they may detect fluctuations caused by a finger touching the GPIOs. These pins may easily be incorporated into capacitive pads and can be used to replace mechanical buttons. Here’s a list of parts you need to assemble the circuit  ESP32 DOIT DEVKIT V1 Board  5mm LED  330 Ohm resistor  Breadboard  Jumper wires touchRead()  Reading the touch sensor is straightforward. In the Arduino IDE, you use the touchRead() function, that accepts as argument, the GPIO you want to read.  Assemble the circuit shown below Copy the source code below Source code : // set pin numbers const int touchPin = 4; const int ledPin = 16; // change with your threshold value const int threshold = 20; // variable for storing the touch pin value  int touchValue; void setup(){ Serial

ESP32 - DIGITAL INPUT AND OUTPUTS

Image
MOHAMMAD SAIFIQUL AIMAN B MOHAMMAD ALI 192011145 R2427-MICROELECTRONIC ENGINEERING We'll teach you how to read digital inputs like a button switch and operate digital outputs like an LED in this section. If you've ever used the Arduino IDE to programme an Arduino or an ESP8266, you'll be familiar with this. Here’s a list of parts you need to assemble the circuit  ESP32 DOIT DEVKIT V1 Board  5mm LED  330 Ohm resistor  Pushbutton  10k Ohm resistor  Breadboard  Jumper wires  digitalWrite()  To control a digital output you just need to use the digitalWrite() function, that accepts as arguments, the GPIO you are referring to, and the state, either HIGH or LOW. digitalRead()  To read a digital input, like a button, you use the digitalRead() function, that accepts as argument, the GPIO you are referring to. Assemble the circuit shown below Copy the source code below Source code : // set pin numbers  const int buttonPin = 4; // the number of the pushbutton pin  const int ledPin =