Shop OBEX P1 Docs P2 Docs Learn Events
Adding bluetooth module to sumobot — Parallax Forums

Adding bluetooth module to sumobot

RuturajRuturaj Posts: 19
edited 2014-12-15 10:23 in General Discussion
I want to use bluetooth module with sumo bot

https://core-electronics.com.au/attachments/guides/Product-User-Guide-JY-MCU-Bluetooth-UART-R1-0.pdf

Can I connect it to sumobot?

if yes
1.How to connect it?
2.What libraries will I need in order to use it?

if no
What other bluetooth module can I use?

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2014-12-14 21:39
    Electrically, you could connect the Bluetooth module to your SumoBot since it can run off 5V and use 5V logic levels. The problem is that the module comes configured for 38400 Baud and the SumoBot can't do serial I/O that fast. Best reliable speed is 9600 Baud. You can probably reconfigure the Bluetooth module to operate at 9600 Baud, but the documentation you provided (at the link) doesn't say how to do it. You may be able to get further documentation from the vendor.

    Parallax's RN-42 Bluetooth module (http://www.parallax.com/product/30086) has lots of documentation and examples for use with a Stamp (like on the SumoBot). This documentation shows how to connect the RN-42 to a Stamp using 2 to 5 I/O pins depending on whether you want to use flow control and whether you want to be able to reset the RN-42 from the Stamp.

    The Stamp doesn't use libraries the way an Arduino might. The serial I/O is built into the Basic interpreter used by the Stamp. Look at the Stamp Reference Manual (http://www.parallax.com/sites/default/files/downloads/27218-Web-BASICStampManual-v2.2.pdf) for a description of the SERIN and SEROUT statements.
  • RuturajRuturaj Posts: 19
    edited 2014-12-15 01:09
    Mike Green wrote: »
    Electrically, you could connect the Bluetooth module to your SumoBot since it can run off 5V and use 5V logic levels. The problem is that the module comes configured for 38400 Baud and the SumoBot can't do serial I/O that fast. Best reliable speed is 9600 Baud. You can probably reconfigure the Bluetooth module to operate at 9600 Baud, but the documentation you provided (at the link) doesn't say how to do it. You may be able to get further documentation from the vendor.

    Parallax's RN-42 Bluetooth module (http://www.parallax.com/product/30086) has lots of documentation and examples for use with a Stamp (like on the SumoBot). This documentation shows how to connect the RN-42 to a Stamp using 2 to 5 I/O pins depending on whether you want to use flow control and whether you want to be able to reset the RN-42 from the Stamp.

    The Stamp doesn't use libraries the way an Arduino might. The serial I/O is built into the Basic interpreter used by the Stamp. Look at the Stamp Reference Manual (http://www.parallax.com/sites/default/files/downloads/27218-Web-BASICStampManual-v2.2.pdf) for a description of the SERIN and SEROUT statements.

    Thank you for reply sir
    RN-42 is little costly for me and I already have the one I mentioned
    I used it with arcbotics sparki (based on Arduino) with 9600 baud
    In code I just added one line saying
    serial1.begin(9600)

    I found this site
    https://github.com/rwaldron/johnny-five/wiki/JY-MCU-Bluetooth-Serial-Port-Module-Notes
    can I use same/similar code?

    Also I am planning to use sane one with my activity bot too, should speed should I choose?

    PS my main goal is to develop android application which can be used for sumo fight
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-12-15 01:27
    Changing the Sumobot over to a Propeller solution would eliminate the baud rate problem.

    SchmartBoards has a very small Propeller board that might be appropriate.
    http://www.schmartboard.com/index.asp?page=products_populated&id=205

    Of course, it might be worth asking Parallax to consider an upgrade of the Sumobot to a purpose built Propeller board. I suspect there are a lot of Sumbot users that might enjoy the upgrade.
  • Mike GreenMike Green Posts: 23,101
    edited 2014-12-15 07:24
    You can't use the same code. The Arduino is programmed in C and the SumoBot is programmed in Parallax Basic. These are completely different programming languages. You could translate the Arduino test program though into Parallax Basic for use with the SumoBot.

    The ActivityBot uses a Parallax Propeller which is different and can easily handle 38400 Baud or 9600 Baud. It uses 3.3V logic and a 3.3V power supply. With the ActivityBot, you must connect the Bluetooth module's power connections to +3.3V and Ground. Like the Stamp, you can use any unused I/O pins for serial I/O. Although you can program the Propeller in C, the structure of programs is different from Arduino programs. Look at the Propeller C example programs at the Learn (http://learn.parallax.com) website.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-12-15 10:23
    I suppose it would be easier to migrate to PropBasic than to Aruduino (which is really C++), but Parallax does make a board to adapt the BOE to an Arduino. Regrettably, I believe that board is too long for the SumoBot, so I suggested the SchmartBoard as a solution.

    You may have to build higher on the SumoBox, as I recall there is no height limit.. just limits on weight and footprint.

    There is also a Propeller board that plugs into Arduino boards and mimics all the characteristics. ... the Propeller ASC+ . That might be a good fit. You could easily piggyback a board to plug in the servo motors and all sorts of sensors and the Bluetooth.

    http://mghdesigns.com/propeller/mgh-designs/propeller-asc-arduino-shield-compatible-1.html
Sign In or Register to comment.