Community project

Голосовой Робот-Сканер

Photo of Голосовой Робот-Сканер
Generated with AI

Никита

Published November 28, 2026

This voice-activated scanning robot combines ultrasonic sensing, sound detection, and Bluetooth control to create an autonomous mobile platform. Built around an Arduino Uno, the robot features dual DC motors for movement, a servo-controlled latch mechanism, and a microphone amplifier for clap detection, all powered by four AA batteries.

The guide provides a complete wiring diagram, parts list, and step-by-step assembly instructions to build the chassis, integrate sensors and motors, and upload the firmware. Readers will learn how to set up Bluetooth communication with Android devices, calibrate the sound detection threshold, and test all systems before deployment.

Wiring diagram

Loading diagram…

Gather all the parts

QtyComponent
1

HC-SR04

HC-SR04 ultrasonic distance sensor module with separate 40 kHz transmitter and receiver transducers, measuring 2 to 400 cm. A 10 us pulse on TRIG starts a measurement and ECHO stays high for the echo's round-trip time. This HC-SR04+ board runs from 3.3 V or 5 V.

1

MAX4466 Microphone Amplifier

Adafruit MAX4466 electret microphone amplifier breakout with a manual gain trim pot (25x-125x). Outputs analog audio biased at ~VCC/2, swinging roughly 200mVpp at speaking volume up to ~1Vpp, readable by any 3.3V or 5V ADC. Unlike the AGC-based MAX9814 the gain is fixed by the trimmer, so it is best when you want a set gain and predictable dynamic range rather than auto-leveling.

1

DRV8833 Dual DC Motor Driver

Dual H-bridge DC/stepper motor driver IC or carrier module. VM motor supply range is 2.7V-10.8V; logic inputs support 1.8V, 3.3V, and 5V controllers. TI rates the PWP/RTY package options at 1.5A RMS and 2A peak per H-bridge at VM=5V and 25C; carrier-board current depends on board layout and cooling. Controlled with AIN1/AIN2 and BIN1/BIN2 inputs, which may be driven as digital or PWM signals. nSLEEP must be high for the bare IC, while some carrier boards pull it high by default. nFAULT is an open-drain fault output.

1

TT Motor Bi-Metal Gearbox - 1:90 Gear Ratio

TT-format bi-metal DC gearbox motor with a 1:90 reduction ratio - roughly double the torque and half the speed of the more common 1:48 TT motor. Runs on 3-6VDC (60-120 RPM no-load depending on voltage), has steel output gears for durability, and is one of several TT-motor gearbox ratios (1:48, 1:90, 1:120) used across 2WD/4WD robot car and crawler chassis kits, this one favoring torque/climbing over speed. Ships with no wires attached and cannot be driven directly from a microcontroller pin; requires a separate high-current motor driver such as a DRV8833 or TB6612FNG.

1

TT Motor Bi-Metal Gearbox - 1:90 Gear Ratio

TT-format bi-metal DC gearbox motor with a 1:90 reduction ratio - roughly double the torque and half the speed of the more common 1:48 TT motor. Runs on 3-6VDC (60-120 RPM no-load depending on voltage), has steel output gears for durability, and is one of several TT-motor gearbox ratios (1:48, 1:90, 1:120) used across 2WD/4WD robot car and crawler chassis kits, this one favoring torque/climbing over speed. Ships with no wires attached and cannot be driven directly from a microcontroller pin; requires a separate high-current motor driver such as a DRV8833 or TB6612FNG.

1

4 x AA Battery Holder with On/Off Switch

4 × AA NiMH

Four-cell AA battery holder with snap-on cover and on/off switch. Provides approximately 6V with alkaline or rechargeable AA cells.

1

Electrolytic Capacitor

470 µF / 16 V

Radial aluminium electrolytic capacitor bought by value and voltage rating, such as 10 µF, 100 µF or 1000 µF 10 V. It is polarised: the + lead goes to the higher voltage and the - lead, marked by the stripe on the sleeve, to the lower voltage or ground. It is mostly used for bulk filtering across a power rail, with a voltage rating comfortably above the rail.

1

Hc 05 Bluetooth Module

5 V breakout, UART 9600

