Showing posts with label Arduino. Show all posts
Showing posts with label Arduino. Show all posts

Monday, November 9, 2026

Weekend DIY Challenge: Build a Simple Temperature Monitoring System

Want a practical electronics project for the weekend? 🔧🌡️

DIY Temperature Monitoring System.

A simple temperature monitoring system is a great DIY project for learning about sensors, microcontrollers and real-time data monitoring.

What Does the System Do?

The system measures the surrounding temperature using a temperature sensor and displays the reading on a screen.

You can also add an optional alert when the temperature becomes too high or too low.

Basic System Flow

🌡️ Temperature Sensor → 🧠 Microcontroller → 📺 Display → 🚨 Optional Alert

Components You Can Use

🌡️ Temperature Sensor

You can use a sensor such as:

  • LM35

  • DS18B20

The sensor detects the temperature and sends data to the microcontroller.

🧠 Microcontroller

An Arduino or ESP32 can process the sensor data.

The microcontroller reads the temperature value and controls the display or alert system.

📺 LCD or OLED Display

The display shows the temperature reading in real time.

For example:

Temperature: 28.5°C

🔌 Jumper Wires

Jumper wires are used to connect the sensor, microcontroller and display.

⚡ Power Supply

A suitable power supply provides the required voltage for the system.

How Does It Work?

Step 1: Measure Temperature

The temperature sensor detects the surrounding temperature.

Step 2: Process the Data

The Arduino or ESP32 reads and processes the sensor data.

Step 3: Display the Reading

The temperature value is displayed on an LCD or OLED screen.

Step 4: Add an Optional Alert

You can add a:

  • Buzzer

  • LED indicator

The alert can activate when the temperature reaches a selected limit.

Why Is This a Good DIY Project?

This project can help beginners learn about:

✅ Electronic sensors
✅ Microcontrollers
✅ Basic programming
✅ Real-time monitoring
✅ Display interfaces
✅ Automation concepts

You can also expand the project later by adding Wi-Fi connectivity, data logging or mobile monitoring using an ESP32.

Take the Weekend DIY Challenge!

🌡️ Can you build your own temperature monitoring system this weekend?

Start with a simple sensor and display, then improve the project with additional features as you learn.

Small DIY projects can be a great way to build practical electronics and engineering skills.

Follow MY CREATIVE ENGINEERING for more electronics projects, tutorials and engineering knowledge. 🔧⚡

Wednesday, November 4, 2026

How to Use an SW-420 Vibration Sensor

The SW-420 Vibration Sensor Module is a simple electronic sensor designed to detect vibration, shock and movement. It is commonly used in Arduino projects, alarm systems and automation applications.

When vibration reaches the selected sensitivity level, the module provides a digital output signal that can be read by a microcontroller such as an Arduino or ESP32.

SW-420 Vibration Sensor Module

SW-420 Pin Connection

The module normally includes three main connections:

🔴 VCC — Connect to the power supply.

⚫ GND — Connect to ground.

🔵 DO (Digital Output) — Connect to a digital input pin on your Arduino, ESP32 or other microcontroller.


Adjusting the Sensitivity

The SW-420 module includes an onboard potentiometer that allows you to adjust its sensitivity.

By turning the potentiometer, you can change the vibration level required to trigger the sensor output.


Common Applications

The SW-420 Vibration Sensor can be used for:

  • Alarm and security systems

  • Vibration monitoring

  • Shock and impact detection

  • Arduino projects

  • ESP32 projects

  • DIY automation systems


Shop the SW-420 Vibration Sensor

Shopee:
https://s.shopee.com.my/qknO0M4pK?share_channel_code=1

Lazada:
https://s.lazada.com.my/s.ZiAJRt

TikTok Shop:
https://vt.tiktok.com/ZS9yvbfTpuE4D-auQaz/

AliExpress:
https://s.click.aliexpress.com/e/_c4skEMbz


The SW-420 is an affordable and easy-to-use sensor for experimenting with vibration detection in electronics projects.

Follow MY CREATIVE ENGINEERING for more electronics tutorials, product guides and practical DIY projects.

#SW420 #VibrationSensor #Arduino #ESP32 #Electronics #DIYProjects #Automation

Understanding PWM: How Electronic Speed Control Works

Pulse Width Modulation, commonly known as PWM, is an important electronic control technique used to control the average power delivered to a device.

Understanding PWM.

PWM is commonly used for controlling:

  • DC motor speed
  • Fan speed
  • LED brightness
  • Electronic power control

What Is PWM?

PWM works by switching a voltage signal ON and OFF very rapidly.

Instead of continuously reducing the voltage, the controller changes the amount of time that the signal stays ON during each cycle.

