Posts

Showing posts from November, 2021

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 detecto...

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 potentiom...

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 ...

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...

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...

D'Arsonval Galvanometer

Image
  NDJ 30003 – ELECTRONIC INSTRUMENTATION       LAB 1     D’ARSONVAL GALVANOMETER     Prepared by: Ts. Ahmad Syahir Bin Ahmad Bakhit                                 Name                           : MOHAMMAD SAIFIQUL AIMAN BIN MOHAMMAD ALI                   Matrix No.                  : 192011145                  Program                      : R2427 – MICROELECTTRONIC ENGINEERING    ...