| Arduino Forum ::  Members :: binooetomo
 Show Posts Pages: 1 2 [3] 4 5
 31 Using Arduino / Project Guidance / Re: PinChangeInt : Monitoring Marine engine on: May 07, 2012, 07:56:49 pm Dear DuaneBQuote from: DuaneB on May 07, 2012, 11:23:37 amguys why wouldn't you use a counter ic as a prescaler on the 6000 pulses per second ?Could you please give me the part name ?Sincerely-bino-
 32 Using Arduino / Project Guidance / Re: PinChangeInt : Monitoring Marine engine on: May 07, 2012, 03:29:04 am Dear Nick Gammon.Quote from: Nick Gammon on May 07, 2012, 02:40:59 amSo you would prefer to work with 4925 volts than just have a timer count pulses?I knew that arduino analog will unable to handle that level of voltageWell ... actualy after some correction on that ''with 132 tooth wheel, it can reach 154.985074626866 V at 4720 RPM Using Voltage devider before entering Analog Pinusing R1=300 Ohm , and R2=10 OhmandVout = (R1/(R1+R2)*VinThe Vout at 4720 RPM will be 4.99951853635051 Volt ... It is compatible with Analog PINThe problem will : How much is the real max RPM of the engineSincerely-bino-
 33 Using Arduino / Project Guidance / Re: PinChangeInt : Monitoring Marine engine on: May 07, 2012, 02:21:15 am Dear Nick Gammon.My apologize, my brain is not good enough to understand your code.Thats why I look for a dumb work around.I got additional info about target engineThe engine have 132 tooth flywheel, and max RPM is 2500and I will use this to convert from Frequency to Voltagewith Magnetic Pickup like above, I thing I can use (cmiiw) the math of :Freq = Gear x Rpmmeans that the max Freq will be : 132 x 2500 = 330,000 Hzand the max Voltage will be 4925.373134328 V.Using Voltage devider of factor 0.001 at the Vout point, I'll got max volt of 4.925373 V where the arduino analog pin can handle.And I thing the max analogread value returnd will be (4.925373/5)*1023 => 1007.7313That is the max value that will be reported to PC.Thats what I can thing it so far.Sincerely-bino-
 34 Using Arduino / Project Guidance / Re: PinChangeInt : Monitoring Marine engine on: May 07, 2012, 12:22:31 am Dear Nick Gamon and El_supremo.I realy appreciate your enlightment.Hmmm ... second thought ....What About this :1. Use PinChange For that 4 Flow meter (Low pulse per minute), and2. Use Frequency-to-voltage IC and feed the output to Analog pin to read the current engine RPMSomething that noted at http://www.jaycar.com.au/images_uploaded/LM2907.PDF page 7 (Minimum Component Tachometer) , Plus a voltage devider .About periodic Serial.println .... could be done.Maybe once per second ?Sincerely-bino-
 35 Using Arduino / Project Guidance / Re: PinChangeInt : Monitoring Marine engine on: May 06, 2012, 10:44:07 pm Dear Nick GammonI really really appreciate your enlightmentQuote from: Nick Gammon on May 06, 2012, 10:24:44 pm Why not use the external interrupts, rather than the pin change interrupts?Since there is only 2 external interupts on arduino, while I need to handle 6 pulse sourceQuote from: Nick Gammon on May 06, 2012, 10:24:44 pmWhat is the objective here? To work out the engine speed?You can use timers to count events like that, which will be very efficient and accurate. I have some examples here:http://www.gammon.com.au/forum/?id=11504Really good examples, but I try to off-load the Math/Counting from arduino to a PC. Thats why I just use the arduino as 'pulse to ASCII' translatorSincerely-bino-
 36 Using Arduino / Project Guidance / PinChangeInt : Monitoring Marine engine on: May 06, 2012, 10:02:40 pm 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 :1. The flywheel is +/- : 200 Tooth2. Max RPM : 1800 RPMSo 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) :1. 4x Interupt , each at 67 Interupt per second2. 2x Interupt , each at 6000 interupt per secondI'm planing to use PinChangeInt library to receive pulse, something like this :Code:/*Adopted from :http://arduino.cc/playground/Main/PinChangeIntExample?action=sourceblock&num=1*/#include #include #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 Bvoid 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 : 1. Is there any processing time enough for that interupts ?2. 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-