Go Down

Topic: Convert your RC car in a Smart Car with Arduino and Android (Read 1 time) previous topic - next topic

didix21

I create a new topic that shows how to reconvert an old RC car in a smart car using an Arduino UNO and Bluetooth connection. Before make this project I will create some easy and interesting tutorials that will help you to familiarise with create apps for Android and develop programs for Arduino.



The first lesson is controlling a DC Motor with an application created for Android that will allow us to control his  velocity.

Material Needed

- DC Motor or a fan.
- Protoboard.
- NPN Transistor.
- Arduino UNO.
- Modul Bluetooth HC-05 or HC-06.

To create the apps we are gooing to use Appinventor.

Circuit




The link below shows the results:

https://www.youtube.com/watch?v=gGWWvya40Dw

The link below shows the tutorial:

https://www.youtube.com/watch?v=yRLxiUXxNJo&feature=youtu.be

Code: [Select]

#include <SoftwareSerial.h>


SoftwareSerial BT(10,11); //10 RX, 11 TX.
String state = ""; //Save data that come from Bluetooth
String lastState= "";
int inChar = 0;
char pwmChar[3];
int i = 0;
int pwm = 0, lastPwm=0;
void setup()
{
  BT.begin(9600);
  analogWrite(3,0);
}
 
void loop()
{
  while (BT.available()>0)  { // While there are data come frome bluetooth...
     inChar = BT.read(); // Read data
     pwmChar[i]= (char)inChar; //Save data to array type char
     state += pwmChar[i]; //Save chars in a String
     i++;
     delay(1);
  }
  if (lastState != state) // Control when to write the PWM
  {
      pwm = state.toInt(); // Convert the String to a int value
      analogWrite(3,pwm); // Send the value to PWM Pin
      // Reset variables value
      i = 0;
      state="";
      inChar =0;
      lastPwm = pwm;
  }
}

andyibanez

This is one of my project
With hc-05 for camera equipment

https://m.youtube.com/watch?v=Pjm7uRwnZ18

This is more complete sample for controling 2 motors

It use appinv too

didix21


BlubBlubClub

I used Smart-Technology for my Quadrocopter.


Sensors (DOF/Altimeter) <I2C> Arduino Nano <Serial> RaspberryPi <UDP/WLAN> Android

Also working quite well.

Regards,
BBC

Go Up