Showing posts with label HC-05. Show all posts
Showing posts with label HC-05. Show all posts

RoboAuto : Arduino Bluetooth Joystick for Android™


HC-05 has an added advantage in embedded systems that pretty much every smartphone is equipped with in built Bluetooth hardware.This opens up a large number of possibilities for access and control of embedded systems.

There are apps that do the task of controlling a system via bluetooth however none sufficed to my requirement. So I developed one,

Presenting  
RoboAuto

An Android Application for communication with HC-05 Bluetooth Module.
RoboAuto is a clean and effective app using which you can control your Robots or Devices with a Simple Joystick!
  
What RoboAuto does:

Program Flow

So, You as an embedded developer have to configure your robot only for the commands received from the app!

Here are few screenshots:






RoboAuto connects to the Bluetooth Module using a Wireless Serial Link. Android already provides support for this in their native API.

After a successful connection, characters are sent to the module on actuation of joystick ,buttons or check boxes which can be read and executed by Arduino™ or other microcontrollers.

Special Thanks to zerokol for his JoystickView Library.
The Joystick sends the following :

Forward: F
Backward: B
Left : L
Right : R

Additionally I have assigned intermediate directions , for example, FL for Front-Left, BR for Backward-Right and so on.
No Changes are to be required on the Embedded side as the UART only parses a single character at a time, giving us simultaneous (in theory) Forward and Left motion. Kind of like what happens in a PWM.

Download RoboAuto here:
Get it on Google Play
Google Play and the Google Play logo are trademarks of Google LLC.

This Post therefore will be updated soon and is worth a bookmark.
UPDATE (22/October/17): Savvy has been renamed to RoboAuto and published on Google Playstore
UPDATE (10/August/16) : Few Screenshots and content have been updated!
UPDATE (25/August/16 ):  Savvy(Now RoboAuto) is available for testing and debugging for FREE
UPDATE (12/September/16): Added Internet Access permission for Google Form Integration.
UPDATE (19/March/17): Fixed a lot of bugs in the layout scale. Renamed "Turn Light" to "Rear Light."

Do report any bugs you encounter.
Credits (19/March/17):  Thank You Shivani for your Feedback on Design Issues

Good Stuff Take Time.

Used:
Android Studio 2.3.3
Lenovo S6600 , Micromax Knight Cameo for Debugging.

Programming and Simulation of AVR with HC-05: PART II

The final build of my work with HC-05 involves using AVR ATmega32 microcontroller which is a powerful micro controller. The Controller is programmed in AVR GCC.

For HC-05 (or any other serial communication system), the USART needs to be set on the ATmega32 through programming.
Here is a snippet of code being used for UART in my build:

Setting up UART


The Primary task of responding to various commands is done by a switch statement which is way easier to modify and work on instead of  IF-ELSE statements.Since Each character has a unique ASCII Code, we have a lot of commands which can be given to the micro controller.For example ,there are 26 lower case + 26 upper case + 10 digits + about 32 symbols which equal about 94 unique commands.
Snippet of code for Switch:

Decision Task by Switch Statement

The character 'ch' is set to receive value from registers whenever the receive interrupt is triggered by the HC-05.The ISR (Interrupt Service Routine) is defined as follows:

Interrupt Service Routine

Simulation of code is done in Proteus 8.4 using all the peripherals included. Input here is given from a virtual terminal however HC-05 would have served the same objective.

Simulation in Proteus

A video accompanying the simulation conveys that the code works fine and can be implemented into the hardware.Here's the vid :


Used:
Proteus 8.4
Atmel Studio 7.0

Starting up with HC-05 Bluetooth Module : PART I

Recent aspiration of mine has been to develop on both AVR and Android a full fledged package for Bluetooth communication

For Prototyping I chose this: 


Setup on this:


With these: 


Looking Something Like this: 


Configured using this:


And Running This:


SO FAR SO GOOD :)