Arduino Line Follower Robot Circuit Diagram

Arduino Line Follower Robot Circuit DiagramIntro: A line follower robot is one of the best first robotics projects: place it on a black line drawn on white paper, switch it on, and it steers itself along the line. It teaches sensors, motor control and simple decision-making in a single afternoon build.
How It Works: Two infrared sensors look down at the floor. A dark line reflects less infrared light than the white surface around it, so each sensor can tell whether it is over the line or not. The Arduino reads both sensors and decides what to do: both sensors on the line means drive straight, only the left sensor on the line means turn left, only the right sensor on the line means turn right, and neither on the line means stop or search slowly.
Components Required: Arduino Uno or Nano board; two IR obstacle or line sensor modules; L298N motor driver module; two DC gear motors with wheels; robot chassis or a small board; battery pack matched to the motor driver (7.4 V is a common example); jumper wires.
Circuit Connections: Left IR sensor output to Arduino digital pin 2, right IR sensor output to digital pin 3, both sensors powered from 5V and GND. L298N inputs to Arduino digital pins 6, 7, 8 and 9, enable pins to pins 10 and 11. Left motor to the driver's first output pair, right motor to the second output pair. Battery pack to the driver's power input, and the driver and Arduino grounds connected together. Follow the L298N module's own guide for its power jumper.
Build Steps: 1. Mount the two sensors at the front, close to the floor and a small distance apart. 2. Wire the sensors, driver and motors as listed. 3. Load a program that reads pins 2 and 3 and drives the motors straight, left, right, or stopped as described above. 4. Draw a thick black line on white paper and test at slow speed first. 5. Adjust the sensor height and the motor speed until the robot follows smooth curves without overshooting.
Troubleshooting: Robot spins in circles: check that the left and right motors are not swapped. Robot ignores the line: lower the sensors closer to the floor and check the sensor adjustment knobs. Motors too weak: check the battery charge and that the driver is receiving power. Jerky movement: lower the speed and add a short delay between sensor reads.
Safety Note: This project uses low-voltage DC only and involves no mains electricity. Keep fingers clear of spinning wheels, do not short the battery terminals, and ask an experienced maker to check the wiring if you are unsure.
Going Further: Try adding a third centre sensor for smoother steering, a buzzer that beeps at junctions, or a speed control that slows the robot on sharp bends. What track will you draw first — a circle, a curve, or a maze? Tell us in the comments.
Read More

Arduino Gas Leakage Detector Circuit with MQ-2

Arduino Gas Leakage Detector Circuit with MQ-2

Intro

A gas leak is dangerous because it is hard to notice early. This beginner Arduino project watches the air with an MQ-2 gas sensor and raises a loud alarm as soon as the gas level rises above a level you set. It is a useful learning build and a handy early-warning aid for a kitchen or workshop.


How It Works

The MQ-2 sensor changes its resistance when combustible gas or smoke is present. The Arduino reads that change on an analog pin, compares it with a threshold set after calibration in clean air, and shows the level on an LCD. Below the threshold the display stays calm; above it the buzzer sounds and the red LED lights until the air clears.


Components Required

Arduino Uno board; MQ-2 gas sensor module; active buzzer; red LED with a resistor; 16x2 LCD display with I2C adapter; 5V USB power supply; jumper wires and a breadboard.


Circuit Connections

MQ-2 VCC to 5V, GND to GND, analog output A0 to Arduino A0. Buzzer positive to digital pin 8, negative to GND. Red LED anode to digital pin 9 through a resistor, cathode to GND. LCD I2C SDA to A4, SCL to A5 on the Uno. Power the whole circuit from USB 5V for this small build.


Build Steps

1. Wire the sensor and LCD first and confirm the display shows a steady reading in clean air. 2. Let the sensor warm up for a few minutes, then note its clean-air reading as your baseline. 3. Set the alarm threshold a sensible margin above that baseline in the program. 4. Add the buzzer and LED, then test the alarm by bringing a safe test source near the sensor only as the module instructions allow — never by creating a real gas leak. 5. Mount the sensor low near the floor for LPG, since LPG is heavier than air, and keep it away from steam and cooking fumes.


Troubleshooting

