Translate

Friday, April 15, 2016

How to connect two Bluetooth serial modules




Here we are going to look, how we can connect two Bluetooth serial modules. 

Here I am taking the example of Bluetooth module HC 05 because it is a widely using Bluetooth serial module (Bluetooth SPP). Serial port Bluetooth module is 3Mbps Modulation with complete 2.4GHz radio transceiver and baseband. 
HC 05 Module and important pins

Some of other features of this module are

  • ·         Up to +4dBm RF transmit power
  • ·         Low Power 1.8V Operation ,1.8 to 3.6V I/O
  • ·         Default Baud rate: 38400, Data bits:8, Stop bit:1, Parity:No parity, Data control: has. Supported baud rate: 9600,19200,38400,57600,115200,230400,460800.
  • ·         Given a rising pulse in PIO0, device will be disconnected.
  • ·         Status instruction port PIO1: low-disconnected, high-connected
  • ·         PIO10 and PIO11 can be connected to red and blue led separately. When master and slave are paired, red and blue led blinks 1time/2s in interval, while disconnected only blue led blinks 2times/s.
    Auto-connect to the last device on power as default.
  • ·         Permit pairing device to connect as default. Auto-pairing PINCODE:”0000” as default Auto-reconnect in 30 min when disconnected as a result of beyond the range of connection.
  • ·         Bluetooth protocal: Bluetooth Specification v2.0+EDR
  • ·         Frequency: 2.4GHz ISM band
  • ·         Modulation: GFSK(Gaussian Frequency Shift Keying)
  • ·         Emission power: ≤4dBm, Class 2
  • ·         Sensitivity: ≤-84dBm at 0.1% BER
  • ·         Speed: Asynchronous: 2.1Mbps(Max) / 160 kbps, Synchronous: 1Mbps/1Mbps
  • ·         Security: Authentication and encryption
  • ·         Profiles: Bluetooth serial port
  • ·         Power supply: +3.3VDC 50mA
  • ·         Working temperature: -20 ~ +75Centigrade
  • ·         Dimension: 26.9mm x 13mm x 2.2 mm
You can easily connect your android phone/ PC to this HC 05 module. For that, just power ON your HC module, then switch on your PC/Phone Bluetooth. Now search from your PC or Android phone, it will show the device name. Select pair option and give pair password. The default password might be 1234 or 0000. If everything is OK, then your HC-05’s pair LED (if any) will glow.

But if you want to connect to two embedded system device using HC-05 we want to do following tricks.

 


How to connect two embedded system project using Bluetooth module

HC-05 comes from the factory as SLAVE mode; that means a master (Android/PC) can easily manage the connection between the HC slave connections. But if you are connecting two HC modules, for example, you want to connect two embedded system projects,  you should do some tricks!. Otherwise, it will not works.

The reason is that, Initially Both of the modules are in slave configuration and slave-slave (or master-master) communication is not possible. So we want to change the mode of one Bluetooth module for the communication.
For this you need following tools
  1. 1.      TTL to RS232 converter
  1. 2.      Terminal Software (you can download it from www.pravysoft.org website)
Normally HC-05 modules are TTL module means if we directly connected this module to PC serial port the RS232 signals from PC will damage our module. So you should use a TTL to RS232 converter. If you are familiar with MAX232 chip, you can make this using simple circuit (visit http://pravysoft.blogspot.org ) for making this module.
HC 05 With built in RS232 PORT


Now you need to connect the RS232 connector to your PC. Latest PC’s does not have serial port (DB9 pin), if so you need to use  RS232 to USB converter module, note that you should install proper drivers to work USB to serial converter. You can see the corresponding ports of USB to serial converter in DEVICE MANAGER as shown in the figure.
Serial to USB convertor (Black) and HC 05 module




Device Manager window to find serial port number

 If the port number is greater than COM7, change the port number to a lower one. Otherwise, the terminal software won't detects the PORT

Then take your HC05 module and feed a 3.3V voltage for its KEY pin (Please see the first figure).
Some HC05 RS232 modules are coming with KEY PINs, for that you just place a jumper there.
HC05 with Key Jumber is shorted



Open terminal software select correct serial port
Please note that you should select baud rate of  38400.

To test all connections are ok or not, you just type AT and press enter
You will get continuous OK string, don’t worry please power off your HC05 module and reopen terminal now.

Again connect the module using terminal software and sent AT+ROLE=1
Terminal software window

If everything is ok, then your module become MASTER now. To check it is master or not just power ON the device and search it using a phone.
Alternatively power on another HC module (slave config) and Power on configure HC module, if it is MASTER, it will automatically connect to the slave module (Check PAIR LED status)

TIP: Power on slave module before Master one for fast pairing


Monday, September 7, 2015

Upgrade your Android Experience with these Tricks!!



Upgrade your Android Experience with these Tricks 

We all like animations, it make your device feel good but in long term if you see these animations conserve battery and even make your phone a little slower, if you are running a high end phone then these little difference won’t be noticeable for lower end phones you are going to face a lot of issues. So here I would like to explain some tip and tricks to improve battery capacity by reducing animations
For this first you need to become a developer (i.e enable developer option in your phone) this is a hidden feture of latest android OS. So to enable or to see these features please goto your android phone MENU
Phone Settings > About
On the Build Number, TAP 3 times
This will enable the developer options in your android phone.







Save battery now…..!!
Basically there are 3 types of animation scale options you can disable in android that’s is
1. Window Animation Scale
2. Transition Animation Scale
3. Animator Duration Scale
Open setting>developer options
Just open that and scroll that, until you find three options:
Window Animation Scale, Transition Animation Scale and Animator Duration Scale.
Now just press each of them and Turn them Off.
Now restart your phone and see a boosted up phone.

Want to tag Fake GPS location???
After enabling the developer options you can Mock your GPS Location hence you can Fake it, this could be helpful in numerous situations, that relies on upon the way you utilize it.
Explore to Settings > Developer Options,
Check for Mock Locations highlight and enable it by ticking the check box. Now you can give fake GPS tags for various APPs


Keeping your Android Device Awake while Charging
Whle charging android phone lie in ideal state, no RSS or news fields are working on that time. To keep your android phone awake while charging you need to do following trick
Explore to Settings > Developer Options, check for Stay Awake component and enable it by ticking the check box.

Make Desktop Backup Password
Explore to Settings > Developer Options, tap the desktop backup password option, enter your present password and after that new password.

Empower Higher Graphics in Games
If you are getting low graphics in your android games, follow this trick to enhance its resolution.
Explore to Settings > Developer Options, check for Force 4X MSAA include and empower it by ticking the check box.
 
Enable CPU Usage Overlay
If your battery drain out in the middle of the day, you can use this trick to keep your battery power some more hours.
Navigate to Settings > Developer Options,
check for Show CPU Usage feature and enable it by ticking the check box