Planning a DIY Data Acquisition/Engine Controller

Started by dubbleUJay, October 21, 2009, 09:09:03 AM

Previous topic - Next topic

dubbleUJay

AMENDMENT(11-Nov-2009):
To stop confusion for new readers of this thread, this project is panning out to be more of a
Data Acquisition / Engine Monitor / Emergency Shutdown Unit
for now anyway!
(End of amendment to post)

Guys I've been pondering about a DIY Data Acquisition and/or Auto Engine Controller for stationary engines for a long time.
After replying to a post elsewhere in this forum, I decided that its about time I do something about it and see if its possible to do it in a moderately easy way.

What I want to accomplish is a DIY "open source" Data Logging Unit to a PC and in the future I should be able to convert it to an Auto Engine Controller (with Logging in tact) by just changing the programming and minimal interface circuitry. I want to use regularly available building blocks for the system, ie. experimental boards & stuff that are normally well priced and there are a big following and code for them available from other peoples projects.

Just for reference I copied a section of my other post to here:
This guy from the link below has done a lot of work on the subject with an electronic controller, but its quite involved and a lot of people (most) would not be able to do it, but if you read his pages, you get the general idea:
http://martin.nile.googlepages.com/automaticgeneratorcontroller

Here is just a commercial auto engine controller:
http://www.fwmurphy.co.uk/products/engine_controls/engmot_asm150.htm
but its functions would be limited.

This product should do the job with a few censoring devices attached:
http://arduino.cc/en/Main/ArduinoBoardDuemilanove


I've done a bit of digging around on this Experimental USB Micro-controller and found the following:
They are available almost all over the world and cost effective,
There's a huge following of people using these on forums and such,
The programming software is Windows based & free,
Existing programming code can be copy/paste/stitched & loaded directly through USB port,
to name a few.
Here is a answer snipped from an email I wrote to a guy that supposedly knows:
"...these things can do pretty much anything. Don't worry about the code – there is so much available online you literally copy it and paste it into the arduino software, compile it and dump it via USB. The online community is SO helpful as well, there are arduino IRC  channels we can recommend spending some time on too.
A good thing to do is go onto youtube and type exactly what you want – for example "arduino temperature monitor" etc, and most guys who post videos of projects also post links to code. Wherever you have a sensor, you can log data to wherever you want, even to the extent of being sms'd system failures etc.
From a flexibility and expandability point of view, the duemilanove is ideal for what you want. Like I said though, spend some time in forums, IRC channels, youtube and the Arduino site."


So, I ordered one and also 4x Temp. sensors. 1stly I want to see if I can hook it up to the 4 sensors and get it to log some temperatures of my WVO heating system to PC.

From what I understand it should go something like this:
Install the software,
Cut & Past existing code for a temperature sensor I found on the net into it,(its a little bit more involved than this, must duplicate it 4x, but you get the idea)
Connect my temp sensors to the Board,
Plug it into the USB port,
Compile and program the PIC.
and that should more or less be it, I should then be able to log 4x temperatures to my PC, all for +/- $53 including the temp sensors!
The main thing is that the project is only as good as the coding of the PIC and as nice as the User Interface on the PC.

What I need to know is what type of signals do we want to monitor on a gen-set?
Analog:
Temperatures ie. Water, WVO fuel in & out and maybe Exhaust if one can get a sensor for it.
Oil pressure for the Changfa guys  ;)
AC Volts
AC Amps

Digital:(On/Off)
Low oil pressure
Low Fuel

Outputs:
Emergency shutdown

I'll worry about controlling a throttle later  ;)
Anymore you guys can think of that I'm missing? I can then look around for code for these and also see how they may be interfaced with the board.
Obviously there are only so many I/O to use and I'll probably will have to prioritize.

This description is probably over simplistic and there's probably much more involved, but I have to start somewhere!

Any input is appreciated, thanks.

dubbleUJay




dubbleUJay
Lister  - AK - CS6/1 - D - G1 - LR1 -
http://tinyurl.com/My-Listers

dubbleUJay

#1
Quote from: Jens on October 21, 2009, 09:15:59 AM
RPM :)

BTW, $53 including 4 temp probes is exceptional !

Jens

