Bluetooth and AVR

Go To Last Post
38 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi.. I'm new member. I have project to connect micro to bluetooth module (transceiver)and transmitt my data to PC through usb bluetooth dongle (receiver). Any body know which bluetooth i have to use??

Or any body have ever exeperienced with this??

SENSOR >> MICRO >> BT_TRANSCEIVER >> USB_BT_DONGLE >> PC

(I use AVR micro, and BASCOM-AVR)

THANks,

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

try www.sparkfun.com they have some suitable BT modules.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have the same problem. I have a 10bit A/D converter, in a 16L microprocessor. I have sucided to transmitt to a bluetooth dongle and to a terminal program. I have the problem to recording the value in matlab, and convert the two byte to a value.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'm working on it, but it's not so easy as it looks... I didnt find yet any source or library which can comunicate with any cheap BT dongle used with PC. I'm still trying but no luck yet... If anybody has some usefull information about that please report.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Well, if you're using a bluetooth device that doesn't require the use of commands (AT-style or otherwise), then you have a simple serial-over-bluetooth device hooked up to your micro. It will mimic a serial connection over Bluetooth and your micro has no clue that it's over the air instead of RS232.

In that case, it should simply be a matter of pairing your laptop with the device and linking to its "serial" service, in which case there would become a new virtual COM port available on your computer that you can access with a terminal program and see output from your micro.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

I'm working on it, but it's not so easy as it looks... I didnt find yet any source or library which can comunicate with any cheap BT dongle used with PC. I'm still trying but no luck yet... If anybody has some usefull information about that please report.

I'm interested in this too. If I can find the specs for the generic bluetooth dongle peripheral (Microsoft makes a one-size-fits-all generic driver) I could base it off MyUSB.

- Dean :twisted:

Make Atmel Studio better with my free extensions. Open source and feedback welcome!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

As noted above, one can use two bluetooth modules in SPP mode, to act as a wireless serial connection. The modules are sold in a pair, and are set up to talk to (only) each other.

An alternative is to use a generic BT module, and have the uP control it, through the Reset, Discovery, Bond, and SPPConnect phases, where upon it then acts like a serial connection.

An example tying a BT GPS to a Pic/LCD is illustrated below. It may give you some guidance, no pun intended.

BT GPS Interface

JC

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Bluetooth and MCUs: the hard road, as compared to other wireless alternatives.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Of course there are modules that can transfer RS232-BT just by connecting RS232 data to that but these modules are much more expansive than classical PC BT dongles and such solution is for noobs.. not for us :-)

My way is to learn all about USB communication and use some USB monitor like http://www.aggsoft.com/usb-port-...
or find spec about abcminiuser told

Some infos:

BT Framework VCL(source for $300) or ActiveX library
http://www.torry.net/authorsmore...

http://channel9.msdn.com/wiki/de...

http://www.quietearth.us/nxtlibc...

free BT stack for Linux!
http://sourceforge.net/project/s...
http://www.bluez.org/

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

What do you think about a sigle chip solution:
LMX9838SB

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The real trouble with implementing bluetooth is that unlike USB, the specifications are not available without purchase. That makes it very hard to implement, even with traces; having just a trace of the PC->Dongle communications would be handy in addition to the spec, but by itself isn't too valuable without any context.

I've had a look at the Linux stack before but couldn't make head nor tails of it. What I'd really like would be a document outlining the specification of the dongle's communication interface - even if a full stack couldn't be implemented, the dongles are cheap enough to be useful as wireless replacements for communication wires.

- Dean :twisted:

Make Atmel Studio better with my free extensions. Open source and feedback welcome!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You can use the UART module, paired with one of these
cheap BT to UART interfaces.

I assume they're the BT to rs232 adapters people have made reference to....

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Another option is the Arduino BT board.

Unfortunately, that option isn't cheap :(

....

abcminiuser wrote:
The real trouble with implementing bluetooth is that unlike USB, the specifications are not available without purchase. That makes it very hard to implement, even with traces; having just a trace of the PC->Dongle communications would be handy in addition to the spec, but by itself isn't too valuable without any context.

Isn't the BT protocol, heavily based on the USB protocol??

