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.

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.

This is "typical" of the issues that I have encountered - incompatable voltages!

Let me ask this question :

If I have a USB plug on the spider board connecting directly to the TX and RX pins on the PIC and insert a standard Bluetooth dongle into the plug, would the 2 be compatable from a hardware point of view?

I know that there are many different libraries available for the PIC and hopefully I will be able to programatically configure the Bluetooth dongle to connect to the one on the PC.

Thereafter, everything (handshaking, synconization, data transferal etc) is done programatically which, for me, is a managable issue (and fun!).

Maybe there is a PIC series that has this sort of functionality built into the onboard OS.

I do not want to use the RF PIC range because none of them come with an arial, you have to provide one. (pain!)

The Bluetooth USB dongle is standard issue on most cell phones these days. I have 3 and there are many available from pawn shops at reasonable prices.

Quote "If I have a USB plug on the spider board connecting directly to the TX and RX pins on the PIC and insert a standard Bluetooth dongle into the plug, would the 2 be compatable from a hardware point of view?"

USB is yet another serial voltage and communications standard that is not TTL serial. So it would be bad to try to connect a USB plug directly to the TTL serial lines I see located close to the 7805 voltage reg on your "spider board" layout.

TTL serial - basic 0 to 5 volts signalling 

RS-232 serial - +9 volts to -9 volts signalling

USB - differential 2 line 0 to 2.8 and 3.6 to 0.3 volt signalling, unrecognizalbe at TTL logic levels.

USB Bluetooth dongles are great for the PC end, but not so for the PIC end of the connection. If you want Bluetooth serial at the PIC, please use the Bluesmirf unit, TTL serial ready.

Life is like that!!!

Just when you think the answer is close.....

Why can things not all operate on the same voltages?

OK, I do know the answer - different technologies...

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.

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.

 

 

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

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.

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.