How to interface sensors with DBMS?

Discussion in 'Computing and Networks' started by thingmaker3, Mar 21, 2008.

  1. thingmaker3

    Thread Starter Retired Moderator

    May 16, 2005
    I would like to be able to interface various sensors (via ADC and some sort of bus) with a database program.

    What topics must I begin studying to accomplish such a thing? I can handle the sensors and the ADCs, but I'm lost beyond that point.

    Can anyone recommend some good books or websites? Or at least some valid search terms for Google?

  2. n9352527

    AAC Fanatic!

    Oct 14, 2005
    One way to do it is to write a program to receive the data from the sensor system, could be through serial, USB or ethernet port. The program, then, processes and writes the received data to the database. If you have any idea which database and OS you want to use, then you could find the generic driver for that particular database. For example, OLEDB drivers for MS Access or SQL Server (the Express Edition is free) on Windows or MSSQL on Windows or Linux.

    You have to decide on the language and tools to develop the program and the target OS you want the program runs on. For Windows, you could try VS C++ or C#, which you could download from MS (Express versions).

    Development tool, like Visual Studio, has great wizards and examples that could show you extensively on how to connect, write data and access the data back on various DB system through .NET DB Provider (OLEDB, ODBC, native, etc.). It is very easy to use.

    Further, you would need a little knowledge on SQL language, which you could read from the Help files included in the VS or the MSDN online.
  3. mrmeval

    AAC Fanatic!

    Jun 30, 2006
    Look at it uses the atmega168 that has digital and analog I/O, the analog is 10 bits on the ADC side. The IDE (integrated development environment) is very friendly, free and community developed. Programs for the arduino are wide and varied

    Processing can receive data serially and store it flat file pretty easily. Then you can take that flat file and feed it into any database with an import. You can use anything that can send data to a PC, it does NOT have to be a microcontroller. It can do much more than just record. Processing can act on the data received and do anything a PC can do.

    The Arduino programming language is a subset of this. There is also an IO board that is coupled with it that is more expensive but has more features. It's about three times the cost of the arduino. I don't see this as friendly as the Arduino for a new user.
  4. thingmaker3

    Thread Starter Retired Moderator

    May 16, 2005
    Thank you both! Now I at least know were my "starting line" is.:)

    This is exactly what I have in mind. A good friend of mine is saavy with database and other applicatoins (makes his living doing big money tricks with them). He suggested monitoring the property with a computer - greenhouse conditions, level of feed in the feed bins, et al. Based on what he's told me, we should be able to automate a good portion of the "farm" and receive morning e-mail reminders when it is time to buy more feed or change the mulch.

    He has the software saavy, I can rig a sensor to conditioner for ADC input - we just didn't know where to take it from there.

    I'll begin reading & studying. No doubt I'll have more specific questions as time goes on.
  5. beenthere

    Retired Moderator

    Apr 20, 2004
    Don't forget to convert the ADC data to engineering units before sticking it the DB. Doing a compare with historical data can alert you to possible problems/failures so the system can issue alerts for attention. Error trapping is good to think about, like strangely turning on the greenhouse heater when the ambient temp is 26 C.

    If you want to host a popular web site, monitor and post local weather data. We instrumented an experimental plot and put the weather up on a site. We always had better than 200K hits/month.