hmmm.... even if it was, I doubt that would help anyway...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

Isn't the BT protocol, heavily based on the USB protocol??

The dongle is standard USB, obviously, for the transport. While I know that the Bluetooth HID profile (Bluetooth "profile" is comparable to USB "class") uses the USB specification rather than re-inventing the wheel, the actual stack and the communication protocol between host->dongle over USB is a complete mystery.

Just being able to see what endpoints a device has doesn't allow me to control the device; I've no idea of the *data* I need to be sending over those endpoints.

- Dean :twisted:

Make Atmel Studio better with my free extensions. Open source and feedback welcome!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Are you set on Bluetooth? There are lots of other wireless options that you can use like ZigBee and even brain-dead easy modules.

The LMX9838SB looks really cool. Integrated antenna and SPP support in something that costs $24 for single quantities or $17-20 for bulk.

Math is cool.
jevinskie.com

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

abcminiuser wrote:
The real trouble with implementing bluetooth is that unlike USB, the specifications are not available without purchase. That makes it very hard to implement, even with traces; having just a trace of the PC->Dongle communications would be handy in addition to the spec, but by itself isn't too valuable without any context...

It looks like they made it free now.
Here's a link to the specs.

http://www.bluetooth.com/Bluetoo...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

It looks like they made it free now.
Here's a link to the specs.

http://www.bluetooth.com/Bluetoo... ... efault.htm

Holy excited explicative! That certainly wasn't accessable a few months ago - just a login link for members.

I've found the USB transport specification, so I've got a lot of reading to do. Assuming I can get a working bluetooth stack set up, I should be able to get bluetooth communications up and running.

Is there any interest in doing things this way (USB AVR + USB Bluetooth Dongle) instead of just purchasing a bluetooth IC?

- Dean :twisted:

Make Atmel Studio better with my free extensions. Open source and feedback welcome!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

That is SWEET!!!

I might look into doing BT project now!!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I've been working with Bluetooth (used the Sena and Roving Networks modules) and AVR and one big benefit of purchasing an off the shelf module if you're doing small quantities is that you get a user-transferrable FCC registration that the AVR + chip solution would not have.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I was thinking it would be really cool to use a BT headset on a AVR powered device; the AVR would just relay the audio from the BT headset over a longer range RF link.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

TheRock wrote:
I was thinking it would be really cool to use a BT headset on a AVR powered device; the AVR would just relay the audio from the BT headset over a longer range RF link.

how about one of those devices that cradles your cell phone and bridges it to an RJ11 jack for you home's phones, or an additional cordless phone? This bridge uses bluetooth to talk to your cell phone. Panasonic, GE, others.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Damn, there does that idea. The first few pages of the specification says:

Quote:
Use of the Specification by anyone who is not a member of Bluetooth SIG or a
party to an Early Adopters Agreement (each such person or party, a “Member”),
is prohibited. The legal rights and obligations of each Member are governed
by their applicable Membership Agreement, Early Adopters Agreement
or Promoters Agreement. No license, express or implied, by estoppel or otherwise,
to any intellectual property rights are granted herein.

Which means that unless I pony up a boatload of cash, I can't implement my own Bluetooth stack as part of MyUSB.

- Dean :twisted:

Make Atmel Studio better with my free extensions. Open source and feedback welcome!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Scratch that, I can become an "Adopter Member" which is free, but has no advantages other than the ability to use the specification. It requires a company however - as I am registed as a sole trader with an Australian Business Number in Australia, does anyone know if this will suffice?

- Dean :twisted:

Make Atmel Studio better with my free extensions. Open source and feedback welcome!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I've been doing a few projects here and there, and I decided to do one with an BT module (Sena brand). Its a UART connection to the uC.

I decided to make a BT security system for my car. The BT on the phone is used to unlock the car. So far I have a pretty solid detection system, the only problem is that it's not very secure, but then who knows that the system is controlled by BT. You can use any BT enabled phone/device. But primarily it uses the devices MAC addresses. Eventually I may make the devices pair when they come in contact.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

But primarily it uses the devices MAC addresses.

