RoboticsTool Box

Tools and techniques for robotics components — as I use them.

Bluetooth HC-05 / HC-06 QTR Sensors LDR Battery Reader (Soon) ESP Connection (Soon)

Bluetooth HC-05 / HC-06

The Bluetooth module (HC-05 / HC-06) accepts 5V power, but its TX / RX signal lines are voltage-sensitive. The module's standard signal threshold is ≥ 3.33V, whereas most Arduinos output higher voltage on their pins — this slowly damages the module over time.

Vout = Vin × R₂ / (R₁ + R₂)  =  5V × 2kΩ / (1kΩ + 2kΩ)  ≈  3.33 V

To protect the RX pin, use a 1kΩ + 2kΩ voltage divider between the Arduino TX output and the module RX pin, with the junction to GND as shown below.

RealLife Image
HC-05 module
Wiring Diagram
HC-05 voltage divider diagram

QTR Sensors

QTR sensors (QTR-8A or QTR-8RC) are infrared arrays for line following. They emit IR light and measure reflected intensity from the surface below.

Variants: RC vs Analog

QTR-RC (Digital) ✦ Recommended

Capacitor-discharge timing method. Set pin HIGH, then measure time to fall LOW. Ideal for MCUs with limited ADC pins.

QTR-A (Analog)

Outputs 0–5V based on reflectivity. Easier to code but requires one analog pin per sensor.

Calibration & Usage

Rotate the robot over the line so the code records max and min reflectance values — the black of the line vs the white of the floor.

⬇ QTRSensors Library

Wiring Diagram
QTR sensor diagram

LDR — Light Dependent Resistor

A photoresistor changes resistance based on light intensity hitting its surface.

🌑 In the Dark

Resistance is very high — often several MΩ.

☀ In the Light

Resistance drops to a few hundred Ω.

The Circuit — Voltage Divider

Microcontrollers can't measure resistance directly, so we convert it into a voltage change using a 1kΩ fixed resistor in a voltage divider.

Wiring

LDR Voltage Divider
LDR schematic

Battery Reader & ESP Connection

These sections are coming soon. Check back later!