Arduino‎ > ‎Brewing Arduino‎ > ‎

Testing Arduino BT

posted Nov 23, 2010, 1:06 AM by Haris Hashim   [ updated Nov 27, 2010, 4:22 AM ]


    Introduction


    Arduino BT is an Arduino board that already have built in Bluetooth module. This simplify hardware interfacing. When it is up and running it simply act as normal Bluetooth device. Pair it with a PC or notebook, and it is ready to talk to Arduino IDE for programming. As simple as that.

     

    There lies the catch. The "When it is up and running part". Arduino BT is using Bluetooth connection. It has no built-in port to accept USB. The catch is that, it is not as easy to power up. Compared to Uno or Duemilanove which is USB powered.

     

    So how do we power it up. Arduino BT does come with +ve and -ve terminal. In this article. I am going to demonstrate how to use this terminal to power up Arduino BT using AA batteries. Test it by uploading LED Blink  sample program and highlight some possible issue and pitfall along the way.

     

    However, please note that this article is not a complete replacement to Arduino BT hardware page. The most important being hardware specification such as maximum voltage. So, do check the page and base your design upon the specification given there.

     

    A good advice at this point is to understand that, unlike other board, Arduino BT maximum voltage is specified as 5.5V.  So it is very critical to be careful with the power up stage. It is a good idea to use multi meter and double check that batteries or adapters +ve and -ve terminal voltage did not exceed 5.5V.

     

    A good point to think about is that power adapter (or wall warts) voltage under load should be lesser than the voltage measured by multi meter on the terminals without any load. But at this moment I'm taking "it is better to be safe than sorry" stance.  Will revisit this in the future. Perhaps continue with another article on powering Arduino BT using power adapter.

     

    In Malaysia, AA battery is commonly rated at 1.5V. Having 2 batteries in series give about 3V. Which is enough voltage to power up the board and within spec. However this say nothing about the amount of charge hold by the battery or how long will it last. So here is our first pitfall of the day. And I am a pitfall magnets.

     

    Personal experience. Run down 6 AA batteries to death in the half day of troubleshooting. The reason being using normal grade batteries! So dear readers, please use  Alkaline batteries. Better yet,  use rechargeable batteries!

     

    With that said, after initial test is done. I did use 4 AA rechargeable batteries in series . Each of the battery rated at 1.2V with 2100mAH charge capacity. Do be careful not to use 4 AA battery with 1.5V rating. That is 6V and possibly may damage the built in and soldered micro controller. Definitely not user replaceable. Unless the user is very skilled in soldering and desoldering surface mount chip with many small pins.


    Tutorial



      

    Step 1

    Assemble the simple circuit. Note that diode is to prevent reverse polarity. Still, be careful not to reverse polarity when connecting the second terminal header to Arduino BT.

     

    At this point we are not using the LED yet. So leave it unconnected.

     

    Good idea to double check the battery voltage using multimeter before going to next step.

     

    Step 2

    Connect the circuit +ve terminal (red wires)  to Arduino +ve terminal. Connect the circuit -ve terminal (black wires)  to Arduino -ve terminal. Battery holder without On/Off switch (as the one used in this article) means that the board will be powered up when both terminal is in contact. Be careful! 


    Step 3

    The board is powered up. There is two on board LED. One is power LED which should be steady on after power is up. The other one is Low Battery LED which will light up when battery is low.

     

    Step 4

    Next we are going to pair Arduino BT with a PC or notebook. Simply do the normal platform specific ways to pair Bluetooth device. I am using a notebook with 64 bit Windows for this test. So in Bluetooth panel, click Add Device and wait for it to detect. Initially it will detect it as Other Device. Select it and click next an follow the instruction. A driver will be automatically installed. Hence forth it will be shown as Arduino BT.

     

    Important: The pairing must be done from PC or Notebook since pass phrase need to be entered. When asked  enter 12345 as the pass phrase.

     

    Step 5

    After driver installation is successful and pairing is done. Verify the COM port number. Simply double click the newly added device  to look at its property page. Select the hardware tab. The comport number should be displayed.

     

    Step 6

    Launch Arduino IDE and open up the Blink  sample. After that, verify or do the following setting:

    • Menu : Tools > Board and choose Arduino BT with the correct microcontroller. In my case it is Arduino BT w/ ATMega328.
    • Menu : Tools > Serial Port and select the correct COM port.

     

    Step7

    Since we already open the Blink sample. Simply upload the code to Arduino BT.

     

    Important: If the upload is not successful with the following error:


avrdude: stk500_getsync(): not in sync: resp=0x00
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x51

     

    My theory; the error is due to on board Bluetooth module on Arduino BT actively communicate with Arduino microcontroller using RX and TX pin.  Arduino IDE also use this RX/TX as serial port to program the microcontroller chip. Hence the error. Apparently not everyone suffer this problem and base on internet search, some manage to solve it by replacing Bluetooth adapter on the PC/Notebook side.

     

    Fear not! The work around is to press Arduino BT reset button, release it and immediately (within 2 second) press the upload button in the IDE. Works like a charm!

     

    The reason being, boot-loader programmed into the micro controller wait for 5 second for programming serial communication before continuing with other function.

     

    Step 8

    Upload is completed, the board reset itself and is running, but where is the blinking LED!

     

    Don't panic! Unlike Arduino Uno or Duemilanove. Arduino BT does not come with onboard LED connected to digital I/O pin 13.

     

    This is the time to connect LED black wire to GND and yellow wire to pin 13 on the Arduino BT board.

     

    Step 9

    If everything goes well, enjoy the blink!



    Comments





Comments