Bad, bad, BAD idea. While that would certainly keep the normal people out, it's just as effective as MAC filtering in Wifi to the technical folk -- specifically, it's the electrical equivalent of painting "keep out" on an unlocked door. I'd suggest an embedded implementation of some decent encryption scheme such as 3DES.

- Dean :twisted:

Make Atmel Studio better with my free extensions. Open source and feedback welcome!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yeh true. But it will be a door that no one knows about.
The main idea is to implement it as a everyday useful project. I like the idea of just walking up to my car and it unlocking. Like the new Lexus remote systems etc..

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

At the moment a USB AVR bluetooth stack seems unlikely, because the HCI layer mandates that the host must be able to buffer up to 64KB packets of data before handing it off to the upper service layers. Since I don't have that amount of RAM handy, it means that unless I can either ensure that the packets will be under ~2KB in size or figure out some method of buffering them I can't make a working stack.

Anyone with blutooth knowedge have any advice on this?

- Dean :twisted:

Make Atmel Studio better with my free extensions. Open source and feedback welcome!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

For Stereo audio streaming, or FAX over BT, etc., the large buffer would seem appropriate.

For many small projects, simple HID interfaces, data to and from a sensor board to a PC, etc., using smaller data packets is very reasonable.

Perhaps you could proceed with your development, with the understanding that your 8-bit AVR implimentation is not fully BT compatible.

Up to the user to insure that this limitation is not a problem with their firmware.

JC

Edit: Typos

Last Edited: Mon. Sep 15, 2008 - 01:14 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

That's probably a good idea. I just don't like starting something that massive without a good idea of if it will work or not.

This afternoon I've started with another USB class, a proprietary one from Microsoft. Should be quite interesting if I get it finished and working...

- Dean :twisted:

Make Atmel Studio better with my free extensions. Open source and feedback welcome!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hey friends.

I bought this item: http://dx.com/p/bluetooth-master...
for use with atmega8, but, I tried all types configurations and nothing happens.

I did all configurations about registers of atmega8.

I tried send and use interrupt ISP for get responde of module, but nothing happens.

Anybody can help me?

Thanks.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

First off, you need a Bluetooth dongle on your PC.

Then see if you can discover / communicate with your mobile phone.

If this works ok, power up your Bluetooth Master UART Board Communication Module. Can your PC detect it?

Once your PC has established contact and allocated a COM# to it, you can get your mega8 to communicate with a terminal program.

Come back when you have got this all working.

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hey David.

I forgot of talk about this.

Yesterday I get communicate with my PC and the connection was established. But if I try send any caracter using Putty, doesn´t nothing.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You need to find the documentation for yourself. This is why God invented google.

Some units default to 9600 baud or 115200 baud. Make sure that you do the same. You can also watch the LEDs on your dongle and module to check for proper connection link.

Note that you can alter the baud rate in software. However it is a bit convoluted, and you then need to communicate at the new baudrate.

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hehehe,

Google a lot, during 2 days.
I change the baudrate of my BT Module, and change the bauderate of uC.

I´m using clock uC internal 1mhz and 9600 for baudrate, i know that this configuration have 7% of erros. I set stop bit, I set parity bit, i did all things for configurate the uC with Bt Module.

Have one thing that i saw yesterday.

When I turn on uC and after 10 seconds, if I get off pin RX of Bt Module of the uC. Start interrupt ISP.

I don´t know if you understand me.

Thanks.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Google JY-MCU and you should get several results.

Note that you can get 9600 baud @ 1MHz if you use the U2X bit. However it is far easier to just run at 8MHz if your chip has a CLKPR register.

Forget about ISP for the moment. Just get reliable comms with a Terminal program.

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Ok, thanks, i will try and come back if get some news.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hey David.

I have good news.

Yesterday I was refactor my source code, and set BAUD 9600, with 8mhz and set Fuses for internal clock 8mhz.

I set U2X, and UBRRH, UBRRL. Now it is OK.

The PC has established contact and i can get send msg for the bluetooth module. My atmega8 receive and do something with the package.

I would like say, thanks and now i can continue my project.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi All,

Recently I successfully ran bluetooth module with avr. I used HC-06 bluetooth module.

Now I am able to send and receive data from/to avr controller.

If anybody needs help then I can help step by step.