This is called the Duty Cycle.


Understanding Duty Cycle

The duty cycle represents the percentage of time that the signal remains ON during one complete cycle.

  • 25% Duty Cycle: Lower average power
  • 50% Duty Cycle: Medium average power
  • 75% Duty Cycle: Higher average power
  • 100% Duty Cycle: Full power

As the duty cycle increases, the average power delivered to the connected device also increases.


How PWM Controls Motor Speed

For a DC motor, increasing the PWM duty cycle increases the average power supplied to the motor.

This generally results in:

  • Lower duty cycle → Lower motor speed
  • Higher duty cycle → Higher motor speed

PWM is an efficient method because the electronic switch is mainly operating in either the ON or OFF state.


Common Applications of PWM

DC Motor Speed Control

PWM controllers are commonly used to adjust the speed of DC motors without continuously reducing the supply voltage.

Fan Speed Control

Electronic PWM controllers can be used to control the speed of DC cooling fans and other fan systems.

LED Brightness Control

PWM can control the perceived brightness of an LED by rapidly switching it ON and OFF while changing the duty cycle.

Electronic Power Control

PWM is also widely used in power electronics, automation systems and microcontroller-based projects.


Conclusion

PWM is a simple but powerful technique for controlling electronic devices. By adjusting the duty cycle, you can control the average power delivered to a motor, fan, LED or other electronic load.

Understanding PWM is useful for anyone working with Arduino, ESP32, electronics projects, automation and motor control systems.

Follow MY CREATIVE ENGINEERING for more practical electronics tutorials, product guides and DIY projects.

Tuesday, October 27, 2026

N-Channel MOSFET Explained: Pinout, Low-Side Switching and Gate Drive

Understand MOSFET terminals, switching principles, gate-drive requirements and practical circuit design for electronics projects. An N-channel MOSFET is a voltage-controlled semiconductor widely used to switch DC loads in electronics, embedded systems and power circuits. It allows a control signal to regulate current through a separate drain-source path.

N-Channel IRFZ44N MOSFET.

MOSFETs are commonly found in motor controllers, LED drivers, battery systems, power supplies and microcontroller projects. However, choosing the correct device requires more than checking its current rating. Gate-drive voltage, on-resistance, operating temperature and load characteristics all affect performance.

In this guide, MY CREATIVE ENGINEERING explains how an N-channel MOSFET works, how to identify its terminals, and what to consider when designing or troubleshooting a switching circuit.


1. What Is an N-Channel MOSFET?

MOSFET stands for Metal-Oxide-Semiconductor Field-Effect Transistor. An N-channel MOSFET uses an electric field created by the gate voltage to control the conductivity of its semiconductor channel.

Unlike a conventional mechanical switch, a MOSFET has no moving contacts. It can switch electronically and, when properly selected and driven, operate efficiently in many power-control applications.

Common Applications
  • DC motor and solenoid control.
  • LED switching and lighting circuits.
  • Arduino and microcontroller projects.
  • Battery-powered electronic equipment.
  • Switch-mode power supplies.
  • Electronic control and automation systems.

2. Identify the Three MOSFET Terminals

A typical three-terminal power MOSFET has three main connections. Understanding their functions is essential before connecting the component to a circuit.

Terminal Function
Gate (G) Receives the control voltage that regulates the channel.
Drain (D) One terminal of the main drain-source current path.
Source (S) The other terminal of the main drain-source current path.

The physical pin arrangement depends on the exact component and package. Many TO-220 power MOSFETs use Gate, Drain and Source when viewed from the front with the leads pointing downward, but this arrangement is not universal.

Important: Always check the manufacturer's datasheet before wiring a MOSFET. On many TO-220 power MOSFETs, the metal tab is electrically connected to the drain. An improperly insulated heatsink can therefore create an electrical short.

3. How Does an N-Channel MOSFET Work?

The voltage between the gate and source is called VGS. This voltage influences how conductive the channel becomes.

When the gate-to-source voltage is insufficient, the MOSFET remains off or allows only a small leakage current. As the gate voltage increases relative to the source, the channel can become more conductive.

The datasheet specifies a gate-threshold voltage, written as VGS(th). This is measured under defined test conditions and indicates the onset of conduction.

Engineering principle: Gate-threshold voltage is not the same as the voltage required to switch a MOSFET fully on. For switching applications, check the specified drain-source on-resistance, RDS(on), at the gate voltage your circuit actually provides.

4. Understanding Low-Side MOSFET Switching

One common application is the low-side switching circuit. In this arrangement, the N-channel MOSFET is placed between the load and the circuit's 0V reference.

