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 30 2010, 07:57 PM
Post
#2
|
914 Guru Group: Members Posts: 5,062 Joined: 7-October 08 From: Brentwood Member No.: 9,623 Region Association: Northern California |
Ok, got rid of the goto, your right didn't need it. Added some notes as well. Any more suggestions would be welcome (IMG:style_emoticons/default/biggrin.gif)
CODE /* The circuit: * Thermocouple amp [url=http://store.makerbot.com/electronics/electronics-kits/thermocouple-sensor-v1-0-kit.html]http://store.makerbot.com/electronics/elec...r-v1-0-kit.html[/url] * LCD keypad shield [url=http://www.robotshop.ca/dfrobot-lcd-keypad-shield-arduino.html]http://www.robotshop.ca/dfrobot-lcd-keypad...ld-arduino.html[/url] (found on ebay 7.99) * using LCD keypad shield * 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 * wiper to LCD VO pin (pin 3) *thermocouple amp to analog pin1 (cyl1) *thermocouple amp to analog pin2 (cyl2) *thermocouple amp to analog pin3 (cyl3) *thermocouple amp to analog pin4 (cyl4) *warning to digital pin 13, also led on arduino */ // include the library code: #include <LiquidCrystal.h> void setup() { Serial.begin(19200); Serial.println("Start"); } void loop() { 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); // 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; // set up the LCD's number of rows and columns: if (fahrenheit <400) digitalWrite(warning, LOW); if (fahrenheit1 <400) digitalWrite(warning, LOW); if (fahrenheit2 <400) digitalWrite(warning, LOW); if (fahrenheit3 <400) digitalWrite(warning, LOW); 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); } |
Lo-Fi Version | Time is now: 18th May 2024 - 10:00 AM |
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 ... |