ITMexicali

Click here to edit subtitle

 

External Links

 

Bluino Screenshots

Bluino


BluIno is an android application that communicates through bluetooth to arduino to control a toy car, more than just controlling the direction (forward, reverse and turning) it specifies the speed to arduino to parse it and using PWM functionality it will modulate the speed.

PWM is what makes Bluino so special and different to what you'll find in your app store, and other arduino projects that just activate motors at a constant (top) speed using common buttons switching from ON to OFF. Bluino lets you vary the pulse of voltage, that lets you feel you're controlling the voltage (from 0 to 5) but instead you are simply  changing the portion of the time the signal spends on versus the time that the signal spends off.

In the next video you'll be able to see how BluIno communicates with arduino (In this
occasion I used Arduino Mega2560, but i'll work on Arduino UNO as well).


Requirements:

- Cheap RC car

- Arduino Uno/Mega board

- Bluetooth Module (The one I bought)

- Pin Headers (Optional)

- Jumper/Dupont cables


Connecting Arduino to RC Car's Internal Dual H-Bridge:

When you first open the car unscrewing the bottom screws and take the top of the car off, you'll find a simple circuit like the one below:

It basically consists of 3 elements:

  • RECEIVER which is used to receive the orders from the controller (we're not going to use it anymore).

  • RX2 IC which demodulates the information got by the antena on the specified radio frecuency (we're not going to use this either).

  • H-BRIDGE circuit, which main fuction is to control 2 motors direction. 

Now that we know what and where is the RX-2 chip, we must know the pin configuration it works with, so the best way to know is to look for its datasheet in my case the chip was the SM6135W and the next image will show the pin configuration it has.

When you find your chip configuration you'll realize there are 2 pins controlling each H-bridge, the pins 6 & 7 control the turning and the  pins 10 & 11 control the forward and backward car's direction by just letting current go through those pins.


To let arduino command to the H-bridge through bluetooth, we could do 2 things:

  • Desolder the RX chip (as we won't need it anymore), and solder some pin headers to easily connect to arduino using female to male jumper cables.

  • Leave the RX chip as it is and just solder some normal cables to connect the arduino.

NOTE:
It's important to use 2 separate batteries, one for arduino and the other one to the H-Bridge, so when the motors are on, there won't be a lack of voltage for arduino causing arduino to restart and the bluetooth to lose connection. Once we have different sources for the circuits it'll be necessary to connect both Grounds to make a common ground and be able to control the H-Bridge.


What arduino pins should I connect to the car?

Well, now that you've done all this, you're almost ready to have your mini rc car  difting, what's next is to download the arduino code (in the External Links section, on the left column look for Arduino code RC CAR, I'll explain later why there is another arduino code called H-Bridge); there you'll notice the pins to connect to the car circuit:

  • Right                  6
  • Left                     9
  • Backward        10
  • Forward           11

All those pins are PWM enabled to vary the pulse using analogWrite() letting you gently change the motor's speed while going forward, backward, etc. 


Why is there a second arduino code for H-Bride?

That code its a bit different to the first one because I used an external H-Bridge (L298N) like this one:

This H-Bridge is capable to handle more power to the motors (i. e.  for bigger cars or just bigger motors to different purposes), this is unnecessary for some mini Radio controlled cars because, as I explained before, they have internal H-Bridge we can use.


I used this circuit in a bigger car (I could have used the internal h-bridge though, but I wanted to try this :P) and it worked just fine. 


The difference in code was that I incluided a new pin (motorPin - 9) to manage the PWM functionality on "A enable" and just switching the input A and B of motor 1 to On or Off ( HIGH or LOW ).



The next video shows a toy car that used the L298N H-BRIDGE and Arduino UNO


Is Bluino used only to command toy cars?

Bluino was designed to control RC cars using an Old school interface (like an old RC controller) instead of just buttons, but it could be used to command any kind of circuit purposes, for example dimming leds, etc. Thats why in the option menu of the android application you can change the MAX values each bar will handle (x2 because the midPoint acts like 0).

For example the PWM functionality may vary 1 byte ( 0 - 255 )   that's why the Left bar max value should be the double: 510. Any value over 255 will write an analog value to 'x' pin, a value lower than 255 will write an analog value to a different pin, but while in the midpoint, arduino will write LOW on both pins.


If you'd like to "truncate" a led brightness, a motor speed, etc, you could change the max value from a certain bar to a lower limit (i. e. to 180, the mid point would be 90, which for arduino it'll be 0), and instead of varying  the voltage cycle to  255 different values, it would just vary 90 (about 1/3).



This video shows how bluino is used to control a small servo