Let's Make Robots!

Bluetooth dongle comms

Hi All

I am busy planning a platform (400mm x 400mm) for a couple of experiments (mainly AI) that I would like to do.

I intend using a PC as the brains (program in C++, VB or whatever) BUT the platform must not be connected using wire.

Therefore there needs to be bi-directional RF communications between the platform and the brains.

As I am Electronically Challenged (to put it mildly), this is where I am stuck.

What I would like to do is use a pair of USB Bluetooth dongles, one on the PC and the other connected to a 40 pin PIC16F877A processor to do the comms for the platform.

I have choosen the dongle route after having fried a number of (expensive) modules and home-grown boards and even 2 PC Motherboards.

On the PC side, there should not be any problem BUT how do I do the platform side?

I have choosen the PIC as I have both the PICKIT1 and PICKIT2 programmers as well as PICBasic and there are at least 32 pins available to use for inputs and outputs on the 40 pin PIC16F877A units.

At this stage, I do not even want to think about analog data or video. Maybe in the future when I start to work on object recognition or similar.

This project is more about robotics programming than actual robotics construction (I have my own lathe and mill so the construction side is not a big issue in my life) but without the communications issue being solved, there is no way forward.

This is actually project number 3, the first 2 were dumpstered after blowing up the PCs. Both times while trying to get the communications working using home-grown RF comms boards.

Is anyone able to provide guidence or a solution?

All the best

Madman

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Various solutions : Aircable is one thing I've seen on a robot but not personally used. Their USB to serial that should work appears to be on sale for $109. This would require RS232 serial at the microcontroller and a USB connection on the PC.

Sparkfun has their Bluesmirf unit that could work too. I have an earlier version of this but have not used it  except maybe once. Note this device would require TTL serial at the microcontroller, or else an added RS232 conversion circuit would be needed. The PC side would use this USB Bluetooth unit.  

I've used XBee connections in the past, worked great. Sparkfun has a few boards again, this one at the microcontroller, this one at the PC end, then pick a couple XBee radios to use with them. Again, TTL serial needed at micro end, or else might use this board for RS232 serial.

 

You might notice a common theme with Mr. robologist's recommendations: none of them involve connecting the PIC μC directly to a USB device.

It doesn't take much apparent effort for a PC to act as a USB host, but there's actually a lot going on behind the scenes. A little 8-bit μC would struggle to pull off all the management protocols that are required to act as a USB hub, especially if it needed to manage other tasks as well. It may well be possible to pull it off with a PIC16F877A, but microchip have released a series of μCs that actually have a USB controller built into them. Better yet, stick with USB on the PC side and use a more streamlined interface on the robot's end.

The bluesmirf works great and it's what I've used with processing and a picaxe. I use a usb dongle on the host machine . The main prob I've had with this setup is the initalestablishment of the com link, but once thats resolved, com is easy to do.

 

The other module that I've used that would require a serial converter on the pc side is the um96 module. This was seemed easier to coonnect two divices together...you can get a prebuilt serial level converter or build one yourself with a max232 chip. 

I've tried these rf link boards buth ave yet to get them to connect at all...and have since given up on them for the moment.

Hi All,

Thanks for the guidance and recomendations.

I have had a look at all of them and IMHO :

The AIRcable Serial3 (most expensive at $79.00) looks like the safest and simplest option (direct RS232 connection).

The BlueSMiRF unit (at $49.95) will need all sorts of conversion units (RS232 to TTL) to correct voltage discrepancies.

The XBee unit (although the cheapest at $22.95) will need all sorts of support circuitry etc. This unit is the only one that mentions something about an AT command set but I suspect that they all need some sort of AT commands to set the units up. This should be relatively easy to do from the PIC on bootup or reconnection.

Now if I have it correct, the AIRcable unit should be the easiest to interface with the PIC16F877A unit as all it needs is TX and RX signals (and of course V+ and  V- )

"ALL" that is needed is to work out a syncronization protocol and we are on the way.

 Any comments on this would be appreciated.

 

 

