cover photo

COURSEWORK

Khlongpaiha's EV-RE-001 course work. Lv 2

Khlongpaiha ReangAUTHORACTIVE
This Report is yet to be approved by a Coordinator.

5 / 6 / 2025


Task 2: Learning about ultrasonic sensor

Objective:

In this task we have to determine the object distance and detect obstacle using an ultrasonic sensor.

Working:

These ultrasonic sensors convert electrical waves into sound waves. Its known as ultrasonic sensor because it sends sound waves at a frequency we cannot hear.This kind of sound waves is known as ultrasonic sound.One part sends the sound waves and reflects the object and the other part receives and detects the object.

Distance = Time*340ms/2.

The trigger pin sends the wave and the echo pin receives it.

ultrasonic sensor

To check the video

TASK 3: LM35 Temperature Sensor

Objective:


This task ask us to use a LM35 temeperature sensor to detect the temperature of a room.

Working:


Basically an LM35 sensor ha three pinouts one for the power supply, middle for the anaglog voltage and the last voltage for the grounding.

The LM35 temperature sensor works by producing an analog output voltage that is directly proportional to the temperature in Celsius. This means that for every degree Celsius increase in temperature, the output voltage increases by 10mV.

The image for the wokring is attached below

TASK 4

Objective:


To measure the temperature and humidity of a room using a DTH11 sensor.

working:


DHT11 is basically a basic, ultra low-cost digital temperature and humidity sensor. It has 4 pinouts sections one for power supply , the second for input and ouptut of the signal, third pin is basically used for mechanical stability of the DHT11 and finally the last pinis used for grounding. It uses a capacitive humidity sensor and a thermistor to measure the surrounding air, and spits out a digital signal on the data pin.

TASK 5 - BLDC MOTOR AND HALL EFFECT SENSOR

objective:


Measure the speed of a BLDC motor using a hall effect sensor and display it on the serial monitor.

Working


A Hall effect sensor is a device that measures the strength and direction of a magnetic field, often used to detect position, speed, or proximity. We stick a neodynium magnet on the motor and when we bring the motor close to the magnet the fan blades of the motor starts rotating thereby giving us an output in the serial motor in arduino ide.

The Hall Effect sensor used for this task is A3144 which is a unipolar Hall effect sensor.

Why we use neodynium magnets?

Neodymium magnets create a strong, localized magnetic field.

Hall effect sensors are very sensitive to field strength—stronger magnets ensure that the sensor reliably detects each passing blade.

This improves speed detection or rotational position sensing, even at low RPMs.

Check the video upload.

TASK 6: BLINK LED WITH STM32

objective:


To learn about STM32 and make a blink LED using STM32.

Theory:


The stm32F446RE nucleo board has a ST-Link debugger which uses a usb Type A or Type B port for connecting with the MCU which here is 16 bit arm cortex.

It has three LED pins named LD 1, LD 2 and LD 3.

The tricolor LED (green, orange, red) LD1 (COM) provides information about ST-LINK communication status. LD1 default color is red. LD1 turns to green to indicate that communication is in progress between the PC and the ST-LINK/V2-1, with the following setup: • Slow blinking Red/Off: at power-on before USB initialization • Fast blinking Red/Off: after the first correct communication between the PC and ST-LINK/V2-1 (enumeration) • Red LED On: when the initialization between the PC and ST-LINK/V2-1 is complete • Green LED On: after a successful target communication initialization • Blinking Red/Green: during communication with the target • Green On: communication finished and successful • Orange On: Communication failure User LD2: the green LED is a user LED connected to ARDUINO® signal D13 corresponding to STM32 I/O PA5 (pin 21) or PB13 (pin 34) depending on the STM32 target. Refer to Table 11 to Table 23 when: • the I/O is HIGH value, the LED is on • the I/O is LOW, the LED is off LD3 PWR: the red LED indicates that the STM32 part is powered and +5V power is available.

WORKING:


To learn about the working it is best to go through the manual sheet that explains all the pinouts and pin in diagarms.

To perform this task i used the PA5 which analog pin 5 in the arduino pin as the GPIO output.

stm32

TASK 7 - BATTERY CHARGING

objective:


In this task with the help of solar panels we will charge a Li-ion battery.

components:


  1. solar panel.
  2. Diode.
  3. TP4056.
  4. Li-ion battery holder.

working:


A TP4056 is a battery charging module that handles battery charging efficiently and safely.For the working part, when we place the solar panel under direct sunglight with the help of multimeter we can check that there is an increase in the voltage and vice versa. the diode is here used to protect both the battery and solar panel by preventing the backflow of current when the solar is under dim light or duirng night time, not generating any power.

SolarLion

TASK 8- solar Tracker using LDR and sservo motor

objective:


The goal of this project is to design and implement a light-tracking system that automatically aligns a solar panel toward the strongest light source. This is achieved using an Arduino, a servo motor, and two LDRs (Light Dependent Resistors). The system improves solar panel efficiency by ensuring it always faces the most intense light direction.

Theory:

Solar panels generate maximum power when sunlight directly hits their surface. Since the sun changes its position throughout the day, a solar tracker increases efficiency by continuously adjusting the panel's angle.