Serial Bluetooth module for wireless communication using UART interface. Operates at 9600 baud (Data Mode) or 38400 baud (AT Command Mode). Supports two-way full-duplex wireless functionality with range up to 100m.

1

MG90D High-Torque Metal Gear Micro Servo

13g digital micro servo with metal gears, an aluminum output shaft, and double ball bearings, giving noticeably more torque and speed than a standard MG90S or SG90. Wired and controlled exactly like any hobby servo: 3-wire PWM at 4.8-6.6V, drop-in compatible with the Arduino Servo library.

1

Resistor

1 kΩ

Through-hole resistor (current-limiting in series with an LED)

1

Resistor

2 kΩ

Through-hole resistor (current-limiting in series with an LED)

Assemble it in 6 steps

1. Соберите шасси

Закрепите два мотора на основе 2WD, наденьте колёса и поставьте опорный ролик. Датчик закрепите спереди горизонтально, микрофон — подальше от моторов.

2. Подключите датчики

На отключённой Uno подайте 5V и GND на оба модуля. TRIG идёт на D2, ECHO — на D4, OUT микрофона — на A0.

3. Подключите моторы и питание

Соедините драйвер с Uno по схеме, а выходы AOUT и BOUT — с левым и правым моторами соответственно. Плюс держателя четырёх NiMH AA подключите к VM, минус — к общему GND. Плюс конденсатора идёт к VM, ножка у полосы — на GND. Uno получает питание только через USB (для езды подойдёт внешний USB-аккумулятор).

  • Не соединяйте плюс батарей моторов с 5V Uno. Не удерживайте колёса под током.

4. Проверьте на подставке

Поднимите колёса над полом и поставьте коробку прямо перед роботом на расстоянии около метра. Хлопните для запуска и ещё раз для остановки. Если колесо вращается назад при движении вперёд, выключите питание и поменяйте местами два провода этого мотора. Если моторы вызывают ложные срабатывания, уменьшите усиление микрофона его регулятором.

5. Установите защёлку и Bluetooth

Закрепите сервопривод так, чтобы его рычаг перекрывал край закрытой крышки. Сначала проверьте оба положения без рычага. Подайте на сервопривод отдельные стабилизированные 5 В от источника не менее 1 А и соедините его минус с GND Uno. Сигнал идёт на D3. У модуля HC-05 с входом питания 5 В соедините Vcc с 5V Uno, GND с GND, TX с D8. Между D12 и RX поставьте резистор 1 кОм, между RX и GND — 2 кОм. Вместе они снижают напряжение сигнала до 3,3 В.

  • Не соединяйте плюс отдельного источника сервопривода с 5V Uno. Рычаг не должен упираться в крышку или зажимать пальцы. Оставьте возможность открыть крышку вручную.

6. Проверьте управление с Android

После Deploy сопрягите HC-05 с Android и подключитесь к нему из Bluetooth-терминала с поддержкой классического Bluetooth SPP. Отправьте заглавную O для открытия. Закройте крышку вручную и отправьте заглавную L для запирания. После запирания робот остаётся на месте до хлопка.

  • Это учебная защёлка без датчика положения крышки и без надёжной защиты доступа. HC-05 не подходит для iPhone.

Review all connections

1. Connections between "sonar" and "Arduino"

FunctionsonarArduino
powerVCC5V
groundGNDGND
digitalTRIGGPIO 2
digitalECHOGPIO 4

2. Connections between "mic" and "Arduino"

FunctionmicArduino
powerVCC5V
groundGNDGND
analogOUTGPIO 14

3. Connections between "driver" and "Arduino"

FunctiondriverArduino
powerVM → 4 x AA Battery Holder with On/Off Switch VOUTEXT
groundGNDGND
pwmAIN1GPIO 5
pwmAIN2GPIO 6
pwmBIN1GPIO 9
pwmBIN2GPIO 10
digitalnSLEEPGPIO 7
dataAOUT1 → TT Motor Bi-Metal Gearbox - 1:90 Gear Ratio M1EXT
dataAOUT2 → TT Motor Bi-Metal Gearbox - 1:90 Gear Ratio M2EXT
dataBOUT1 → TT Motor Bi-Metal Gearbox - 1:90 Gear Ratio M1EXT
dataBOUT2 → TT Motor Bi-Metal Gearbox - 1:90 Gear Ratio M2EXT

