Bluetooth Line Maker with Dual Motors and Pump
Sports grounds need straight, bright lines for races and games. In this project you build a line marking robot. Two strong motors push it along, a pump sprays the line, and you steer it with push buttons or from your phone using Bluetooth. Try the pretend line maker below. Press and hold the buttons to drive, and switch the paint pump on to draw!
Hold Forward to drive. Pump OFF means no line.
How does it work?
Command
You press a button or send a letter from your phone, like F for forward.
Decide
The Arduino reads the commands. A mode switch picks manual buttons or Bluetooth.
Switch
The relay module is a row of electric switches. It turns the motors and pump on and off.
Mark
Both motors on goes forward. One motor on makes a turn. Pump on sprays the line.
What you need
Arduino UNO ×1
The brain of the project.
HC-05 Bluetooth ×1
Talks to your phone.
12V DC motors ×2
250 W geared motors for the wheels.
12V pump ×1
With tank, tube and spray nozzle for paint.
4-channel relay ×1
Heavy-duty, rated for motor current.
12V 7Ah battery ×1
Powers motors and pump.
Fuse and switch
A 30A fuse and a master power switch.
Controls
3 push buttons, a pump button, a toggle switch for the mode.
Extras
Chassis frame, two wheels, a caster wheel, thick wires, 1 kΩ and 2 kΩ resistors, jumper wires.
Circuit diagram
This build has two separate worlds. The control side is the Arduino, Bluetooth, buttons and relay inputs. The power side is the battery, motors and pump.
Control side
| Part | Connects to Arduino | Notes |
|---|---|---|
| Relay IN1 (left motor) | D7 | Relay VCC to 5V, GND to GND |
| Relay IN2 (right motor) | D8 | |
| Relay IN3 (pump) | D9 | |
| Relay IN4 (warning light) | D12 | Optional beacon lamp |
| HC-05 TX | D10 | Arduino reads here |
| HC-05 RX | D11 via divider | D11 → 1 kΩ → HC-05 RX → 2 kΩ → GND |
| HC-05 VCC / GND | 5V / GND | |
| Mode switch | D2 | Other leg to GND. Closed = Bluetooth |
| Forward, Left, Right buttons | D3, D4, D5 | Other legs to GND |
| Pump button | D6 | Other leg to GND |
Power side
| From | To |
|---|---|
| Battery + (through fuse and master switch) | Relay COM terminals 1, 2 and 3 |
| Relay NO terminal 1 / 2 / 3 | Left motor + / Right motor + / Pump + |
| Left motor −, right motor −, pump − | Battery − |
| Arduino VIN (or USB power bank) | Battery + via a 12V to 5V converter or a power bank |
Step-by-step instructions
Build the chassis
Fix the two motors on the left and right of a strong frame with a wheel on each. Add a free-turning caster wheel at the front or back so the robot stays level.Mount the pump and nozzle
Place the paint tank on the frame. Connect the pump to the tank and run a tube to a nozzle pointing at the ground between the wheels. Test with plain water first.Wire the control side
Connect the Arduino to the relay inputs, HC-05, buttons and mode switch exactly as in the first table. Use the divider for the HC-05 RX pin.Wire the power side with a fuse
Ask an adult to wire the battery through the fuse and master switch to the relay contacts, motors and pump using thick wire. Leave the master switch OFF.Upload the code
Unplug the HC-05 TX wire during upload, then upload the sketch below and plug it back in.Pair your phone
Turn on Bluetooth and pair with HC-05 using the code 1234 or 0000. Open a Bluetooth serial app and set buttons to send F, L, R, S, P and p.Test and paint
With wheels off the ground, test each command and the manual buttons. Then test on a field with water, and finally add line-marking paint with an adult.
Arduino code
// Bluetooth Line Maker - MakeMindz
#include <SoftwareSerial.h>
SoftwareSerial bt(10, 11); // RX = D10, TX = D11
const int modePin = 2; // switch closed = Bluetooth
const int btnF = 3, btnL = 4, btnR = 5, btnPump = 6;
const int relayLeft = 7, relayRight = 8, relayPump = 9, relayLight = 12;
const int ON = LOW, OFF = HIGH; // most relay modules switch on with LOW
const unsigned long TIMEOUT_MS = 1500; // stop if phone goes silent
char cmd = 'S'; // F, L, R or S
bool pumpOn = false;
unsigned long lastCmdTime = 0;
void setup() {
bt.begin(9600);
int inputs[] = {modePin, btnF, btnL, btnR, btnPump};
for (int i = 0; i < 5; i++) pinMode(inputs[i], INPUT_PULLUP);
int relays[] = {relayLeft, relayRight, relayPump, relayLight};
for (int i = 0; i < 4; i++) { digitalWrite(relays[i], OFF); pinMode(relays[i], OUTPUT); }
}
void readManual() {
cmd = 'S';
if (digitalRead(btnF) == LOW) cmd = 'F';
else if (digitalRead(btnL) == LOW) cmd = 'L';
else if (digitalRead(btnR) == LOW) cmd = 'R';
pumpOn = (digitalRead(btnPump) == LOW); // pump runs while held
}
void readBluetooth() {
while (bt.available()) {
char c = bt.read();
lastCmdTime = millis();
if (c == 'F' || c == 'L' || c == 'R' || c == 'S') cmd = c;
if (c == 'P') pumpOn = true;
if (c == 'p') pumpOn = false;
}
if (millis() - lastCmdTime > TIMEOUT_MS) { cmd = 'S'; pumpOn = false; } // safety stop
}
void loop() {
if (digitalRead(modePin) == LOW) readBluetooth(); // closed = Bluetooth
else readManual();
bool left = (cmd == 'F' || cmd == 'R'); // left motor drives forward and right turns
bool right = (cmd == 'F' || cmd == 'L');
digitalWrite(relayLeft, left ? ON : OFF);
digitalWrite(relayRight, right ? ON : OFF);
digitalWrite(relayPump, pumpOn ? ON : OFF);
digitalWrite(relayLight, (cmd != 'S' || pumpOn) ? ON : OFF); // light while working
delay(20);
}
loop(). In Bluetooth mode, set your app buttons to repeat while held, or raise TIMEOUT_MS.Fix it: troubleshooting
📵 Phone does not connect
Pair first in phone settings, then connect in the app. Check the TX and RX wires are not swapped.
🔁 Motor runs when it should be off
Your relay module may switch on with HIGH. Swap ON and OFF in the code.
🔥 Wires get warm
Switch off. Use thicker wire and check connections are tight. Ask an adult to inspect.
🤖 Arduino restarts
Motor spikes are upsetting the Arduino. Power it from a separate power bank and share only the ground.
Upgrade ideas
⬅️ Reverse gear
Swap the relays for two motor drivers so the robot can go backward.
🧭 Straight lines
Add a compass sensor to keep the heading steady.
📏 Distance marks
Add wheel encoders and make dashed lines of exact length.
🔋 Battery meter
Show the battery level with a voltage divider and LEDs.
Frequently asked questions
How does it switch between manual and Bluetooth?
A toggle switch on D2 selects the mode. In manual mode the Arduino reads the push buttons. In Bluetooth mode it reads letters from the phone.
Why use relays instead of connecting the motors directly?
Big motors need far more current than an Arduino pin can give. A relay is an electric switch that lets a tiny signal control a big current safely.
Can I use this with plain water for practice?
Yes, and you should. Test with water first, then ask an adult to help with line-marking paint.
What will I learn?
Relays, Bluetooth serial, modes, safety timeouts, differential steering and high-current wiring.

Comments
Post a Comment