Typical Connection Arrangement
  1. Connect the positive side of the DC supply to the load.
  2. Connect the other side of the load to the MOSFET drain.
  3. Connect the MOSFET source to the circuit's 0V reference.
  4. Connect the controller output to the gate through an appropriate drive arrangement.
  5. Ensure the controller and power supply share the required reference connection.

When the MOSFET is adequately switched on, current flows from the positive supply through the load and then through the MOSFET's drain-source path to 0V.

When the MOSFET switches off, the intended current path is interrupted. However, inductive loads and other circuit elements may require additional components to manage stored energy.


5. Gate Resistors and Pull-Down Resistors

A MOSFET gate behaves partly like a capacitor. Changing its voltage requires charge to flow into or out of the gate.

Series Gate Resistor

A resistor placed between the controller or gate driver and the MOSFET gate can help limit peak gate-charging current and reduce ringing or electromagnetic interference.

Values in the 100 Ω to 1 kΩ range are sometimes used in practical circuits, but the correct value depends on switching speed, gate charge, driver capability and circuit layout.

Gate-to-Source Pull-Down Resistor

A pull-down resistor connects the gate to the source. It helps keep the MOSFET off when the controller output is floating during startup, reset or disconnection.

Its value should suit the circuit's leakage currents, noise environment and required switching behaviour. It is not a substitute for a proper gate-drive design.


6. Selecting a MOSFET for Arduino and Microcontrollers

A common mistake is selecting a MOSFET simply because its threshold voltage is lower than the output voltage of an Arduino, ESP32 or another microcontroller.

A MOSFET may begin conducting at a low gate voltage while still having excessive on-resistance at that voltage. The resulting voltage drop and heat can cause unreliable operation or damage.

Datasheet Selection Checklist
  • RDS(on): Check the specified value at the intended gate voltage.
  • Drain-source voltage: Ensure the rating exceeds the circuit's operating voltage and relevant transients.
  • Current capability: Consider the real operating conditions, not just the headline rating.
  • Gate-source voltage: Stay within the specified absolute maximum limits.
  • Thermal performance: Evaluate junction temperature, PCB copper and heatsinking.
  • Safe operating area: Confirm the device can handle the actual switching conditions.

A logic-level MOSFET is designed to provide useful conduction at relatively low gate-drive voltages. Nevertheless, always verify its actual RDS(on) specification at 3.3 V or 5 V rather than relying on the logic-level label alone.


7. Voltage, Current and Heat Dissipation

A MOSFET's advertised current rating does not necessarily represent the current it can safely carry in every circuit. The rating may depend on case temperature, cooling arrangements and other specified conditions.

When a MOSFET is switched on, its on-resistance causes conduction losses. A useful first-order estimate is:

P = I² × RDS(on)

Where:

  • P is the approximate conduction power loss in watts.
  • I is the current through the MOSFET in amperes.
  • RDS(on) is the effective on-resistance in ohms.
Worked Example

Assume the following operating conditions:

  • Load current: 3 A
  • Effective MOSFET on-resistance: 0.05 Ω
P = 3² × 0.05 = 0.45 W

Under these assumptions, the estimated conduction loss is approximately 0.45 W.

This calculation is only a first-order estimate. On-resistance usually increases with junction temperature, and switching losses can add further heat. The actual design must account for the switching frequency, operating conditions and thermal resistance.

Design reminder: Check the manufacturer's thermal specifications and safe operating area. Do not assume that a MOSFET can continuously handle its maximum advertised current without suitable cooling.

8. Protecting Inductive Loads

Motors, relays and solenoids store energy in their magnetic fields. When the current is interrupted, they can generate voltage transients that exceed the MOSFET's rating.

Depending on the application, protection may include a flyback diode, transient-voltage-suppression diode or another suitable clamping arrangement.

Select the protection components according to the supply voltage, load current, switching frequency and required release time. A simple flyback diode may be suitable for some DC relay coils and solenoids, while faster switching applications may require a different approach.

Also consider wiring inductance, PCB layout and transient measurements when designing circuits that switch significant currents.


9. Common MOSFET Switching Mistakes

Mistake 1: Confusing Threshold Voltage with Fully-On Voltage

The threshold voltage indicates the onset of conduction. It does not guarantee low on-resistance. Check RDS(on) at the intended gate voltage.

Mistake 2: Using an Unsuitable MOSFET with a 3.3 V GPIO

A MOSFET intended for a higher gate-drive voltage may not switch efficiently from a 3.3 V microcontroller output. Select a suitable logic-level device or gate driver.

Mistake 3: Connecting the Wrong Pins

Pin arrangements vary between components. Verify the exact manufacturer's package drawing before wiring.

Mistake 4: Allowing the Gate to Float