4. Connections between "battery" and "Arduino"

FunctionbatteryArduino
groundGNDGND

5. Connections between "bulk" and "Arduino"

FunctionbulkArduino
power+ → DRV8833 Dual DC Motor Driver VMEXT
ground- → DRV8833 Dual DC Motor Driver GNDEXT

6. Connections between "bt" and "Arduino"

FunctionbtArduino
powerVcc5V
groundGNDGND
dataTXGPIO 8

7. Connections between "latch" and "Arduino"

FunctionlatchArduino
pwmSIGNALGPIO 3
powerVCC5V
groundGNDGND

8. Connections between "rtop" and "Arduino"

FunctionrtopArduino
digitalP1GPIO 12
digitalP2 → Hc 05 Bluetooth Module RXEXT

9. Connections between "rbottom" and "Arduino"

FunctionrbottomArduino
digitalP1 → Hc 05 Bluetooth Module RXEXT
groundP2GND

Deploy the firmware

#include <Arduino.h>
#include <SoftwareSerial.h>
SoftwareSerial phone(8, 12);
bool unlocked=false;
uint32_t latchUntil=0;
bool latchMoving=true;
constexpr byte trig=2, echoPin=4, sleepPin=7;
constexpr int clapThreshold=95;
bool running=false, turnRight=false;
byte clearCount=0;
uint32_t pingAt=0, windowAt=0, clapAt=0, turnUntil=0;
int lo=1023, hi=0;
bool loud=false;
void motor(byte a, byte b, int speed) {
  if(speed>=0){analogWrite(b,0); analogWrite(a,speed);}
  else {analogWrite(a,0); analogWrite(b,-speed);}
}
void drive(int l,int r){motor(5,6,l);motor(9,10,r);}
void setup(){
  const byte pins[]={2,5,6,7,9,10};
  for(byte p : pins) pinMode(p,OUTPUT);
  phone.begin(9600); pinMode(3,OUTPUT);
  latchUntil=millis()+650;
  pinMode(echoPin,INPUT); drive(0,0); digitalWrite(sleepPin,LOW);
}
void loop(){
  uint32_t now=millis();
  while(phone.available()){
    int c=phone.read();
    if(c!='O' && c!='L') continue;
    running=false; clearCount=0; turnUntil=0;
    drive(0,0); digitalWrite(sleepPin,LOW);
    unlocked=(c=='O'); latchMoving=true; latchUntil=now+650;
  }
  if(latchMoving){
    if((int32_t)(now-latchUntil)<0){
      digitalWrite(3,HIGH); delayMicroseconds(unlocked?1700:1100);
      digitalWrite(3,LOW); delay(18);
    } else {
      latchMoving=false; lo=1023; hi=0; loud=false;
      windowAt=clapAt=now;
    }
    return;
  }
  if(unlocked) return;
  int s=analogRead(A0); lo=min(lo,s); hi=max(hi,s);
  if(now-windowAt>=12){
    bool peak=hi-lo>=clapThreshold;
    if(peak && !loud && now-clapAt>=700){
      clapAt=now; running=!running; clearCount=0; turnUntil=0;
      drive(0,0); digitalWrite(sleepPin,running?HIGH:LOW);
    }
    loud=peak; windowAt=now; lo=1023; hi=0;
  }
  if(!running) return;
  if(turnUntil){
    if((int32_t)(now-turnUntil)<0) return;
    turnUntil=0; drive(0,0);
  }
  if(now-pingAt<65) return;
  pingAt=now;
  digitalWrite(trig,HIGH); delayMicroseconds(12); digitalWrite(trig,LOW);
  unsigned long us=pulseIn(echoPin,HIGH,25000);
  if(!us){clearCount=0; drive(0,0);}
  else if(us<32UL*58){
    clearCount=0; turnRight=(now/1000)%2;
    drive(turnRight?135:-135,turnRight?-135:135);
    turnUntil=millis()+400;
  }else{
    if(clearCount<2) ++clearCount;
    if(clearCount>=2) drive(145,145);
  }
}

Remix this project

Make it yours in one click

Open a full copy of this project in your own Schematik workspace, diagram, code, parts, and assembly steps included. Swap the sensor, add features, or redesign the whole thing with AI. The author's original stays untouched.

Open in Schematik