It would be helpful to know what specific board the 16F877A is to be used with, as searchs of PICKit 1 and PICKit 2 turn up a variety of possibilities.

If you're connecting the bluesmirf directly to the pic, you shouldn't need to do anything other than connect rx/tx/5v/gnd as it's ttl...my understanding was that you'd be using the usb key on the comp and a second device(bluesmirf) for the pic... This is what I use and it works pretty well. Not sure where you got the idea that you'd need extra components to connect it to a pic...

The AT command set is the standard for serial com..google it and you'll find tons of info on it. Back in the day I used it to configure and connect via oldschool modems to bbs boards....thats pre WWW for you youngins...  :D

Hi Robologist /Voodoobot

I have a "spider" board that I want to use. Basically, it holds the PIC, crystal & caps, power led & reset switches and leads all the ports out to individual pins, all nicely ordered. Even has inline programming connections. (not too sure how to add attachments yet so look at the schematic here and layout here) Note: the layout shows screw terminal connectors and not pins but they are interchangable. 

Its definitely not the smallest option but that is ok. This is not meant to be an exercise in miniaturization.

The nice thing is that you simply plug the sensor boards, h-bridge driver boards or anything else needed to interface to the PIC using leads.

I have also thought of modifying the layout so that opto-isolators can be put between the PIC pins and the pins that you connect things to. Currently these are protected by 220 ohm resistors.

To convert a pin from "input" to "output", you swing the opto-isolator thru 180 degrees. I saw that idea on a Vellerman serial breakout board (that I also blew up!!!)

The opto-isolators will make the board construction more complicated because there will have to be either a lot of cross-link wires soldered in or the board will have to be double sided.

Oh well, install the free Eagle 4.14 software (again).

For example, a USB plug (to take the AIRcable unit) would have 4 wires, V+, V- connected to the power bus on the spider board and T, RX going to 2 pins in whatever port I decide on and would be on its own board.

In fact, each sensor or driver will be on its own board. I think it will make recovery from "blue smoke" a whole bunch easier and the opto-isolators will make it a whole bunch less costly..

One question though, on the schematic , it shows pins 25 and 26 as TX and RX (terminating in JP5). Are these the pins to connect to the AIRcable unit or will any pins do?

If you have to play around with individual bits of the byte received (or sent), things get complicated and the dog gets beaten into the ground instead of getting a pat on the head. ;>}. If pins 25/26 are the ones to use, that means that port c only has 6 "useable" pins. Oh well, we will have to work around that slight inconvenience.

I dare say that if more inputs/outputs are needed, we can always use multiplexing, I2C or similar but that is WAY WAY in the future.

The platform will use some 12v batteries out of a couple of UPS's which got a "slight" lightning zap to the controler boards.

Drive motors will be hacked windscreen wiper motors. May be interesting to get the oscilation to become full rotary motion and isolating the -ve connections from the casing so that I can reverse them without a big flash. No really serious issues there.

I'm not sure whether to use wheels (go-kart or small atv - 6"/150mm dia) or tracks (have no idea where to even start looking for them

Ok, enough from me, supper is calling (or more importantly, the wife)

All the best

Aubrey

I'm not versed in the pic as much as the picaxe, but I believe that yes, the rx/tx would connect to the airCable device. I don't think you can use any pin for serial com.

One thing I'm curious about is why the opto isolators, I mean for the motors, I understand, but it adds undue complexity.

 

 

I agree about the complexity.

However if a short happens, the processor is toast.

If everything is isolated you can do what you like and the worst that can happen, apart from smoking the periferal board is that you will blow the isolator.

In effect the main processor will be as idiot proof as it can be.

You are using a "bare" PIC, with no RS232 chip, so the Aircable unit would be a bad choice. The PIC by itself has TTL serial, that is, serial levels at 0 to 5 volts, not RS232 levels of +9 volts to -9 volts.

The bluesmirf and XBee units would allow direct connection to the PIC TX and RX (and ground) pins, no conversion needed, since the PIC board does not have an RS232 level shifter.