Bluetooth communication with MS Access

I have an Arduino BT (Bluetooth) and a DS18B20 one wire thermometer. I have the Arduino and thermometer working and communicating with the Arduino programming environment thanks to Jim Studt's library and code.

I would like to use Microsoft Access (or Excel) with the system. Is it possible for Access to read the temperature and store it in a database table as it is transmitted by the Arduino BT and received through a Bluetooth dongle. The Bluetooth dongle is plugged into a USB port and shows up as a serial comm port. I would also like to be able to have MS Access be able to examine each temperature transmission and act if appropriate. In other words, the system would work like a thermostat. Is it possible for Access (or Excel) to do this? If so, how?

Thanks,

David

Forget about that. Using Microsoft products like that is a very bad idea.

Access is a database. Excel is a spreadsheet.
What your trying to do is (ab)use them in to doing something they most certainly not designed for.

Download a copy of Visual Basic 6 and use it.
If you want the data in Excel then make the VB program dump the values in to a file in CSV format.
So much simpler.

Hi Cheater,

Thank you for your reply. I have Visual Basic 6.0 now. How do I use it to capture the temperature data that is coming in through the Bluetooth dongle?

Even if I use VB to receive the data, wouldn't Access be an appropriate place to store data? If not, what would you use?

Thanks,

David

Even if I use VB to receive the data, wouldn't Access be an appropriate place to store data? If not, what would you use?

Depends how lazy I was. :wink:
A CSV file is easy to use and most programs can read it.
Access is useful for more complicated db designs.

Search for a serial example in VB. pscode.com should help.

I'd almost setup two applications -- one to record the data -- the other to act on the data once recorded. Your VB app could dump the data to CSV -- and you could have another app (like Cacti, BigBrother, etc etc) do some action with the data.

Check aout this site:

http://www.selmaware.com/selmaDAQ/home.htm

It's a 19 $ shareware plugin for Excel tah will allow you to read data from Arduino (serial port) and dump them in to Excel.

I started this thread want to report back on a solution I found. Several of you suggested that there may be better solutions and I don't disagree. However, if anyone is looking for a solution to the original issue for this thread then I now have something that works.

The setup I have is a Dallas 1 wire semiconductor thermometer connected to an Arduino BT (blue tooth). On the computer I have a Blue tooth dongle. For software I have Microsoft Access. The 1 wire thermometer measures the temperature. The Arduino transmits the temperature via Blue tooth. On the computer the Bluetooth dongle receives the transmission. The computer sees the dongle as a comm port. MS Access monitors the comm port. When a temperature is received, Access saves the temperature and the date/time in a table.

The key was the MSComm control (MSCOMM32.OCX). This control is included with Microsoft Visual Basic 6.0. It is also available for download if you have Access and not VB. The MSComm control is an ActiveX control and it can be added to a form in the same way as a text box or a command button.

Initially I got an application working in Visual Basic and then I tried it in Microsoft Access and it worked there as well.

There is a licensing issue with the MSComm control. If you have Visual Basic this is not a problem since the control comes with VB. And if you have VB the license allows the control to work in Access. If you have Access and don't have VB then you may have to address the licensing issue. I found an article that suggests that it is possible to make it work without VB although I didn't try it.

Two key articles are:

INFO: Receiving Data Using the MSComm Control's OnComm Event
http://support.microsoft.com/kb/194922.
This is Microsoft knowledge base article 194922. I used the code for App2 in my application. It worked almost without modification. I only had to change the comm port number and maybe a couple of other minor things.

The second article is:
MSCOMM32.OCX MSComm Control
http://www.yes-tele.com/mscomm.html
Among other things this article talks about the licensing issue which could be of interest if you don't have Visual Basic.