How to - Boe-Bot Robot with eb500 Bluetooth Transceiver Module
![Andy Lindsay (Parallax)](https://forums.parallax.com/uploads/userpics/601/n66C2UR7NIHRG.jpg)
Bluetooth Wireless for PC ←→ Boe-Bot Robot Communication
·
For more information on the hardware used in this application, see the Boe-Bot Robot with Bluetooth Transceiver Module kit page at www.parallax.com.
·
Prerequisites: Complete the activities through Chapter 4 in the Robotics with the Boe-Bot (.pdf) text before continuing here.· This text comes with the Boe-Bot Robot Kit, which is part of the Boe-Bot Robot with Bluetooth Transceiver Module kit.· The full PDF version of this text can also be downloaded from any parallax.com Boe-Bot Robot product page, and is also available from the Stamps in Class Downloads page.·
·
The two most common wireless BASIC Stamp configurations that involve eb500 Bluetooth transceivers are:
·
1)···· A BASIC Stamp communicating with a Bluetooth equipped PC
2)···· Two BASIC Stamps using two eb500 modules to communicate
·
The figure below shows configuration 1, a BASIC Stamp using the eb500 module to communicate with a Bluetooth equipped PC.· In this case, the Boe-Bot Robot’s BASIC Stamp is running code that sends user prompts to the PC so that you can enter navigation instructions using the BASIC Stamp Editor’s Debug Terminal.· The PC’s Bluetooth radio and software combined with the eb500 plugged into the Board of Education platform’s AppMod header makes it possible for the two to use serial communication over the Bluetooth wireless connection.
·
····![attachment.php?attachmentid=57386](http://forums.parallax.com/attachment.php?attachmentid=57386)
Assuming you have downloaded the BASIC Stamp Editor v2.4 (or newer) from the BASIC Stamp Software page and installed it, here's how to get set up.
·
P······ Follow the instructions in the eb500 Manual for connecting the eb500 module to your Board of Education + BASIC Stamp 2 and setting up a connection with your computer's Bluetooth manager.
P······ Open the BASIC Stamp Editor.
P······ Click the Edit menu and select Preferences.
P······Click the Edit Ports button.
P······Right click the COM port entry that matches the one for the eb500 that you set up with your computer's Bluetooth manager, and select Include port.
·
···········
···········
Next, try the BASIC Stamp 2 programs in the Downloads Section (below).· To communicate with them, you will have to open a Debug Terminal and select the eb500 COM port as follows:
·
P······ Open the Program with the BASIC Stamp Editor.
P······ Click the Run menu and select Run.
·
···· After you have loaded the program into the BASIC Stamp, you’ll need to open a Debug Terminal.·
·
P····· Click the Run menu, select Debug, then New.
P····· Click the Com Port dropdown menu and select the COM port that was assigned to your eb500.
P·····Press and release your BASIC Stamp carrier board's reset button to restart the program.
·
The Debug Terminal’s blue receive windowpane will display serial messages sent by the BASIC Stamp to the PC over Bluetooth.· Type your replies to the prompts into the white transmit windowpane to send serial messages to the BASIC Stamp (also serial over Bluetooth.)·
····![attachment.php?attachmentid=57388](http://forums.parallax.com/attachment.php?attachmentid=57388)
The figure with the Debug Terminal shows an example of Boe-Bot control with terminal communication using example program 4-Terminal-Boe-Bot-Control.bs2.···
·
Downloads - Example Code:
1-Find-Own-Address.bs2· -· Displays eb500 hardware address.
·
2-Hello-World.bs2· -· Displays a test message from the BASIC Stamp to the PC over the Bluetooth connection.
·
3-Get-Character.bs2· -· Prompts you to enter a character and then sends it back to the PC.· Verifies that the·BASIC Stamp can receive messages from the PC.
·
4-Terminal-Boe-Bot-Control.bs2· - Allows you to control the Boe-Bot.·
·
The 4-Terminal-Boe-Bot-Control.bs2·example program·will prompt you for the number of pulses to send to the servos, and then the pulse width to transmit to each servo.· The program sends about 43 pulses per second, so 43 pulses would give you 1 second of run time, 86 would give you 2 seconds, and so on.· For speed control, 800 is about full speed counterclockwise, 700 is full speed clockwise, and 750 is stop.· If you want a wheel to go half speed counter clockwise, try about 775.· Half speed clockwise, would be about 725, and so on.·
·
Note: In the Robotics with the Boe-Bot text 850 and 650 are used for full speed counterclockwise and clockwise.· It turns out that once the pulses go beyond about 800 or 700, there isn’t much change in speed.· Between 800 and 700 is where the speed control is fairly linear.
·
Here are some example replies to the prompts from 4-Terminal-Boe-Bot-Control.bs2.· Try them out, and you'll get the hang of·it pretty quickly.
·
P······ Load 4-Terminal-Bot-Bot-Control.bs2 into the BASIC Stamp Editor.
P······ Use CTRL+R to load the program into the BASIC Stamp and run it.
P······ If your debug terminal isn’t already connected to the BASIC Stamp over Bluetooth, follow the instructions above to get connected.
P······ In reply to the prompts, try the following combinations:
o······· Full speed forward 1 second
§········ Number of pulses: 43
§········ Left servo pulse width: 850
§········ Right servo pulse width: 650
o······· Rotate left for just under ½ second
§········ Number of pulses: 20
§········ Left servo pulse width: 650
§········ Right servo pulse width: 650
o······· Rotate right for just under ½ second
§········ Number of pulses: 20
§········ Left servo pulse width: 850
§········ Right servo pulse width: 650
o······· Back up slowly for 2 seconds
§········ Number of pulses: 86
§········ Left servo pulse width: 735
§········ Right servo pulse width: 765
·
NOTE: You might need to adjust the servo pulse durations to get the Boe-Bot to go straight forward and backward.· Bring the pulses delivered to the faster wheel closer to 750 to match it with the slower wheel.· Remember that speed control doesn’t start until the pulses are in the 700 to 800 (1.4 to 1.6 ms) range.· For more information on matching servo speeds, see Robotics with the Boe-Bot, see Chapter 3, Activity #4 and Chapter 4, Activity #2.
Post Edited By Moderator (Jessica Uelmen (Parallax)) : 8/25/2010 6:28:22 PM GMT
·
For more information on the hardware used in this application, see the Boe-Bot Robot with Bluetooth Transceiver Module kit page at www.parallax.com.
·
Prerequisites: Complete the activities through Chapter 4 in the Robotics with the Boe-Bot (.pdf) text before continuing here.· This text comes with the Boe-Bot Robot Kit, which is part of the Boe-Bot Robot with Bluetooth Transceiver Module kit.· The full PDF version of this text can also be downloaded from any parallax.com Boe-Bot Robot product page, and is also available from the Stamps in Class Downloads page.·
·
The two most common wireless BASIC Stamp configurations that involve eb500 Bluetooth transceivers are:
·
1)···· A BASIC Stamp communicating with a Bluetooth equipped PC
2)···· Two BASIC Stamps using two eb500 modules to communicate
·
The figure below shows configuration 1, a BASIC Stamp using the eb500 module to communicate with a Bluetooth equipped PC.· In this case, the Boe-Bot Robot’s BASIC Stamp is running code that sends user prompts to the PC so that you can enter navigation instructions using the BASIC Stamp Editor’s Debug Terminal.· The PC’s Bluetooth radio and software combined with the eb500 plugged into the Board of Education platform’s AppMod header makes it possible for the two to use serial communication over the Bluetooth wireless connection.
·
····
Assuming you have downloaded the BASIC Stamp Editor v2.4 (or newer) from the BASIC Stamp Software page and installed it, here's how to get set up.
·
P······ Follow the instructions in the eb500 Manual for connecting the eb500 module to your Board of Education + BASIC Stamp 2 and setting up a connection with your computer's Bluetooth manager.
P······ Open the BASIC Stamp Editor.
P······ Click the Edit menu and select Preferences.
P······Click the Edit Ports button.
P······Right click the COM port entry that matches the one for the eb500 that you set up with your computer's Bluetooth manager, and select Include port.
·
···········
Next, try the BASIC Stamp 2 programs in the Downloads Section (below).· To communicate with them, you will have to open a Debug Terminal and select the eb500 COM port as follows:
·
P······ Open the Program with the BASIC Stamp Editor.
P······ Click the Run menu and select Run.
·
···· After you have loaded the program into the BASIC Stamp, you’ll need to open a Debug Terminal.·
·
P····· Click the Run menu, select Debug, then New.
P····· Click the Com Port dropdown menu and select the COM port that was assigned to your eb500.
P·····Press and release your BASIC Stamp carrier board's reset button to restart the program.
·
The Debug Terminal’s blue receive windowpane will display serial messages sent by the BASIC Stamp to the PC over Bluetooth.· Type your replies to the prompts into the white transmit windowpane to send serial messages to the BASIC Stamp (also serial over Bluetooth.)·
····
The figure with the Debug Terminal shows an example of Boe-Bot control with terminal communication using example program 4-Terminal-Boe-Bot-Control.bs2.···
·
Downloads - Example Code:
1-Find-Own-Address.bs2· -· Displays eb500 hardware address.
·
2-Hello-World.bs2· -· Displays a test message from the BASIC Stamp to the PC over the Bluetooth connection.
·
3-Get-Character.bs2· -· Prompts you to enter a character and then sends it back to the PC.· Verifies that the·BASIC Stamp can receive messages from the PC.
·
4-Terminal-Boe-Bot-Control.bs2· - Allows you to control the Boe-Bot.·
·
The 4-Terminal-Boe-Bot-Control.bs2·example program·will prompt you for the number of pulses to send to the servos, and then the pulse width to transmit to each servo.· The program sends about 43 pulses per second, so 43 pulses would give you 1 second of run time, 86 would give you 2 seconds, and so on.· For speed control, 800 is about full speed counterclockwise, 700 is full speed clockwise, and 750 is stop.· If you want a wheel to go half speed counter clockwise, try about 775.· Half speed clockwise, would be about 725, and so on.·
·
Note: In the Robotics with the Boe-Bot text 850 and 650 are used for full speed counterclockwise and clockwise.· It turns out that once the pulses go beyond about 800 or 700, there isn’t much change in speed.· Between 800 and 700 is where the speed control is fairly linear.
·
Here are some example replies to the prompts from 4-Terminal-Boe-Bot-Control.bs2.· Try them out, and you'll get the hang of·it pretty quickly.
·
P······ Load 4-Terminal-Bot-Bot-Control.bs2 into the BASIC Stamp Editor.
P······ Use CTRL+R to load the program into the BASIC Stamp and run it.
P······ If your debug terminal isn’t already connected to the BASIC Stamp over Bluetooth, follow the instructions above to get connected.
P······ In reply to the prompts, try the following combinations:
o······· Full speed forward 1 second
§········ Number of pulses: 43
§········ Left servo pulse width: 850
§········ Right servo pulse width: 650
o······· Rotate left for just under ½ second
§········ Number of pulses: 20
§········ Left servo pulse width: 650
§········ Right servo pulse width: 650
o······· Rotate right for just under ½ second
§········ Number of pulses: 20
§········ Left servo pulse width: 850
§········ Right servo pulse width: 650
o······· Back up slowly for 2 seconds
§········ Number of pulses: 86
§········ Left servo pulse width: 735
§········ Right servo pulse width: 765
·
NOTE: You might need to adjust the servo pulse durations to get the Boe-Bot to go straight forward and backward.· Bring the pulses delivered to the faster wheel closer to 750 to match it with the slower wheel.· Remember that speed control doesn’t start until the pulses are in the 700 to 800 (1.4 to 1.6 ms) range.· For more information on matching servo speeds, see Robotics with the Boe-Bot, see Chapter 3, Activity #4 and Chapter 4, Activity #2.
Post Edited By Moderator (Jessica Uelmen (Parallax)) : 8/25/2010 6:28:22 PM GMT
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Andy Lindsay
Education Department
Parallax, Inc.
Post Edited (Andy Lindsay (Parallax)) : 12/17/2008 3:58:29 AM GMT
I have tried to follow your steps that you have mentioned. But I got a error message whenever I try to download the program into my basic stamp2.
I have already connected my bluetooth dongle to the eb500, and the COM is COM12. Therefore when i edit the ports, I only include COM12 and I shift this COM in the 1st order. But whenever I tried to click "Run", I receive a error message "No Basic Stamp Found! 3 serial ports were excluded from the search, click edit ports for more information"
I notice that when I click "Run", the LED on the eb500 turns off, indicating loss of connection to my dongle.
Why is this so?
Kindly advise
Regards,
Vincent Chung
Sorry about the above request, I have got it working already. Now I know how to send messages from BS2 to my PC via Bluetooth. But you state that we could also send messages from PC to BS2? May I know how is it done?? Instead of sending messages to BS2, can we send commands instead?
Right now I am working on building a Bluetooth controlled car, so I was thinking if I could send commands from the PC to the BS2, so the BS2 can control the motor controller which I have bought from Parallax to control my car.
Example would be if I press the "up" arrow on the keyboard, my car would move forward.
Pls advise.
Thanks alot!!
You won't be able to program the BOE-BOT through the connection that Andy described, you'll still need to use a direct serial connection to program the Basic Stamp.
What this connection does is allow you to receive data from the BOE-BOT through the Bluetooth connection. You can also send commands back to the BOE-BOT to control is actions. Of course, you will need to write a program for the BOE-BOT that can recieve the commands and know what to do with them. For example, the Repeated Boe-Bot Control.bs2 program shown above will recieve commands to set the number of pulses and pulse widths to the left and right servo motors. With some practice this will allow you to wirelessly drive the BOE-BOT from the debug screen.
Rick
Thanks for yout prompt reply. When you say "use a direct serial connection" to program the BS2, do you mean using the download cable?
And "sending commands back to BOE to control its action". how do I actually do it? Can BS programming language do the trick? Since I would like to send the commands via the arrow keys on my keyboard to navigate my car.
As I am very new in building robots and to Basic Stamp, sorry for any inconvenience caused.
Vincent.
There are links to five programs you can download from the first post on this thread. They provide rudimentary examples of communicating with and controlling a Boe-Bot Robot by exchanging messages with it.· You type messages into the Debug Terminal to send them to the Boe-Bot through the eb500 serial connection. Try out Repeated "Boe-Bot Control.bs2." In reply to the prompts, for the number of pulses enter about 43 for each second of run time you want. So, if you want it to run for about 2 seconds, enter 86. In reply to the servo pulse width prompts, 650 is full speed clockwise, 850 is full speed counterclockwise, and not surprisingly, 750 is stop.· You will get a fairly linear speed response between 700 and 800.
Before doing all this, you should really complete Robotics with the Boe-Bot.·
Boe-Bot Full Kit (Includes Robotics with the Boe-Bot), and the full text is a PDF download on·this page:
http://www.parallax.com/tabid/134/ProductID/302/Default.aspx
For the best possible background, complete What's a Microcontroller before even starting Robotics with the Boe-Bot. It will give you a great start with the electronics and programming you'll need for inventing and robotic creations.··You can download the full What's a Microcontroller PDF text from any of the links below.
What's a Microcontroller
Kit if you Already have Boe-Bot Full Kit
Just the parts: http://www.parallax.com/tabid/134/ProductID/328/Default.aspx
Parts + text: http://www.parallax.com/tabid/134/ProductID/327/Default.aspx
Starter Kit Options that Include What's a Microcontroller
BASIC Stamp Activity Kit
http://www.parallax.com/tabid/134/ProductID/313/Default.aspx
BASIC Stamp Discovery Kit
http://www.parallax.com/tabid/134/ProductID/320/Default.aspx
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Andy Lindsay
Education Department
Parallax, Inc.
Post Edited (Andy Lindsay (Parallax)) : 12/10/2008 4:22:07 PM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Andy Lindsay
Education Department
Parallax, Inc.
I just downloaded Microsoft Robotics Studio 2008 R2 Express Edition, and i can't seem to do anything with it that includes my BS2 board. I was planning to use my COM port to connect it to the computer. I have looked on the internet but cant find anything at all. I was planning to have sensor imput to go to MSRS and other things like that. I just need to know how to use MSRS is all im saying.
P.S. LOVE your "What's a Microcontroller?" and Your Propstick kits! Whithout them i would not know how to use the BS2 ( just starting to learn the propeller)
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"When the government is afraid of the people there is liberty, when the people are afraid of the government, there is tryanny"
·Thomas Jefferson
Try these for starters:
Turn Your PC Into a Motion Sensing Security Device with .NET
http://www.devx.com/dotnet/Article/32278
Discover a New Frontier for .NET Development: Program an LCD Display
http://www.devx.com/dotnet/Article/32067
Andy
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Andy Lindsay
Education Department
Parallax, Inc.
When I plugged the bluetooth adapter into my PC, it said the hardware is found and ready to use. However, how do I open the Bluetooth Devices dialog because I don't see any bluetooth tray icon on my PC? Or does it only work on Windows XP SP2?
Post Edited (thangngoc) : 3/12/2010 7:54:53 PM GMT
I have the same problem with Vincent too. How could I resolve the problem? Thanks
If I am not wrong, I actually reset the whole thing and try again.
Which means disconnecting the connections and connecting them back again, and then power on the board again.
Can give it a try....
Regards,