My arduino cyl head temp display, almost got it ! |
|
Porsche, and the Porsche crest are registered trademarks of Dr. Ing. h.c. F. Porsche AG.
This site is not affiliated with Porsche in any way. Its only purpose is to provide an online forum for car enthusiasts. All other trademarks are property of their respective owners. |
|
My arduino cyl head temp display, almost got it ! |
underthetire |
Jun 29 2010, 08:42 PM
Post
#1
|
914 Guru Group: Members Posts: 5,062 Joined: 7-October 08 From: Brentwood Member No.: 9,623 Region Association: Northern California |
My very first Arduino micro controller program. I've never used the Arduino language before ( think it c or C+ ? ) anyways, took me a few hours. Still need to order the thermocouple conversion chips, but looks like it will work. You can see when I put my finger over the analog pins, it does change as it should. Total cost will still be less than a single channel VDO gauge, and I will be able to calibrate it for more accurate readings.
https://www.youtube.com/watch?v=9UOUeEh11eg |
underthetire |
Jun 29 2010, 10:30 PM
Post
#2
|
914 Guru Group: Members Posts: 5,062 Joined: 7-October 08 From: Brentwood Member No.: 9,623 Region Association: Northern California |
i'll put some more notes in it when I clean it up, but here it is..got a arduino and LCD shield on ebay, with shipping it was like 30 bucks total.
CODE /* The circuit: * LCD RS pin to digital pin 8 * LCD Enable pin to digital pin 9 * LCD D4 pin to digital pin 4 * LCD D5 pin to digital pin 5 * LCD D6 pin to digital pin 6 * LCD D7 pin to digital pin 7 * 10K resistor: * ends to +5V and ground * wiper to LCD VO pin (pin 3) */ // include the library code: #include <LiquidCrystal.h> void setup() { Serial.begin(19200); Serial.println("Start"); } void loop() { label:; int raw = analogRead(1); int celsius = ( 5.0 * raw * 100.0) / 1024.0; Serial.print("Celsius: "); Serial.println(celsius); int fahrenheit = (((celsius * 9) / 5) + 32); Serial.print("Fahrenheit: "); Serial.println(fahrenheit); int raw1 = analogRead(2); int celsius1 = ( 5.0 * raw1 * 100.0) / 1024.0; Serial.print("Celsius1: "); Serial.println(celsius1); int fahrenheit1 = (((celsius1 * 9) / 5) + 32); Serial.print("Fahrenheit1: "); Serial.println(fahrenheit1); int raw2 = analogRead(3); int celsius2 = ( 5.0 * raw2 * 100.0) / 1024.0; Serial.print("Celsius2: "); Serial.println(celsius2); int fahrenheit2 = (((celsius2 * 9) / 5) + 32); Serial.print("Fahrenheit2: "); Serial.println(fahrenheit2); int raw3 = analogRead(4); int celsius3 = ( 5.0 * raw2 * 100.0) / 1024.0; Serial.print("Celsius3: "); Serial.println(celsius3); int fahrenheit3 = (((celsius3 * 9) / 5) + 32); Serial.print("Fahrenheit3: "); Serial.println(fahrenheit3); int warning =13; pinMode(warning, OUTPUT); int backlightc = 10; pinMode(backlightc, OUTPUT); digitalWrite(backlightc,HIGH); delay(100); // initialize the library with the numbers of the interface pins LiquidCrystal lcd(8, 9, 4, 5, 6, 7); const int numRows = 2; const int numCols = 16; //void setup() { // set up the LCD's number of rows and columns: lcd.begin(0, 2); // Print a message to the LCD. lcd.print("Cyl. 1 temp "); lcd.setCursor(12,0); lcd.print( fahrenheit); lcd.print( "F"); lcd.setCursor(0, 1); if (fahrenheit >400) digitalWrite(warning, HIGH); if (fahrenheit >400) delay (10000); lcd.print("Cyl. 2 temp "); lcd.setCursor(12,1); lcd.print(fahrenheit1); lcd.print("F"); if (fahrenheit1 >400) digitalWrite(warning, HIGH); if (fahrenheit1 >400) delay (10000); delay (3000); lcd.setCursor(0, 0); lcd.print("Cyl. 3 temp "); lcd.setCursor(12,0); lcd.print(fahrenheit2); lcd.print("F"); if (fahrenheit2 >400) digitalWrite(warning, HIGH); if (fahrenheit2 >400) delay (10000); lcd.setCursor(0, 1); lcd.print("Cyl. 4 temp "); lcd.setCursor(12,1); lcd.print(fahrenheit3); lcd.print("F"); if (fahrenheit3 >400) digitalWrite(warning, HIGH); if (fahrenheit3 >400) delay (10000); delay(3000); if (fahrenheit <400) digitalWrite(warning, LOW); if (fahrenheit1 <400) digitalWrite(warning, LOW); if (fahrenheit2 <400) digitalWrite(warning, LOW); if (fahrenheit3 <400) digitalWrite(warning, LOW); goto label; } |
Lo-Fi Version | Time is now: 1st June 2024 - 05:34 PM |
All rights reserved 914World.com © since 2002 |
914World.com is the fastest growing online 914 community! We have it all, classifieds, events, forums, vendors, parts, autocross, racing, technical articles, events calendar, newsletter, restoration, gallery, archives, history and more for your Porsche 914 ... |