Reading stuck high: let the sensor warm up fully and check for fumes, steam or alcohol vapour nearby. Alarm never triggers: lower the threshold step by step and check the A0 wiring. LCD blank: check the I2C address and that SDA and SCL are not swapped. Buzzer weak: check its polarity and that it is an active buzzer, not a passive one.


Safety Note

This is a DIY learning project, not a certified safety device. Never rely on it alone for gas safety, never test it with a real gas leak, and if you ever smell gas in real life, ventilate the room, do not switch electrical devices on or off, leave the area, and call your local gas emergency service. Keep the sensor away from open flames.


Going Further

Try adding a second LED for a warning zone before the full alarm, logging readings over serial, or sending an alert with a Wi-Fi board. The same sensor idea can be adapted to smoke detection practice, with the same safety limits.

Read More

Arduino Water Level Controller Circuit Diagram

 

Arduino Water Level Controller Circuit Diagram

An automatic water level controller saves water and saves you from watching a tank fill. Two simple level sensors tell an Arduino when the tank is low and when it is full, and the Arduino switches the pump through a relay — no manual switch, no overflow.

How It Works

One sensor sits near the bottom of the tank and one near the top. When the water drops below the low sensor, the Arduino turns the pump on through the relay. When the water reaches the high sensor, the Arduino turns the pump off again. Between those two points the pump keeps its last state, so it does not flicker on and off.

Components Required

  • Arduino Uno or Nano board
  • Two water level sensor probes or float switches
  • Single-channel relay module
  • Small water pump (match its voltage to your supply)
  • Power supply suitable for the Arduino and the pump
  • Jumper wires, breadboard and a small enclosure

Circuit Connections

  • Low level sensor to Arduino digital pin 7, high level sensor to digital pin 8, with grounds connected.
  • Relay module signal input to Arduino digital pin 9, VCC to 5V, GND to GND.
  • Pump connected through the relay output contacts, following the relay module's own wiring guide.
  • Keep the low-voltage Arduino wiring separate from any mains wiring.

Safety Note

If your pump runs on mains voltage, treat that part of the build with extra care: keep mains connections inside a closed enclosure, never work on them while powered, and ask an experienced person to check the wiring before first use. If you are unsure, use a low-voltage pump instead.

Build Steps

  1. Mount the two sensors in the tank at the low and high levels you want.
  2. Wire the sensors and relay as listed and test the relay switching with the pump disconnected first.
  3. Load a program that turns the relay on at the low level and off at the high level.
  4. Reconnect the pump, fill and drain the tank slowly, and confirm it starts and stops at the right levels.

Troubleshooting

  • Pump never starts: check the low sensor wiring and confirm the relay clicks when the level drops.
  • Pump never stops: check the high sensor wiring and make sure the sensor is not stuck or shorted.
  • Relay chatter: keep the low and high levels well apart and add a short delay between sensor checks.

Going Further

Once the basic controller works, try adding an LED that shows when the pump is running, a buzzer for a low-water warning, or a display that shows the tank state.

Would you fit this controller to a home tank, a garden tank, or a rainwater store? Tell us in the comments.

Read More

Arduino PIR Motion Sensor Alarm Circuit Diagram

Arduino PIR Motion Sensor Alarm Circuit Diagram

 A PIR motion sensor alarm is one of the most useful first Arduino projects: walk past it, and it sounds a buzzer and lights an LED. It is cheap, it needs no mains power, and it teaches digital inputs, outputs and timing in a single build. Put it by a door, on a desk, or in a model room to learn how real security sensors work.

How It Works

A PIR sensor, such as the HC-SR501, detects changes in infrared heat when a person moves in front of it. Its output pin goes HIGH when movement is detected and LOW again after a short delay. The Arduino watches that pin, and when it sees HIGH, it switches on a buzzer and an LED for a few seconds, then waits for the next movement.

Components Required

- Arduino Uno or Nano board

- HC-SR501 PIR motion sensor module

- Active buzzer (5V)

- LED and a 220 ohm resistor (example value)

- USB cable, jumper wires, breadboard

Circuit Connections

- PIR VCC to Arduino 5V, GND to GND, OUT to Arduino digital pin 2.

- Buzzer positive to Arduino digital pin 8, negative to GND (check your buzzer type: an active buzzer needs only a HIGH signal).

