Arduino as a cheap DAQ-I/O alternative

This proposal could make the Arduino an interesting item for many more people without programming knowledge.

Very often the need arises to continuously measure some analog or digital sensors over extended periods of time, record the data on your computer, and switch something on and off. Professional data acquisition equipment capable of doing this can cost quite some money, usually too much for the poor engineering student or amateur doing stuff in his/her basement. That’s why I want to propose a sketch which converts Arduino and a computer into a cheap data logger and digital I/O board e.g. for home automation, test equipment, artsy stuff etc.
A relatively cheap commercial product is the DataQ DI-194RS Data Logger Starter Kit for $24.95:

Unfortunately it costs over 50 Euros here in Europe, and it doesn’t have any digital I/O functionality.

What I imagine is the Arduino continuously sending some sort of timestamp, the measured values of its analog inputs and the state of its digital ports to the computer every second or so, and maybe wait for commands from the computer in between so you can switch some relays or similar connected to some of the digital outputs on and off. This would be a great addition and I’m sure many people would like to own such a device for little money, without having to program all that functionality for themselves.

Apparently this can be done easily with the MAKE controller, another microcontroller board which unfortunately costs $150. It can also communicate with Processing and Ruby using OSC (Open Sound Control).
“OSC is not a computer programming language, but is rather a (slightly obscure) communications protocol that is apparently known by many multimedia-oriented musicians.”
Someone even built a LabVIEW interface for it. Very nice!

I guess it is too much to ask for anything like that.
Unfortunately my knowledge is too limited to try this myself. Has anyone already written such a sketch? Anyone willing to write one?

Here is a simple sketch I wrote that allows you to read/write any digital/analog pin. It works by sending simple commands via serial port from the computer to the Arduino board, which replies back on the serial port. Currently I use it by just typing in the commands manually, but somebody could write a program that automates this on the computer side. This could possibly be morphed into something like you are talking about. Feel free to steal the code and hack on it!

Here is a simple sketch

DId you hear that? he said “simple”! :wink:

Thanks, that’s a start. Although I have to admit I have no clue what is going on in that sketch, and this clearly shows me that this project is way over my head. :-?
I hope more people will contribute so this project will eventually succeed!

Well, if you had code that was a bit more specific on which inputs you wanted to sample it would likely be simpler. General purpose is ususally harder than specific. On the other hand, this program (that’s already written for you :wink: )may do everything you ever need…

On the opposite end of the spectrum, I threw together a program that read a three axis accelerometer module; it was about 15 lines long and took about 5 minutes to write, breadboard, and see results. Not sophisticated, but I could verify that both the accelerometer and the gravity in the lab worked.


Well, what I’d like to see in addition to the above is the functionality of the DataQ thing I mentioned earlier. A bunch of analog inputs so I can hook up all kinds of sensors, like for example variable resistors, industrial grade pressure transducers, temperature sensors, 4-20mA current loop and 0-5V devices, that kind of stuff.

The serial output could be something like this:
timestamp, analog in 0, analog in 1,… digital in 0, digital in 1, digital in 2, …digital out 0, digital out 1, digital out 2…

I have the feeling that this is what eighthave is already doing with his Puredata/Firmata project.
Am I right?

If you don’t want to have to have a computer tied down to record all this the new viniculum chip from ftdi looks very interesting - access to usb memory sticks for arduino.



“ uses OpenSoundControl messages to address hardware”
“your Arduino board is now a PC-controlled sensor data acquisition interface.”

access to usb memory sticks for arduino.
Very nice! Now I only need to find someone who is willing to do all this work for me. :wink: