Planning a DIY Data Acquisition/Engine Controller

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

Previous topic - Next topic

dubbleUJay

Hi guys (Ade)
If you need any info ,just let me know, I'll still post as much as I can, its just that my mind is somewhere else so I'm not going forward or have time with this as much as I'd like too right now.

Ade, ask away, I'm getting notified if someone post on this thread and I will come back to you.

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

AdeV

Well, I got my Arduino today - a day later than I'd hoped - and all I can say is, wow... Am I ever impressed by this little beastie.

Not only did it work right out of the box, but - with the exception of a bit of string manipulation - it's dead easy to program! And I'm no C programmer either...

So, I started playing around with it at about 2pm, after spending an hour downloaded the programming interface - someone in Italy hasn't heard of broadband... By 2:10 I had it driving a servo; by 2:20 it was reading the temperature (in degrees C) to the PC; 2:30 I had it driving an 8-LED counter; 2.40 saw the merger of the LED counter & temp gauge to make a primitive thermometer. Then the day job got in the way for a while; but, by 8pm, I'd built & written the code for a complete keypad-driven combination lock security system, with doorbell function. This machine makes it SERIOUSLY easy to be productive!

In fact, the only major limitation, it seems to me, is the number of digital in/outs & analogue ins. To some extent, this can be mitigated (multiplexers exist for analogue & digital; although I guess to multiplex a PWM pin would require some clever circuitry), or or one could buy the more expensive ArduinoMEGA, which has more of all pin types. As an indication, my security system needs 8 digital pins for the keypad, 1 for the "ready" LED, one for "error", 1 for "lock active/buzzer"; and a PWM pin to drive the lock servo. Adding a second keypad, for example, wouldn't be possible without some (lots of) extra circuitry & cleverness.

So, happy bunny alert :) I will now design my "killer app" engine control unit, I think  ;D

Cheers!
Ade.
--------------
Lister CS 6/1 with ST5
Lister JP4 looking for a purpose...
Looking for a Changfa in my life...

dubbleUJay

AdeV, I'm so glad you've seen the "light" ;)
Just a thought on the Keypad you described: In the security industry, most keypads are addressable and with the bare-bone Ardiuno's being so cheap, you could have a slave BB Arduino for each keypad and connect them together with an I2C bus to a Master.
Just a thought as I said, more to show the flexibility of the Arduino and a bit inline with what this project is trying to achieve.
dubbleUJay
dubbleUJay
Lister  - AK - CS6/1 - D - G1 - LR1 -
http://tinyurl.com/My-Listers

AdeV

Quote from: dubbleUJay on January 28, 2010, 07:00:12 PM
AdeV, I'm so glad you've seen the "light" ;)

The "embedded" bulb came on here some years back (before I'd even heard of Lister's slow speed diesels) - but at the time I was planning on scratch-building either a ZX80 or MC68008 based system, which would be programmed in assembler, and would bear more resemblence to a "real" computer than an embedded one...

That idea is on hold, probably permanently - unless I find something which needs raw pace which a compiled C based program can't give me.

Quote
Just a thought on the Keypad you described: In the security industry, most keypads are addressable and with the bare-bone Ardiuno's being so cheap, you could have a slave BB Arduino for each keypad and connect them together with an I2C bus to a Master.
Just a thought as I said, more to show the flexibility of the Arduino and a bit inline with what this project is trying to achieve.

It's certainly an interesting thought. I'm not sure how much external circuitry the Arduino's processor needs to operate, I think you could do away with a lot of what's on the actual board; once you're past the prototyping stage and into dedicated PCBs, I reckon the unit cost will fall even further.

Just a thought, what distance will an I2C bus reliably transmit over? I frequently see it described as "short range"; are we talking inches, feet or yards here? (Bruce, that might be one for you....)
Cheers!
Ade.
--------------
Lister CS 6/1 with ST5
Lister JP4 looking for a purpose...
Looking for a Changfa in my life...

dubbleUJay

