Post by rythmnbls on Sept 14, 2015 20:26:39 GMT -5
I've been meaning to post this for a while and I've been a bit slack in getting it all together.
Basically its a arduino cpu, a 20x4 LCD module, and a compensated thermocouple controller. It also has a glowplug driver, but most here probably have little use for it.
Schematics...
Arduino board...
Rpm Sensor board...
code for the arduino chip
The MAX6675 thermocouple board has been discontinued but this module is a replacement. www.adafruit.com/products/269
The LCD module can be sourced from amazon or any number of electronics suppliers www.amazon.com/HD44780-20x4-White-Text-Background/dp/B005YTAHAU
The hall effect sensor has range of about 5 cm and can "see" through a typical aluminium inlet with a wall thickness of 3-4 mm.
There's no copyright on the code or schematics, feel free to use / modify to suit your needs.
Regards,
Steve.
Basically its a arduino cpu, a 20x4 LCD module, and a compensated thermocouple controller. It also has a glowplug driver, but most here probably have little use for it.
Schematics...
Arduino board...
Rpm Sensor board...
code for the arduino chip
//--------------------------------------------------------------
//
// Interrupt driven sketch to measure RPM and Temps
// it expects a suitable signal on pin digital 2 / external int0
// Display is via LCD.
//
//--------------------------------------------------------------
#include <LiquidCrystal.h>
#include <max6675.h>
#include <Wire.h>
int thermoDO = 3;
int thermoCS = 4;
int thermoCLK = 7;
MAX6675 thermocouple(thermoCLK, thermoCS, thermoDO);
LiquidCrystal lcd(13, 12, 11, 10, 9, 8);
uint8_t degree[8] = {140,146,146,140,128,128,128,128};
int pwmPin5 = 5; // 976hz signal on pin 5, connected to a mosfet to drive a glowplug.
int dutycycle = 80; // 25 = 10% duty cycle
volatile word rpmcount;
unsigned long rpm;
unsigned long timeold;
void setup()
{
pinMode(pwmPin5, OUTPUT);
analogWrite(pwmPin5, dutycycle); //turn on the glowplug output.
lcd.begin(20,4); // Setup the LCD, use 16,2 for a 16x2 LCD, etc.
lcd.clear(); // start with a blank screen
lcd.createChar(0, degree);
attachInterrupt(0, rpm_fun, RISING); //enable int0
rpmcount = 0;
rpm = 0;
timeold = 0;
delay(500);
}
void loop()
{
lcd.setCursor(0,0);
lcd.print("RPM: ");
lcd.setCursor(0, 2);
lcd.print("EGT:");
lcd.setCursor(5,2);
lcd.print(thermocouple.readCelsius());
lcd.write((byte)0);
lcd.print("C ");
if (rpmcount >= 100)
{
//Update RPM every 100 counts, increase this for better RPM resolution,
//decrease for faster update
rpm = 1000000*60/(micros() - timeold)*rpmcount;
//rpm = (micros() - timeold);
timeold = micros();
rpmcount = 0;
lcd.setCursor(5,0);
lcd.print(" ");
lcd.setCursor(5,0);
lcd.print(rpm);
}
delay (500); // the max6675 chip doesn't like being read too fast so we delay here.
}
void rpm_fun()
{
rpmcount++;
//Each rotation, this interrupt function is run
}
//-----------------------------------------------
The MAX6675 thermocouple board has been discontinued but this module is a replacement. www.adafruit.com/products/269
The LCD module can be sourced from amazon or any number of electronics suppliers www.amazon.com/HD44780-20x4-White-Text-Background/dp/B005YTAHAU
The hall effect sensor has range of about 5 cm and can "see" through a typical aluminium inlet with a wall thickness of 3-4 mm.
There's no copyright on the code or schematics, feel free to use / modify to suit your needs.
Regards,
Steve.