An undefined gate voltage can cause unwanted switching. Consider a suitable pull-down resistor and a defined startup state.

Mistake 5: Ignoring Heat Dissipation

Calculate conduction losses, consider switching losses, and verify that the PCB and heatsink can maintain a safe junction temperature.

Mistake 6: Forgetting Inductive-Load Protection

Motors and solenoids can generate voltage spikes. Use a suitable protection strategy for the actual load and switching circuit.

Mistake 7: Exceeding Electrical Ratings

Check voltage, current, gate-drive limits and safe operating conditions. Include appropriate design margins.


10. Final Design Checklist

  • Confirm the exact MOSFET part number and pinout.
  • Verify RDS(on) at the intended gate-drive voltage.
  • Check the maximum drain-source and gate-source voltages.
  • Calculate expected conduction losses.
  • Consider switching losses and thermal performance.
  • Provide a defined gate state during startup.
  • Assess the need for inductive-load protection.
  • Test the circuit under its actual operating conditions.

Conclusion

An N-channel MOSFET is a versatile component for switching DC loads in electronics, embedded systems and automation projects. Reliable operation depends on correct pin identification, suitable gate-drive voltage, low enough on-resistance and adequate thermal design.

Before using a MOSFET with Arduino or another microcontroller, consult the manufacturer's datasheet and confirm that the device meets the requirements of your actual circuit. For inductive loads, evaluate suitable transient protection before powering the system.

Understanding these fundamentals helps you design more reliable switching circuits and troubleshoot common MOSFET-related faults.


Learn. Build. Repair.

Follow MY CREATIVE ENGINEERING for practical electronics tutorials, component guides, circuit-design tips and automation projects.

Have you used an N-channel MOSFET in your project? Share your experience and questions in the comments.

Wednesday, October 21, 2026

How to Use the HC-SR04 Ultrasonic Sensor with Arduino: Complete Beginner’s Guide

The HC-SR04 ultrasonic sensor is a popular, affordable component used to measure distance in Arduino projects. It uses ultrasonic sound waves to detect objects without physical contact. This sensor is useful for robotics, obstacle avoidance, parking assistance prototypes, water-level monitoring, and many other DIY electronics projects.

In this guide, you will learn how the HC-SR04 works, how to connect it to an Arduino Uno, and how to write a simple program to measure distance in centimetres.

How to Use HC-SR04.

What Is the HC-SR04 Ultrasonic Sensor?

The HC-SR04 is an electronic distance-measuring module with two round ultrasonic transducers.

  • Transmitter: Sends out an ultrasonic sound pulse.

  • Receiver: Detects the returning echo.

  • Control circuitry: Helps generate the pulse and produce an echo signal for the Arduino to measure.

The sensor typically operates at around 40 kHz, which is above the range of human hearing.

Many HC-SR04 modules specify a nominal measuring range of approximately 2 cm to 400 cm. Actual performance depends on the target, environment, sensor alignment, and module quality.

How Does the HC-SR04 Work?

The sensor measures the time taken for an ultrasonic pulse to travel to an object and return.

The basic process is:

  1. The Arduino sends a short trigger pulse to the sensor’s TRIG pin.

  2. The sensor transmits an ultrasonic burst.

  3. The sound waves reflect from an object.

  4. The sensor’s ECHO pin produces a pulse whose duration represents the round-trip travel time.

  5. The Arduino calculates the distance using the speed of sound.

Because the sound travels to the object and back, the measured time must be divided by two when calculating one-way distance.

The approximate formula at room temperature is:

Distance (cm) = Echo duration (µs) × 0.0343 ÷ 2

For example, if the measured echo duration is 1,000 microseconds:

Distance = 1,000 × 0.0343 ÷ 2

Distance ≈ 17.15 cm

This is an approximate result because the speed of sound changes with air temperature.

HC-SR04 Pin Configuration

The standard HC-SR04 module has four pins:

PinFunction
VCCPower supply, typically 5V
TRIGTrigger input
ECHOEcho output
GNDGround

Check the labels on your actual module before connecting it. Pin layouts and markings can vary between products.

How to Connect the HC-SR04 to Arduino Uno

For this example, use an Arduino Uno and the following connections:

HC-SR04 PinArduino Uno
VCC5V
TRIGDigital pin 9
ECHODigital pin 10
GNDGND

Make sure the wiring is secure before powering the circuit.

Important: The standard HC-SR04 ECHO output is typically a 5V logic signal. If you use a 3.3V-only microcontroller, such as many ESP32 boards, use an appropriate voltage divider or logic-level interface on ECHO unless the specific board or module supports 5V input.

Arduino Code for Measuring Distance

