NerdKits - electronics education for a digital generation

You are not logged in. [log in]

NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.

Microcontroller Programming » Bluetooth for the scrolling LED project

August 06, 2010
by taghavi
taghavi's Avatar

Hi all- Is there an off-the-shelf Bluetooth module that fits into the breadboard which can replace the USB serial cable that comes with the Nerdkits scrolling LED kit? I've seen a number of Bluetooth modules that say they replace the serial cable. Can I use one of those? Is is as simple as that?

Thanks in advance

Sina

August 17, 2010
by sharadgupta7
sharadgupta7's Avatar

I bought myself a LM400 bluetooth module and could make it work wired up with my atmel168. It communicated nicely with bluetooth on my pc...

One thing which i could not do was to make this module respond to AT commands.. I am working on it but atleast i can exchange data between mcu and pc over bluetooth...

Is there anyone at nerdkit who can guide me to make my LM400 bluetooth module respond to the AT commands. I sent it from the program on mcu but never got the OK response. i tried sending commands from the PC using realterm but didnt get anything in return.. i am missing something very basic..

And u know what the data trnasfer over bluetooth just happened by chance.. I was trying to make AT commands by sending it from my PC and realized that its getting displayed on the LCD attached with the mcu....Anyways, it felt great to see data being sent succesfully..

August 17, 2010
by hevans
(NerdKits Staff)

hevans's Avatar

Hi sharadgupta,

It looks the module you have there is a UART bluetooth module. I'm assuming you are trying to send it data using some terminal program on your PC, but you are not getting any data back? The first thing I would check is your wiring, are you sure you have module wired up correctly to your chips UART. It is sometimes easy to mix up TX and RX. How are you sending/receiving data from a code perspective? Can you share your code so we can take a look, and perhaps a few pictures of your setup?

Humberto

August 17, 2010
by Ralphxyz
Ralphxyz's Avatar

I am not sure bluetooth knows anything in itself about the AT commands. You need a program running on your PC that is listening to the Bluetooth port in order to recognize the AT commands. Anything you want done on your PC will require a program I believe.

A Bluetooth module (in/on your PC or attached to your Nerdkit) is not a modem even if functionally they are similar.

Ralph

August 18, 2010
by taghavi
taghavi's Avatar

Hi sharadgupta7

Thanks for that. The LM400 uses 3.5 V. Did you just plug the LM400's Vcc into the Nerdkit's 5v rail or did you add a 3.5V voltage regulator to the breadboard to feed the LM400? Also, with this setup, did you manage to upload a program from your PC to the Nerdkit?

Thanks

August 18, 2010
by sharadgupta7
sharadgupta7's Avatar

Hi taghavi,

You are right. LM400requires 3.5V. I used a voltage regulator to step down 5V to 3.5V

I havent yet tried uploading program from my PC through bluetooth. will try so and let you know..

Thanks,

August 18, 2010
by sharadgupta7
sharadgupta7's Avatar

Hi Heavans,

yes, its is a UART bluetooth module and i am able to send data in both directions. Initially i asked my bluetooth on laptop to discover other bluetooth devices. It returned the bluuetooth module name (which is "SerialAdapter") and then i paired it. It got mapped as a com port on my laptop. After that i used a terminal program 'realterm' as hyperterminal isnt available on windows 7. Now using 'realterm' i am able to send/receive data with the program loaded in the atmel168 mcu. This mcu prgram is basically doing uart_read and uart_write and displaying the received data on the lcd screen.

This is all fine. But then there are AT commands to reconfigure the bluetooth settings of my LM400 module. I wrote a small mcu program to send the basic 'AT<CR>' command to which i should have received <CR,LF>OK<CR,LF> response. This is where i am not getting response..i tried sending the escape sequence '+++' as per the AT commands but none got any reply..

will send the pics as soon as i take some.. Hope i am able to express my situation to your understanding.

Thanks, Sharad

August 18, 2010
by sharadgupta7
sharadgupta7's Avatar

Hi Ralphxyz,

You are correct that bluetooth is not a modem and AT commands are primarily written for them. But bluetooth modules does support AT commands. In fact you can send sms from your laptop connected to your mobile over bluetooth using AT commands.. Does that surprise you..

Thanks, Sharad

August 18, 2010
by Ralphxyz
Ralphxyz's Avatar

Hi sharadgupta, no not surprised in fact it would make sense to treat the bluetooth module as a legacy device and support the AT commands, I just never heard of it.

Now what does surprise me is the cost of the LM400 module. It would be neat to use bluetooth to program the Nerdkit MCU but the price at Mouser for the LM400 module is scary. There are two modules the other is worse. I have googled and found one for $39.00 which could be reasonable but probable not just to experiment with but certainly is tempting.

So can you modify your Makefile to use the bluetooth to upload a program onto the MCU?

If you can use realterm to post text to the LCD the compiler should be able to use the com port to upload a program.

Now that really gets my interest, of couse using your PC as a data logger using bluetooth would be interesting also.

I believe ATmel has a MCU with built-in ZigBee I do not know if they have one with bluetooth.

So what is it you want to do with the AT commands?

Ralph

Post a Reply

Please log in to post a reply.

Did you know that LEDs (light emitting diodes) only conduct current in one direction, like normal diodes? Learn more...