The most important one!!! What was I thinking about ???, thanks Jens  :-[

BTW, if I look at the pricing of same product from Sparkfun in America:(Just taking a common supplier)
1x Arduino USB Board $49-95
4x LM35 (degC) no stock, but should be about $2-00 @ most.
Don't know about postage over there though and there are probably cheaper suppliers.

The cheapest 4ch data logger I could find for $74
http://www.electronics123.com/s.nl/it.A/id.2693/.f
and that is ALL it can do!

dubbleUJay
dubbleUJay
Lister  - AK - CS6/1 - D - G1 - LR1 -
http://tinyurl.com/My-Listers

rl71459

Wow!

I really like what I am hearing so far!  Is there really so much available code that we could actually do
as you suggest? That would be great! Please keep posting... I am very interested!

Rob

dubbleUJay

#3
Quote from: rl71459 on October 21, 2009, 09:52:29 AM
Is there really so much available code that we could actually do
as you suggest?
Rob

Hi Rob, I found a few projects with code for temp. sensor and such, I need to "stitch" them together and get it to work.
I'm only starting out now (I haven't even got all the hardware yet), but I tent to learn quite fast   ::) if I get the "flow" of things.
I've done a bit of coding a VERY long time ago, when ADT were still using EPROM's for there security alarm systems! Long before PIC's & stuff, but I should get the hang of it.
Obviously the user interface will be crappy in the beginning, but I'm hoping that if I can proof that it works, someone who knows what he's doing might offer to code a nice UI for Windows! ;)

The project should however be as easily as possible to duplicate. Hell, even the most basic "Low-cost Students Edition Data-logger" from National Instruments costs around $215 and then I need the upgraded software at $955 to do anything useful with it, that's $1170!!
http://sine.ni.com/nips/cds/view/p/lang/en/nid/14604
Are they bloody mad ??? Very nice software and all, but not worth it for the average Joe like myself that wants to log some stuff on my Gen-set, wind-generator exec.
That money can pay for my 2x kids for a years school fees over here, "students edition's" @$$!

Anyway, that's just how I see things, they can go take their family 4 a ride  ::)

dubbleUJay
dubbleUJay
Lister  - AK - CS6/1 - D - G1 - LR1 -
http://tinyurl.com/My-Listers

AdeV

Quote from: dubbleUJay on October 21, 2009, 09:33:47 PM

someone who knows what he's doing might offer to code a nice UI for Windows! ;)


I can't promise I know what I'm doing  ::) but Windows UIs are "what I do" (has been for years), so I'm sure I could cobble something together. It would have to be in VB.Net though, I ain't about to learn C++ or Delphi now...  ;D
Cheers!
Ade.
--------------
Lister CS 6/1 with ST5
Lister JP4 looking for a purpose...
Looking for a Changfa in my life...

rl71459


dubbleUJay

In the meantime if anyone cares to broaden their knowledge base.  ::)

I'm currently looking at this project to get a few tips on how to interface with the sensors for Volts, Amp, Power exec., there a lot of interesting stuff:

Snipped: "This is a project to develop and build open source energy monitoring and analysis tools for energy efficiency and distributed renewable microgeneration."

http://openenergymonitor.org/emon/

How I never Googled myself into this site I dont know!!!
Like I said before, most of the stuff was already done, its just a matter of putting it all together in one project!

AdeV, thanks, I'll definitely push on your doorbell once I'm ready to get some UI going.
The more I read about this board, the more I like it, there is even wireless (ZigBee/XBee) options available, but 1st I need to do the basics.

I'll keep u's updated on the project, I'm just waiting for more hardware to arrive on Tuesday via ZA's "snail-mail" :P Here I go again, even eBay stopped using them because of corruption and theft, don't get me wrong, I love my country, just not the people who thinks their heritage gives them the right to do these things! >:(

dubbleUJay
dubbleUJay
Lister  - AK - CS6/1 - D - G1 - LR1 -
http://tinyurl.com/My-Listers

Jedon

I'm a programmer as well ( C++, C#, Java etc ) and this is very interesting to me.
I don't have a lot of free time right now but may be able to help.
I have a board that takes analog and digital inputs and sends them via TCP/IP to a main server where the data is stored in SQL Server, then you can trigger relays off the boards based on rules you dynamically set up which can be based on combinations of the inputs and date/time. Not sure it's affordable though!

dubbleUJay

OK guys, here a bit of an update:
I received all the hardware, 1x Arduino Board+USB Cable & 4x LM35 Temp Sensors.
Cost: R515 ZAR's (+/- $64) including the postage which was $12.50, so the hardware was about $51.50.