Connect the sensor according to the wiring table, then upload this example to your Arduino Uno.

const int trigPin = 9;
const int echoPin = 10;

void setup() {
  Serial.begin(9600);

  pinMode(trigPin, OUTPUT);
  pinMode(echoPin, INPUT);
}

void loop() {
  // Ensure the trigger starts LOW
  digitalWrite(trigPin, LOW);
  delayMicroseconds(2);

  // Send a 10-microsecond trigger pulse
  digitalWrite(trigPin, HIGH);
  delayMicroseconds(10);
  digitalWrite(trigPin, LOW);

  // Measure the echo pulse, with a timeout
  long duration = pulseIn(echoPin, HIGH, 30000);

  if (duration == 0) {
    Serial.println("No echo detected");
  } else {
    float distance = duration * 0.0343 / 2.0;

    Serial.print("Distance: ");
    Serial.print(distance, 1);
    Serial.println(" cm");
  }

  delay(500);
}

This program sends a trigger pulse, measures the echo duration, calculates the distance, and prints the result to the Serial Monitor.

The pulseIn() timeout prevents the program from waiting indefinitely when no echo is received.

How to View the Distance Reading

After uploading the code:

  1. Connect the Arduino to your computer using a USB cable.

  2. Open the Arduino IDE.

  3. Select the correct board and COM port.

  4. Open the Serial Monitor.

  5. Set the baud rate to 9600.

  6. Place an object in front of the sensor and observe the readings.

Example output:

Distance: 23.5 cm
Distance: 24.1 cm
Distance: 22.8 cm
Distance: 23.0 cm

These are illustrative readings. Your actual results will depend on the distance, target surface, and surrounding conditions.

Common Applications of the HC-SR04

1. Obstacle Avoidance Robot

A robot can use the sensor to detect objects in front of it and trigger a stop, turn, or avoidance routine.

2. Water-Level Monitoring

The sensor can measure the distance from a fixed mounting point to a water surface. A suitable enclosure and installation are important to protect the electronics from moisture.

3. Parking Assistance Prototype

A project can estimate the distance between a vehicle model and an obstacle, then use LEDs or a buzzer to indicate proximity.

4. Robotics and Automation

The HC-SR04 is useful for learning distance measurement, object detection, and basic automation control.

5. General Distance Measurement

It can measure the distance to suitable objects in science experiments, DIY projects, and educational demonstrations.

Tips for Better Measurement Accuracy

For more reliable readings:

  • Keep the sensor firmly mounted.

  • Aim it directly toward the target.

  • Use a large, reasonably flat target when testing.

  • Avoid soft materials that absorb sound.

  • Be aware that angled surfaces may reflect sound away from the receiver.

  • Allow enough time between measurements to avoid confusing echoes.

  • Consider temperature changes when higher accuracy is required.

The HC-SR04 is not a precision industrial measuring instrument. For demanding environments or high-reliability applications, choose a sensor designed for those requirements.

Troubleshooting Common Problems

Problem: The Serial Monitor always shows zero or no echo.

Check the TRIG and ECHO wiring, power supply, ground connection, and target position. Make sure the correct COM port and baud rate are selected.

Problem: The readings fluctuate.

Try using a larger, flat target, mounting the sensor securely, and taking several readings to calculate an average.

Problem: The sensor does not detect soft or angled objects reliably.

Some materials absorb ultrasonic energy, while angled surfaces may reflect sound away from the receiver. Try a different target orientation.

Problem: The sensor does not work with a 3.3V microcontroller.

Check the module’s voltage requirements and ensure that the ECHO signal is safe for the controller’s input pins.

Conclusion

The HC-SR04 ultrasonic sensor is an accessible way to learn distance measurement with Arduino. With four simple connections and a short program, you can build projects involving obstacle detection, robotics, water-level monitoring, and basic automation.

Once you understand how the trigger pulse, echo duration, and distance formula work together, you can adapt the same principles to more advanced electronics projects.

Explore more electronics parts and project ideas with MY CREATIVE ENGINEERING — Your Electronics Parts & Projects Partner.

Follow us for more practical electronics tutorials, component guides, and automation projects.

Friday, July 17, 2026

DIY Cooling Box Using Arduino and TEC1-12706 Peltier Module

Looking for an interesting Arduino project? In this project, we built a DIY Cooling Box using an Arduino Uno and TEC1-12706 Peltier module. The system monitors the temperature inside the box and controls the cooling system while displaying the current temperature on a 16x2 LCD. During testing, the temperature dropped from approximately 34°C to 30°C within several minutes.

Building a DIY Arduino-Powered Cooling Box

How the Cooling Box Works