It's a bit early in the morning here Ade and I wasn't thinking that far about the distance, its just a meter or three :(
The opto232 bus described elsewhere in this thread by Bruce would work much further, maybe 30m plus.
The BB Arduino has very few external components and going this way would leave you with a few I/O to use at the keypad as well, that can be controlled from the Master.
dubbleUJay
Lister  - AK - CS6/1 - D - G1 - LR1 -
http://tinyurl.com/My-Listers

BruceM

#200
Ade, The vendors say 9-12 meters is the max for I2C.  I have a hard time believing that for fast devices.  I suspect you would have to use the active terminator chips for that.

http://www.esacademy.com/en/library/technical-articles-and-documents/miscellaneous/i2c-bus/general-introduction/i2c-bus-hardware.html

Most chips have hardware asynchronous serial available, so 19.2K baud and higher is often practical.  A current loop link, or an optically isolated current loop will do 1000 feet or more, though the data rate will be reduced somewhat at longer distances.

You can also get bare AVR chips with the Arduino bootloader;  picking a 40 pin chip would give you the I/O you need without farting around.  The little boards are nice for starting and experiments, but I find that when it's time to get serious about getting a job done, you end up needing your own board for interface circuitry and connectors anyway.

While I'm a PIC fan myself (Picaxe particularly), the Sanguino is the Arduino that seems most useful to me.  http://sanguino.cc/start   I'd just get the bare preloaded with bootloader chip.  They do require an external oscillator, which the PIC/Picaxe chips don't.  

Here's the basic 40 pin chip with not much else:
http://www.wulfden.org/TheShoppe/freeduino/rbfk.shtml


AdeV

Just as a little update to this....

I bought myself a couple of Boarduino clones (only £11, half the price of a genuine Duemilawhatsit) - self assembly, but then that's half the fun.

I've also just purchased a K-type thermocouple (good to 1100oC) and a MAX6675 chip. The MAX is expensive, as WJ mentions earlier in this thread; however, it's possible to get them to the UK for about £10 each delivered, less if you can buy in bulk. Not ideal, but they do make interfacing with the Arduino totally child's play.

As for cheaper ways...? Consider:

- You have to amplify the thermocouple signal to get a meaningful value for the A-D converter
- To give a 0-5v range over, say, 0-1100oC, you need to run the amplifier at maybe 9v. So more complex electrically
- As soon as you've got 9v on the board, you need to protect the Arduino from it, not to mention having to supply it in the first place
- You need (ideally) to supply an ice reference. Failing that, you need a known temp reference and another thermocouple junction at the same temperature, to calibrate the "hot" junction

In short.... £10 for a MAX6675 starts to look like quite good value; and even more so if you can get them cheaper than that. Bear in mind also that a high-temperature thermocouple probe is going to set you back a few quid too.... I just paid a shade over £16 for a single 1100oC probe with 1m lead.
Cheers!
Ade.
--------------
Lister CS 6/1 with ST5
Lister JP4 looking for a purpose...
Looking for a Changfa in my life...

ndavid79

So, whats the verdict on the Open Energy Monitor? Is the burden resistor + voltage divider + filter way of connecting CTs & an AC transformer to Arduino inputs safe / durable?

Much appreciated!
David

carbon-rod

I have been looking at developing my own automated engine controller using an AVR, AdeV I have not read the entire thread yet but is the thermocouple for exhaust temperature? if you were just looking to measure temperatures up to 150degrees Celcius then a solid state temperature sensor would be your best bet. The LM35 temp sensor outputs a linear voltage range of 10mV per degree so at 150degrees you get 1.5 output which you can amplify if necessary but probably not required before you put it into your arduino.

Ndavid79, I also have been looking at building my own power meter however it just turned out to be too much stuffing around trying to isolate the electronic parts from the mains voltage, it can be done but just with more components than I would like... it can definitely be done other ways rather easily without isolation but I don't want to get ahead of myself with my project, I want to get the basics running like temperature shutdowns and RPM control.

I will start reading through the thread now!


carbon-rod

after reading a good chunk of the thread, you were obviously talking about thermocouples for exhaust not normal temps!

I was just browsing some chips and I found something that could help! its a lot cheaper than the MAX6675 as well.

check out the AD597

there is a link do the datasheet here docs-asia.electrocomponents.com/webdocs/0be6/0900766b80be663b.pdf

it's only 6 bucks from rs-components and 10 bucks from element14

They can be programmed to output a direct voltage relating to temperature and work on type J and K thermocouples.


AdeV

Quote from: carbon-rod on January 04, 2012, 03:58:07 PM
after reading a good chunk of the thread, you were obviously talking about thermocouples for exhaust not normal temps!

I was just browsing some chips and I found something that could help! its a lot cheaper than the MAX6675 as well.

check out the AD597

there is a link do the datasheet here docs-asia.electrocomponents.com/webdocs/0be6/0900766b80be663b.pdf

it's only 6 bucks from rs-components and 10 bucks from element14

They can be programmed to output a direct voltage relating to temperature and work on type J and K thermocouples.



Interesting stuff, thanks for the link. Here in the UK, Farnell do the SOIC package for a fiver, about half the price of the MAX chip. However, there are a couple of issues; it looks like you need quite a fancy power supply to get the full temp range (the data sheet has Vs between -5v and +15v - neither of those is Arduino-friendly. IMHO by the time you've sorted out the power requirements, it'd have been cheaper to buy the MAX chip... of course, that does rather depend on how many thermocouple sensors you're using. I suppose if you end up with a dozen measurement points, the AD597 with it's voltage requirements might end up the cheaper option; but I intend to only have 2 measurement points - right at the head, and just after the heat exchanger - the two temps should give me some idea of how much heat I've captured (have to take losses into account, of course).

Unfortunately, my Lister activities have been somewhat on the back burner of late, due to various reasons. However, it's definitely something I want to get back onto, mainly because it's a lot of fun!

BTW, if you do find an easy way of using the AD597, especially if you find you can reliably use it on a 0v-5v supply, then I for one will be all over it...
Cheers!
Ade.
--------------
Lister CS 6/1 with ST5
Lister JP4 looking for a purpose...
Looking for a Changfa in my life...

carbon-rod

#206
hmm ok then damm sorry I didn't look too closely at the datasheet, I will have a look and see what I can find!  EGT's should only get up around the 500c range correct?

edit:

ooh lala

I read this in the text


SINGLE AND DUAL SUPPLY CONNECTIONS
In the single supply configuration as used in the setpoint controller of Figure 2, any convenient voltage from +5 V to +36 V
may be used, with self-heating errors being minimized at lower
supply levels. In this configuration, the –VS connection at Pin 5
is tied to ground. Temperatures below zero can be accommodated in the single supply setpoint mode, but not in the single
supply temperature measuring mode (Figure 1 reconnected for
single supply). Temperatures below zero can only be indicated
by a negative output voltage, which is impossible in the single
supply mode

Looks like you only really need the negative supply for lower than 0 temperatures... not a problem for me, plus you don't really need to worry about EGT's below that temp when its running! if you do then you have a problem heh

AdeV

Quote from: carbon-rod on December 27, 2011, 12:11:35 AM

The LM35 temp sensor


I've used the LM35 a few times now... I'd planned to stick a bunch of them on my hot water tank, to measure the temperature at various levels (I even bought some thermal glue). In the meantime, I made myself a fancy thermometer, 3 LM35s, one outside, one in the "server room" of my cabin, and one in the office side. The external sensor died very rapidly (probably damp), but the server room sensor also died quite early on. I also had problems with the sensors I had on the water inlet & outlet pipes of the Lister when I was trying to determine how much heat I was putting into my water tank - in short, I think the LM35 is a particularly fragile chip... Unfortunately, I've yet to find anything better - not that I've been looking so hard recently.
Cheers!
Ade.
--------------
Lister CS 6/1 with ST5
Lister JP4 looking for a purpose...
Looking for a Changfa in my life...

AdeV

Quote from: carbon-rod on January 04, 2012, 04:28:32 PM
hmm ok then damm sorry I didn't look too closely at the datasheet, I will have a look and see what I can find!  EGT's should only get up around the 500c range correct?

edit:

ooh lala

I read this in the text


SINGLE AND DUAL SUPPLY CONNECTIONS
In the single supply configuration as used in the setpoint controller of Figure 2, any convenient voltage from +5 V to +36 V
may be used, with self-heating errors being minimized at lower
supply levels. In this configuration, the –VS connection at Pin 5
is tied to ground. Temperatures below zero can be accommodated in the single supply setpoint mode, but not in the single
supply temperature measuring mode (Figure 1 reconnected for
single supply). Temperatures below zero can only be indicated
by a negative output voltage, which is impossible in the single
supply mode

Looks like you only really need the negative supply for lower than 0 temperatures... not a problem for me, plus you don't really need to worry about EGT's below that temp when its running! if you do then you have a problem heh

I must admit, I didn't read much of the text (hey, it's late here...), I'll give it a proper look tomorrow(ish). You're obviously right that a negative EGT would indicate some very weird stuff going on. As for max temp, I can't remember what the highest I saw was, but it does increase sharply when the engine is under a heavy load. I may have documented my max temps either here or in another thread, but - as many were at pains to point out - it was hardly a scientific test & errors may abound...
Cheers!
Ade.
--------------
Lister CS 6/1 with ST5
Lister JP4 looking for a purpose...
Looking for a Changfa in my life...

carbon-rod

I have only had a quick flick over it as I am at work but it looks promising,

I think I read on another site or here that a diesel engine shouldnt go over 400 or 500 or something... so it sounds like it should work nicely.

It would probably only be used to detect maximum safe loading any way, but you can usually tell that from the amount of smoke coming out of it :)