- LED anode through the 220 ohm resistor to Arduino digital pin 13, LED cathode to GND.

- Power the Arduino from USB for this build.

Build Steps

1. Wire the circuit as listed and upload a simple program: read pin 2, and if it is HIGH, turn on pins 8 and 13 for a few seconds.

2. Let the PIR sensor settle for about a minute after power-up before testing, as it gives false triggers while warming up.

3. Walk slowly across its view and check the buzzer and LED respond, then step out of view and check they switch off.

4. Adjust the two small knobs on the PIR module: one sets sensitivity (detection distance), the other sets how long the output stays HIGH.

5. Mount the sensor where it faces the area you want to guard, away from heaters, windows in direct sun, and moving curtains.

Troubleshooting

- Buzzer always on: check the PIR output wiring and let the sensor finish its warm-up minute.

- No detection: raise the sensitivity knob slowly, check the sensor is not facing a heat source, and confirm pin 2 reads HIGH on movement.

- LED works but buzzer silent: check the buzzer polarity and whether your buzzer needs a tone signal rather than a steady HIGH.

- False alarms: lower the sensitivity, move the sensor away from draughts and pets, and shorten the delay setting.

Safety Note

This project uses low-voltage 5V DC only and does not involve mains electricity. It is a learning alarm, not a professional security system, so do not rely on it to protect valuables. If you are unsure about wiring, ask an experienced maker to check the circuit before first use.

Where will you place your alarm first — a doorway, a desk drawer, or a model room? Tell us in the comments.

Read More

Arduino Digital Thermometer Circuit with DS18B20 Sensor

 

Arduino Digital Thermometer Circuit with DS18B20 Sensor

Arduino Digital Thermometer Circuit with DS18B20 Sensor

The DS18B20 is the classic digital temperature sensor for Arduino projects: it sends an exact temperature reading over a single wire, needs no calibration by the builder, and even comes in a waterproof version for water tanks and soil. Paired with a 16x2 LCD, it makes a thermometer you can build in an afternoon.

How It Works

The DS18B20 measures temperature and sends it digitally to the Arduino using the OneWire protocol. The Arduino reads the value every couple of seconds and shows it on the LCD, and an optional buzzer can sound when the temperature crosses a threshold you choose.

Components Required

  • Arduino Uno or Nano board
  • DS18B20 temperature sensor (waterproof version optional)
  • 4.7k ohm resistor (pull-up, essential)
  • 16x2 LCD display
  • 10k potentiometer (LCD contrast)
  • Small buzzer, optional, for a high-temperature alert
  • 5V USB power supply, jumper wires, breadboard

Circuit Connections

  • DS18B20 red wire to 5V, black wire to GND, yellow data wire to Arduino digital pin 2
  • 4.7k resistor between the data wire and 5V (do not skip this, the sensor will not work without it)
  • LCD RS to pin 12, E to pin 11, D4 to pin 5, D5 to pin 4, D6 to pin 3, D7 to pin 8
  • LCD VSS to GND, VDD to 5V, VO to the middle pin of the 10k potentiometer, potentiometer outer pins to 5V and GND
  • Buzzer positive to pin 6 through a resistor, negative to GND, if you add the alert

Build Steps

  1. Wire the sensor, pull-up resistor and LCD exactly as listed.
  2. Install the OneWire and DallasTemperature libraries in the Arduino software.
  3. Upload a sketch that reads the sensor every two seconds and prints the temperature in Celsius on the LCD.
  4. Check the reading against a known thermometer and adjust a small offset in code if needed.
  5. Optional: add a buzzer alert that sounds when the temperature rises above your chosen limit.

Troubleshooting

  • Reading stuck at -127: check the data wire and the 4.7k pull-up resistor first, this is almost always the cause.
  • Reading stuck at 85: the sensor is not finishing its conversion, check power and wiring.
  • LCD blank: turn the 10k contrast potentiometer slowly until the text appears.
  • Garbled display: re-check the six LCD data pins against the list above.

Going Further

Log readings to a computer over serial, add a second DS18B20 on the same wire for inside and outside temperatures, or switch the display to Celsius and Fahrenheit at the press of a button.

What will you measure first — room, water tank, or greenhouse? Tell us in the comments.

Read More