The main cooling component is the TEC1-12706 Peltier module. When powered, one side becomes cold while the other side becomes hot. The cold side faces inside the cooling box, while the hot side transfers heat to a heatsink and cooling fan.

The Arduino Uno acts as the main controller. A DHT11 sensor measures the temperature inside the box, while a 16x2 LCD with I2C displays the current temperature and cooling status. A 2-channel relay module is used to switch the cooling system.


Components Used

Components Required for the DIY Cooling Box

The components used for this project include an Arduino Uno R3, 2-channel relay module, TEC1-12706 Peltier module, 12V DC cooling fan with heatsink, 16x2 LCD I2C display, DHT11 sensor, breadboard, DC barrel jack adapter, jumper wires, 12V power supply, and thermal paste.

Wiring and Arduino Programming

Connecting the Components According to the Wiring Diagram

Before installing the components inside the box, we connected everything according to the wiring diagram. Carefully checking the wiring before applying power helps prevent incorrect connections and makes troubleshooting easier.

Uploading the Arduino Code

Next, the Arduino program was uploaded to the Arduino Uno. The program reads the temperature from the DHT11 sensor, displays the information on the LCD, and controls the cooling system. Click HERE to download.


Mock Testing

Testing the Circuit Before Final Installation

Before installing everything into the cooling box, we performed a mock test. We checked that the LCD displayed correctly and that the relay, cooling fan, Peltier module, and temperature sensor were operating properly.


Installing the Cooling Fan and Heatsink

Preparing the Box for the Cooling System

An opening was made in the cooling box to install the cooling fan and heatsink. Proper positioning of the heatsink and fan is important to effectively remove heat generated by the Peltier module.


Installing the Peltier Module

Installing the TEC1-12706 Peltier Module

A thin layer of thermal paste was applied between the TEC1-12706 Peltier module and the heatsink to improve heat transfer. The hot side faces the heatsink, while the cold side faces inside the cooling box.


Installing the LCD Display

Mounting the 16x2 LCD I2C Display

The 16x2 LCD I2C display was mounted on the outside of the cooling box using double-sided tape. This allows the temperature and cooling status to be monitored without opening the box.


Installing the DHT11 Sensor

Placing the DHT11 Sensor Inside the Cooling Box

The DHT11 temperature and humidity sensor was placed inside the box to monitor the internal temperature. Its readings are sent to the Arduino and displayed on the LCD.


Final Wiring

Reconnecting and Organizing All Components

After installing the components, everything was reconnected according to the wiring diagram. The wires were arranged neatly to keep the project organized and make future maintenance easier.


Testing the Cooling Box

Powering Up the Completed Cooling Box

After completing the assembly, the system was powered on. We checked that the LCD turned on, the cooling fan was running, and the cooling system was operating correctly.

Temperature Drops from 34°C to 30°C

During our cooling test, the LCD showed the temperature gradually decreasing from approximately 34°C to 30°C within several minutes. Actual performance may vary depending on the box insulation, ambient temperature, heatsink, airflow, and power supply.


Conclusion

This DIY cooling box is a great project for learning about Arduino programming, thermoelectric cooling, temperature monitoring, sensors, and relay control. The design can be further improved with better insulation, a larger heatsink, improved airflow, or a more accurate temperature sensor.

Project Contributor: Nasiruddin Bin Nadzrin
Intern, Universiti Teknikal Malaysia Melaka (UTeM)

Friday, June 5, 2026

TCRT5000 3 Channel Line Tracker Sensor Module with Arduino Uno

The TCRT5000 3 Channel Line Tracker Sensor Module is widely used in robotics and automation projects for detecting lines and distinguishing between black and white surfaces. It uses infrared (IR) reflective sensors to measure the amount of reflected light from a surface.

TCRT5000 3-channel line tracker sensor module used with Arduino Uno.

In this project, we will interface a TCRT5000 3-channel module with an Arduino Uno and observe how the sensor responds to black and white surfaces using the Arduino Serial Monitor.


What is the TCRT5000 Line Tracker Sensor?

The TCRT5000 is an infrared reflective sensor consisting of an IR LED transmitter and a phototransistor receiver. When infrared light is emitted, the amount of reflected light depends on the surface color.

  • White surfaces reflect more infrared light.
  • Black surfaces absorb more infrared light.
Line detection principle based on reflected infrared light.

This principle allows the sensor to detect lines and is commonly used in line-following robots.


Components Required

Components needed for the TCRT5000 Arduino project.
  • Arduino Uno
  • TCRT5000 3 Channel Line Tracker Module
  • Dupont Jumper Wires
  • USB Cable
  • Cardboard
  • Black Electrical Tape

Wiring Connections