I'm using WinXP(SP3)
I installed the software & USB drivers,
connected 2 of the 4 LM35's to Analog inputs on the board,
copy/past some code for a 1 TempSensor from the web to the main Arduino software,
figured out how to duplicate it by 4,
sent it to the board,
hit the Serial Monitor button on the software,
and to my surprise, I got my four temperatures displayed in C&F in the window!

All in about 2 hours fiddling and I've newer done this before!  ;D

The next step is to interface it with a real-time graph display program like KST (free as well)
http://kst.kde.org/download.html
At this stage I'm just following whats already been done by other people and bringing it all together.
Be sure to get the Win Binary version right at the bottom, for Windows obviously, but there's Linux and more as well.

This whole thing looks very promising.

Jedon/AdeV, most of the guys using this board seems to program applets in Java for it, which I know nothing about.

I manage to duplicate the 1 sensor code to 4TempSensors as it is so easy to understand what the code does. It's like "old" Basic to me in a sense.
Now, if YOU (or anyone else here for that matter) could perhaps get a basic board setup, imagine what we all could do!  ;)
I don't get excited easily, but I honestly don't think you would buy a cat in a bag, because I think a 4xData Logging TempSensor alone would cost an arm and a leg and from what I've seen, this thing can just about do anything! You can just as well connect a photo-diode to it and know when the sun comes up. ;D There are Stepper controller code on the net as well and many more!

Any comment or suggestions ???

Here are a few screen-shots I took from the software, the graphing software are not my data.

dubbleUJay
Lister  - AK - CS6/1 - D - G1 - LR1 -
http://tinyurl.com/My-Listers

billswan

Dubbleujay

Wow you are moving at light speed on this project, looks great.

Keep it up the forum is watching with great interest!!!!!!!!!

Billswan
16/1 Metro DI at work 900rpm and 7000watts

10/1 Omega in a state of failure

rl71459

Good Job WJ

I am looking forward to hearing about your progress. It is fantastic that it came together so quickly
even if it is only an initial attempt. I also am impressed with how little it costs!

Keep up the good work!

Thank You
Rob

dubbleUJay

I found this thread on the Arduino Forum:
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1196965541

It seems like someone started something similar two years ago, but the "thread is dead" now!
It seem a bit overkill for what I was thinking, with "stand-alone" logging exec, but you might get a few tips there anyway, if someone cares to read it.

I'm still going through it at the moment.

Jedon, I'm sort of stuck with a Java program that reads the USB/Serial port info coming from the board. It reads it and log's it to a file where the Kst graphing program can get its readings from to O/P the graphs.
I found a Java applet that does it, but it seems to run under Linux and I'm using WinXP!  :(

http://openenergymonitor.org/emon/sites/default/files/ArduinoCommTurbine.tar.gz
Snipped from the page:
"The ArduinoComm java program reads the values sent from the Arduino. The program outputs the values to the terminal window. Terminal is then used to write the printed data to a file for storage. The data file can be opened simultaneously by KST for real-time graphing"

Now this stuff I dont know how to do! YET anyway ;)

Any ideas???
dubbleUJay
dubbleUJay
Lister  - AK - CS6/1 - D - G1 - LR1 -
http://tinyurl.com/My-Listers

Jedon

Java compiles to bytecode that runs in the JVM ( Java Virtual Machine ) which is available for just about all platforms. That means that Java code is rarely platform specific and this should run fine on XP, I used 7-Zip to extract the source code so give that a whirl.

dubbleUJay

Hi Jedon, I also used 7-Zip, it extracts to a TAR 1st, then when I extract that, it tells me there's 2 files with the same name??? Program.java~

Apparently I then have to compile it, but I didn't go any further as I have the above mentioned problem!

I'm a novice & ignorant in this department, can the program not be pre-compiled and made available for download by the programmer?

dubbleUJay
dubbleUJay
Lister  - AK - CS6/1 - D - G1 - LR1 -
http://tinyurl.com/My-Listers

Jedon

Try the instructions here: http://www.arduino.cc/playground/Interfacing/Java
I wouldn't start with the code you posted, there isn't much there and it relies on external libraries which makes it hard to compile.
Start with their example and slowly tweak things, perhaps grabbing pieces of code from the project you found.