working


Two LDRs placed on opposite sides of the solar panel detect the light intensity difference.

If LDR1 > LDR2, it means light is stronger on one side → servo rotates panel in that direction.

If LDR2 > LDR1, it rotates the other way.

If light levels are similar, no movement occurs.

Outcome:


The servo motor successfully rotates the solar panel toward the brighter light source.

The system responds in real-time to changes in light, such as moving a flashlight or the sun’s path.

The project demonstrates the practical use of sensors, actuator control, and basic embedded systems for energy optimization.

TASK 9 - Transistors as switches

Objective:


To learn about transistors and how they act as switches.

Theory:

Transistors are fundamental semiconductor devices used to amplify or switch electronic signals and power.For performing this task I will be using a Bipolar junction transistor(BJT).They can be again classified into two types called NPN and PNP.

A BJT has thre pins the called Collector,Base and Emitter.In case of a PNP current flows from emitter to collector. In case of NPN current flows from collector to emitter.To know about the configuration it is always recommend to read the datasheet of the manafacturer.

Working:

When we place a transistor in between a battery and a bulb or LED.The LED will not light up, but as soon as we give a volatge supply either positive or negative the LED will start to blink. Note that for the transitor to work the voltage should be minimum 0.6 - 0.7V.

Task 10 - LED brightness control using PWM and MOSFET

objective:


To learn to control the LED'S brightness using MOSFET and by varying PWM duty cycle.

Theory:


A MOSFET (Metal-Oxide-Semiconductor Field-Effect Transistor) is a type of transistor widely used in modern electronics for switching and amplifying electronic signals. It is the most common type of field-effect transistor (FET) and serves as the fundamental building block in digital and analog integrated circuits.

The MOSFET can be classified into two type an Enhancement and a Depletion each having n channel and a p channel.

ClassificationMOSFET

working:

The Enhance type MOSFET requires some volatage for the current to flow from the Drain to the Source.

The Depletion type MOSFET does not require any voltage for the current to flow from Drain to Source.

The brightness of the LED cane be varied using the PWM(Pulse width modulation).

codeforPWM

Link of the LED blinking

Why we use MOSFET and not a BJT:

MOSFETs are preferred over BJTs for controlling the brightness of LEDs because MOSFETs have a very low ON resistance of a few milliohms, which means they dissipate very small amounts of heat compared to BJTs. This makes them more efficient for driving larger LEDs without requiring hefty heatsinks.

Additionally, MOSFETs are voltage-driven devices with very high input impedances, allowing them to be safely paralleled together for driving multiple LEDs.

Outcome:

From this task I learned about MOSFETS.At first I made a connection without using a potentiometer, due to which I was not able to vary the PWM. Later, I researched and searched how a pot can be used to vary the PWM.Thanks to this I was able to vary the brightness of LED by using PWM.

TASK 11: H bridge motor driver using MOSFET:

Objective:

The objective of this project is to design and build a basic H-Bridge motor driver circuit utilizing N-Channel and P-Channel MOSFETs. The circuit should enable the control of a DC motor's direction using digital signals, such as those from an Arduino or mechanical switches.

Theory:

An H-Bridge is an electronic circuit configuration that allows a voltage to be applied across a load (like a DC motor) in either direction. This capability enables the reversal of motor direction, making it essential for applications like robotics and motor control systems. The H-Bridge is named for its resemblance to the letter "H," where the load forms the crossbar and the switches form the vertical legs.

Components of an H-Bridge

A typical H-Bridge consists of four switches (transistors) arranged as follows:

S1 and S4: High-side switches connected to the positive supply voltage.

S2 and S3: Low-side switches connected to ground.

Load (Motor): Positioned between the two middle nodes.

schematicdiagram

working:

H bridge using transistors

So how this circuit will work is , when we apply some voltage in one side which is numbered here 1 and the other side 0 . The NPN will be closed circuit and the PNP will be closed from the other side, the current will flow in the direction of NPN to PNP in the image below and thus the motor will start rotating.

To view my Tinkercad simulation clickhere

TASK 12: Auto Night Lamp using LEDS:

Objective:


The main objective of this task is to make the LED glow up when the LDR(Light Dependent Resistor) is in a dimly lit environment. So when it is dark the LDR

Theory:


The LDR is a type of resistor whose resistance changes on the amount of light falling on it.The resistance of LDR drops alot when light falls on it directly due to which the LED glows.

Working:


So basically for this circuit we use a MOSFET transistor which as mentioned in the previous task works as a switch to make LED switch ON or OFF. Its another work is to convert small base current to large collector current.

LDR resistance is high when it's dark thus voltage increases at Gate voltage rising above its threshold value.

LDR resistance is low when it's bright the MOSFET voltage is low.

MOSFET Switching:

Gate voltage > 2-3 V, MOSFET is ON → current from Drain to source → LED ON.

Base voltage < 2-3 V, MOSFET is OFF → current does not flow from Drain to source → LED OFF.

LED Activation

`

UVCE,
K. R Circle,
Bengaluru 01