Wiring diagram between the TCRT5000 module and Arduino Uno.
  • VCC → 5V
  • GND → GND
  • L → A0
  • C → A1
  • R → A2

Arduino Code

Arduino sketch for reading three TCRT5000 sensor channels.
Upload the following code to the Arduino Uno. You can download coding click HERE.
int L = A0;
int C = A1;
int R = A2;

void setup() {
  Serial.begin(9600);
}

void loop() {
  int valL = analogRead(L);
  int valC = analogRead(C);
  int valR = analogRead(R);

  Serial.print("L: ");
  Serial.print(valL);

  Serial.print(" C: ");
  Serial.print(valC);

  Serial.print(" R: ");
  Serial.println(valR);

  delay(300);
}


How the Code Works

The program continuously reads the analog values from the three sensor channels.

  • Left sensor connected to A0
  • Center sensor connected to A1
  • Right sensor connected to A2

The sensor readings are displayed in the Arduino Serial Monitor every 300 milliseconds.


Sensor Testing

To test the module:

  1. Place the sensor above a white cardboard surface.
  2. Observe the indicator LEDs on the module.
  3. Move the sensor above the black tape line.
  4. Compare the readings shown on the Serial Monitor.

White Surface

Sensor positioned above a white reflective surface.

When the sensor is positioned above the white cardboard:
  • The infrared light is strongly reflected.
  • Indicator LEDs turn ON.
  • Higher sensor readings are observed.

Black Surface

Sensor positioned above a black non-reflective surface.

When the sensor is positioned above the black tape:

  • Less infrared light is reflected.
  • Indicator LEDs turn OFF.
  • Sensor readings change significantly.

This difference allows robots to detect and follow a black line on a white background.


Adjusting Sensor Sensitivity

Sensitivity adjustment using the onboard potentiometer.
The blue potentiometer on the module allows sensitivity adjustment.
  • Turn clockwise to increase sensitivity.
  • Turn counterclockwise to decrease sensitivity.

Adjust the potentiometer until the sensor can clearly distinguish between the black tape and white cardboard.


Applications

  • Line Following Robots
  • Automated Guided Vehicles (AGV)
  • Obstacle Detection Systems
  • Surface Color Detection
  • Industrial Automation Projects
  • Educational Robotics Projects


Conclusion


The TCRT5000 3 Channel Line Tracker Sensor Module is an inexpensive and effective sensor for line detection applications. By interfacing it with an Arduino Uno, we can easily monitor sensor readings and detect the difference between black and white surfaces.

This project demonstrates the basic operation of the sensor and provides a foundation for building line-following robots and automation systems.

Sunday, May 17, 2026

Beginner Guide to Using LCD 1602 I2C with Arduino UNO

LCD 1602 I2C is one of the most popular display modules used in Arduino projects. It is simple to use, requires only 4 wires, and can display text clearly for various electronics projects such as temperature monitors, counters, sensors, and automation systems.

Easy LCD Display Module for Arduino Projects.

In this tutorial, we will learn how to connect and use the LCD 1602 I2C display with Arduino UNO.


What is LCD 1602 I2C?

The LCD 1602 I2C is a 16x2 character display module with an I2C interface adapter attached at the back. Compared to a normal LCD 1602, the I2C version uses fewer Arduino pins, making wiring much easier and cleaner.

The display can show:

  • 16 characters per row
  • 2 rows of text
  • Letters, numbers, and symbols

It is suitable for beginners and advanced Arduino users.


LCD 1602 I2C Specifications

LCD 1602 I2C Technical Specifications.
Here are the basic specifications of the LCD module:
  • Display Type: Character LCD
  • Display Format: 16x2
  • Interface: I2C Communication
  • Operating Voltage: 5V DC
  • Adjustable Contrast
  • Only 4 Wires Required

The module usually comes in Blue or Yellow-Green backlight versions.


Components Required

Components Needed for This Project.
For this project, we need:
  • Arduino UNO R3
  • LCD 1602 I2C Module
  • Jumper Wires
  • Breadboard
  • USB Cable

Wiring Diagram

LCD 1602 I2C Wiring Connection.

Connect the LCD 1602 I2C to Arduino UNO using the following connections:

LCD I2C → Arduino UNO
VCC → 5V
GND → GND
SDA → A4
SCL → A5

The I2C interface allows communication using only SDA and SCL pins.


Actual Wiring Connection

Actual Hardware Wiring Setup.

After checking the wiring diagram, connect all components using jumper wires.

Make sure:

  • Wires are connected securely
  • VCC and GND are not reversed
  • SDA and SCL are connected correctly

Incorrect wiring may cause the LCD not to display any text.


Check LCD Address Using I2C Scanner

