Saturday, January 17, 2009

Getting started with Arduino and BlueSMiRF Siver


Since I had to do a lot of experimenting with my brand new BlueSMiRF Silver I thought writing something for future reference.



The first thing to note is the wiring of the two devices. As you can see the pin labeled as TX of the BT module is connected to the RX pin of the Arduino. This is pretty straightforward if you say "The Arduino receives what the BlueSMiRF transmits."



The second thing I want to mention is that the one that Sparkfun ships differs in the default configuration from the information that the "data sheet" says. I could communicate with mine using 9600 baud rate.



On the GNU/Linux part I used Tony Buser's instructions on how to create a serial device (/dev/rfcomm0) that can be used easily.

First use hcitool scan to detect your BlueSMiRF, then create a config file /etc/bluetooth/rfcomm.conf containing something like this



rfcomm0 {
bind yes;
device xx:xx:xx:xx:xx:xx;
channel 1;
}


Now you will be able to say like tail -f /dev/rfcomm0 to see what is your Arduino telling.



An other cool thing is that you can use a software serial library to debug the bluetooth module. I used Ladyada's AFSoftSerial library. Connecting the BlueSMiRF to pin 3 and 4, you can use the USB to print debug info.



This setup also can be used to configure the module with the AT command set available (see the "data sheet"). I have a little Python script command.py, that can be used with the command application for configuration. You can enter the commands on your pc and read the response of the module:



>> +++
OK
>> ATI
1SPP - Vr: 1.2.5
OK
>> AT+BTLNM="something else"
OK
>> AT+BTAUT=1, 1
OK
>> AT+BFLS
OK


This set of commands will set the name of your module to something else, enable Automatic Connection Mode, that will be saved to Flash, and these settings will be saved permanently to Flash.

Saturday, December 13, 2008

Thermometer v1

Yesterday I have received the sample from Mill-Max, so I could solder the socket to the Arduino prototyping board




The SHT71 fits perfectly the socket:




Using the example code provided by the manufacturer (Sample_Code_C1.zip) and Wayne's code for the SHT15 I put together a C++ class for easy access and conversion to engineering units: myardu/lib/SHTxx.



The datasheet says that the sensor should not be used very often (not more than every 1.5 seconds), so I incorporated this into my class.

Sunday, December 7, 2008

LCD Test

After some hours of trying I've managed to make my new LCD working.
It is a LCM-S01602DSF/C, with a Samsung S6A0069 controller, that is compatible with HD44780 controllers.




The only problem is that according to the datasheet of the thermistor (SHT71) it should not be soldered. So I'm now trying to order a sample of a socket 851-93-004-20-001 from Mill-Max. I've found a place where it is $14 each, plus $15 for shipping, but I hope I will not have to order it.

Thursday, December 4, 2008

myarduino: the beginning

Today I've created a repository at github: http://github.com/petervizi/myardu/tree/master to hold my Arduino projects. My first plan is to measure the temperature in my room with a Sensorion SHT75 and display it on an LCD (LUMEX LCM-S01602DSF/C). It is not much, but I hope it will be fun. The sensor and LCD should arrive tomorrow.