Dear All ...
I'm planning on using arduino and a PC as data logger of Marine Engine (tug boat with 2 diesel engine).
The arduino will only function as 'pulse to ascii converter'.
The pulse will come from :
- 4 x Fuel Flow meter
- 2 x RPM (Magnetic Pickup)
Currently all I know is that the max fuel flow is 4L/minute , while the Flow sensor is about 1000 pulse per L.
So for single FlowMeter there will be max of 4000 pulse per minute, about 67 pulse per second.
About the magnetic pickup for RPM :
- The flywheel is +/- : 200 Tooth
- Max RPM : 1800 RPM
So the max pulse for the RPM will be around : 360000 pulse per minute , 6000 pulse per second.
So the summary, Arduino will receive (at max) :
- 4x Interupt , each at 67 Interupt per second
- 2x Interupt , each at 6000 interupt per second
I'm planing to use PinChangeInt library to receive pulse, something like this :
/*
Adopted from :
http://arduino.cc/playground/Main/PinChangeIntExample?action=sourceblock&num=1
*/
#include <PinChangeInt.h>
#include <PinChangeIntConfig.h>
#define FL_A1 14 // Will be flowmeter A1
#define FL_A2 15 // Will be flowmeter A2
#define RPM_A 16 // Will be RPM A
#define FL_B1 14 // Will be flowmeter B1
#define FL_B2 15 // Will be flowmeter B2
#define RPM_B 16 // Will be RPM B
void setup() {
Serial.begin(9600);
Serial.print("PinChangeInt test on pin 14-19");
pinMode(FL_A1, INPUT); //set the pin to input
digitalWrite(FL_A1, HIGH); //use the internal pullup resistor
PCintPort::attachInterrupt(FL_A1, cb_fla1,RISING); // attach a PinChange Interrupt
pinMode(FL_A2, INPUT); //set the pin to input
digitalWrite(FL_A2, HIGH); //use the internal pullup resistor
PCintPort::attachInterrupt(FL_A2, cb_fla2,RISING); // attach a PinChange Interrupt
pinMode(RPM_A, INPUT); //set the pin to input
digitalWrite(RPM_A, HIGH); //use the internal pullup resistor
PCintPort::attachInterrupt(RPM_A, cb_rpma,RISING); // attach a PinChange Interrupt
pinMode(FL_B1, INPUT); //set the pin to input
digitalWrite(FL_B1, HIGH); //use the internal pullup resistor
PCintPort::attachInterrupt(FL_B1, cb_fla1,RISING); // attach a PinChange Interrupt
pinMode(FL_B2, INPUT); //set the pin to input
digitalWrite(FL_B2, HIGH); //use the internal pullup resistor
PCintPort::attachInterrupt(FL_B2, cb_fla2,RISING); // attach a PinChange Interrupt
pinMode(RPM_B, INPUT); //set the pin to input
digitalWrite(RPM_B, HIGH); //use the internal pullup resistor
PCintPort::attachInterrupt(RPM_B, cb_rpmb,RISING); // attach a PinChange Interrupt
}
void loop() {
}
void cb_fla1()
{
Serial.println("A,FL,1");
}
void cb_fla2()
{
Serial.println("A,FL,2");
}
void cb_rpma()
{
Serial.println("A,RPM,0");
}
void cb_flb1()
{
Serial.println("B,FL,1");
}
void cb_flb2()
{
Serial.println("B,FL,2");
}
void cb_rpmb()
{
Serial.println("B,RPM,0");
}
My question :
- Is there any processing time enough for that interupts ?
- Will the interupts process hit/break/intervere each other ?
Note : Currently I don't have any pulse generators on my desk to simulate the task.
Sincerely
-bino-

