산업 제조
산업용 사물 인터넷 | 산업자재 | 장비 유지 보수 및 수리 | 산업 프로그래밍 |
home  MfgRobots >> 산업 제조 >  >> Manufacturing Technology >> 제조공정

BLE 블루투스로 음성 제어 아두이노 자동차 만들기 – DIY 가이드

부품 및 소모품

부품 수량
아두이노 우노 (Arduino UNO) 1
브레드보드 (일반) 1
DC 모터 (일반) 2
리니어 레귤레이터 (7805) 1
텍사스 인스트루먼트 L293D 듀얼 H-브리지 모터 드라이버 1
점퍼 와이어 (일반) 1
블루투스 저에너지 (BLE) 모듈 (일반) 1

프로젝트 소개

구성품

사용할 앱: Google Play 링크

아이디어

블루투스 모듈을 모바일 앱과 연결합니다. 앱에서 내린 명령이 모듈을 통해 아두이노로 전송됩니다. 시리얼 버퍼에서 문자 단위로 수신해 문자열로 조합한 뒤, 미리 정의된 명령어와 비교해 일치하면 해당 동작을 수행합니다. 예를 들어 "Right" 문자열을 수신하면 오른쪽으로 회전합니다.

연결 방법

상세 연결도는 여기를 참조하세요.

코드


int motor_input1 = 11;
int motor_input2 = 10;
int motor_input3 = 5;
int motor_input4 = 6;
String voice;

void setup() {
  Serial.begin(9600);
  pinMode(motor_input1, OUTPUT); // 오른쪽 모터
  pinMode(motor_input2, OUTPUT); // 오른쪽 모터
  pinMode(motor_input3, OUTPUT); // 왼쪽 모터
  pinMode(motor_input4, OUTPUT); // 왼쪽 모터
}

void loop() {
  while (Serial.available() > 0) {
    delay(10);
    char c = Serial.read();
    if (c == '#') {
      break;
    }
    voice += c;
  }
  
  if (voice == "forward") {
    digitalWrite(motor_input1, LOW);
    digitalWrite(motor_input2, HIGH);
    digitalWrite(motor_input3, LOW);
    digitalWrite(motor_input4, HIGH);
    delay(5000);
  } else if (voice == "back") {
    digitalWrite(motor_input1, HIGH);
    digitalWrite(motor_input2, LOW);
    digitalWrite(motor_input3, HIGH);
    digitalWrite(motor_input4, LOW);
    delay(5000);
  } else if (voice == "left") {
    digitalWrite(motor_input1, LOW);
    digitalWrite(motor_input2, HIGH);
    digitalWrite(motor_input3, HIGH);
    digitalWrite(motor_input4, LOW);
    delay(800);
  } else if (voice == "right") {
    digitalWrite(motor_input1, HIGH);
    digitalWrite(motor_input2, LOW);
    digitalWrite(motor_input3, LOW);
    digitalWrite(motor_input4, HIGH);
    delay(800);
  }
  
  if (voice.length() > 0) {
    Serial.println(voice);
    voice = "";
    digitalWrite(motor_input1, LOW);
    digitalWrite(motor_input2, LOW);
    digitalWrite(motor_input3, LOW);
    digitalWrite(motor_input4, LOW);
  }
}

제조공정

  1. 알렉사 제어 ARDrone 2.0 데모: 라즈베리파이 & 홀로그램 노바로 음성 제어 드론
  2. 아두이노 디지털 주사위: LCD 기반 랜덤 넘버 제너레이터 만들기
  3. 아두이노 나노로 37개 LED 룰렛 게임 만들기
  4. 낡은 RC카를 아두이노와 엑스박스 컨트롤러로 조종하는 차량으로 개조하기
  5. ATtiny85 미니 아케이드: 스네이크 게임 - 휴대용 OLED 게임기 만들기
  6. 휴대용 거리 감지기: HC-SR04, 18650 배터리, 3D 프린트 케이스의 아두이노 나노 DIY 키트
  7. MobBob: 아두이노 로봇 직접 만들기, 안드로이드 스마트폰으로 매끄럽게 제어
  8. 스마트폰 앱으로 제어하는 유압 크레인: 아두이노 우노와 블루투스 HC-05
  9. 아두이노 나노 & OpenCV로 만드는 자율 주행 안면 추적 로봇 카
  10. 피봇(PiBot): 아두이노 기반 88건반 피아노 연주 로봇