Check LCD I2C Address First.
Before uploading the LCD code, it is important to check the I2C address of the module.

Most LCD 1602 I2C modules use:

  • 0x27
  • 0x3F

Upload the I2C Scanner code to Arduino and open the Serial Monitor to detect the correct address.

If the address is different, change it inside the LCD code.


LCD 1602 I2C Arduino Code

Upload LCD Arduino Code.

After confirming the I2C address, upload the LCD display code using Arduino IDE. You can download HERE.

This example will display scrolling text:
“Welcome To MCE :)”

The code uses:

  • Wire.h library
  • LiquidCrystal_I2C library

The text will continuously move across the LCD display.


Adjust LCD Contrast

Adjust LCD Contrast Potentiometer.
If the display is blank or difficult to see, adjust the blue potentiometer at the back of the LCD module.

Rotate:

  • Clockwise
  • Counter clockwise

until the characters become visible clearly.


Final Result

Final LCD Display Output.

Once everything is connected correctly and the code is uploaded successfully, the LCD will display:

Welcome To MCE :)

You should now see the scrolling text running smoothly on the LCD display.


📦 Where to Buy

Shopee:
Lazada:
Aliexpress:


Conclusion


Using LCD 1602 I2C with Arduino UNO is simple and beginner-friendly. Since it only requires 4 wires, it helps reduce complicated wiring and saves Arduino pins for other sensors and modules. We hope this tutorial helps you start using LCD 1602 I2C in your own Arduino projects.

Friday, May 15, 2026

How to Use 0–25V Voltage Sensor Module with Arduino UNO

In this tutorial, we will learn how to use the 0–25V DC Voltage Sensor Module with Arduino UNO. This sensor module allows Arduino to measure higher DC voltages safely through the analog input pin. It is commonly used for battery monitoring, solar projects, power supply measurement, and other DIY electronics applications.

Learning how to measure DC voltage using the 0–25V Voltage Sensor Module with Arduino UNO.


What is a Voltage Sensor Module?

The 0–25V Voltage Sensor Module is a simple voltage divider circuit that reduces higher DC voltages into a safe analog voltage readable by Arduino.

Since Arduino UNO analog pins can only read up to 5V, this module scales down the input voltage before sending it to the microcontroller.

For example:

  • 25V input becomes approximately 5V output to Arduino analog pin.

Sensor Specifications

Technical specifications of the 0–25V DC Voltage Sensor Module.


Components Required

Components used in this Arduino voltage monitoring tutorial.

For this project, we need:

  • VS-25 Voltage Sensor Module
  • Arduino UNO
  • Breadboard
  • Jumper Wires
  • Adjustable DC Power Supply
  • USB Cable
  • Multimeter

Wiring Connection

Wiring connection between the Voltage Sensor Module and Arduino UNO.
  • Connect the S pin to A0
  • Connect the negative pin to GND
  • Connect the positive pin to the 5V pin on the Arduino UNO
  • Connect the adjustable power supply to the voltage input terminal of the sensor module

Arduino Code

Click HERE to download code. Upload the following code to Arduino UNO:

int sensorPin = A0;
float voltage = 0;

void setup() {
  Serial.begin(9600);
}

void loop() {

  int value = analogRead(sensorPin);

  // Formula calculate actual voltage
  voltage = value * (25.0 / 1023.0);

  Serial.print("Voltage: ");
  Serial.println(voltage);

  delay(1000);

}

Testing the Voltage Sensor

Testing the voltage sensor module using adjustable power supply and multimeter.

After uploading the code:
  1. Open the Arduino Serial Monitor.
  2. Turn on the adjustable power supply.
  3. Adjust the voltage to approximately 19.83V.
  4. Observe the reading on the Serial Monitor.

During testing, the Arduino reading may show a slightly different value compared to the multimeter reading.

Serial Monitor and multimeter voltage comparison during testing.

This small difference is normal because the voltage sensor module is not a high-precision measurement device. However, the result is still close enough and suitable for most hobby and DIY electronics projects.


Applications

This voltage sensor module can be used for:

  • Battery Voltage Monitoring
  • Solar Power Projects
  • DC Power Supply Monitoring
  • Automotive Voltage Detection
  • DIY Electronics Projects
  • IoT Voltage Monitoring Systems


Conclusion


The 0–25V Voltage Sensor Module is a simple and affordable way to measure DC voltage using Arduino UNO. It is beginner-friendly, easy to connect, and useful for many electronics projects. Although it is not highly accurate like professional measuring equipment, it performs well enough for learning and DIY applications. 

Thank you for reading this tutorial. Don’t forget to like, share, and subscribe for more Arduino and electronics projects.