Introduction: Autonomous Control of RPM of Engine Using Feedback System From a IR Based Tachometer

There is always a need for automating a process,be it a simple/monstrous one.I got the idea to do this project from a simple challenge that i faced while finding methods to water/irrigate our small piece of land.The problem of no current supply lines and costly generators (to operate our pump) added to the difficulty.

So what we decided to do is device a method which would be cheap and easy to use,even by a worker.We decided to mount the pump on our old scooter(running condition) and run it using the shaft of the scooter wheel.All fine and good,we made the mechanical assembly and the belt drive and tested it,and it was a success.

But another problem was that,when the motor was running,a person always had to be near the scooter to monitor the RPM,and manually adjust it using throttle.So this project was made by us so that the worker can set the desired RPM he wants to make the engine run,and attend to other work in the farm.

The setup consists of :

  1. A IR based tachometer(to measure RPM).
  2. A keypad to enter the RPM.
  3. A LCD display to show the monitored RPM and current RPM.
  4. A Stepper motor to increase/decrease the throttle.
  5. Finally,a micro-controller to manage all these processes.

Step 1: Arranging the Required Parts

Previously,I just gave the overview of what the components would be.

The actual components required are:

  1. A micro-controller(I used an Arduino Mega 2560).
  2. A L293D motor driver IC(or a breakout board will do).
  3. A 16 X 2 LCD display.
  4. An infrared/proximity sensor (model number is STL015V1.0_IR_Sensor)
  5. A uni-polar stepper motor ( I used a 5 wire stepper motor,12 V).
  6. A 4 X 4 Keypad.
  7. Couple of 220 ohm,1000 ohm resistors.
  8. A 10k potentiometer.
  9. Connector wires,colored wires,stripper.
  10. Breadboards.
  11. A 12V battery to power the stepper motor.
  12. A 5V supply to power Arduino.

And thats all you need to get started,folks!

Step 2: Overall Flow of Process

The flow of the process is as follows:

  1. The setup is switched on and wait till calibration of all device is done.
  2. The user shall input the required RPM using Keypad.
  3. The homing of the motor takes place.This is usually done so that a constant reference point is dictated to the motor so that when the setup is switched on,the initial position of motor is always constant and taken as reference point.
  4. Switch on the engine/any machine which shall rotate a wheel.
  5. The measurement of the RPM takes place and it displays on the LCD.
  6. This is where the feedback system comes into picture.If the detected RPM is less than the desired RPM,the stepper motor steps so that it increases the throttle
  7. If the detected RPM is more than the desired RPM,the stepper motor steps so that it decreases the throttle.

  8. This process takes place until the desired RPM is reached,when reached,the stepper stays still.

  9. The user can switch off the system if required using a master switch.

Step 3: Making the Required Connections

  1. Connections for the stepper motor:

Since i am using a 5-Wire stepper motor,4 wires are for energizing the coils and the other one is connected to the ground.It is not always necessary that the order of the 4 wires coming out of the motor is the same order to energize the coils.You must manually find out the order by using a multi-meter,unless explicitly specified,or refer the datasheet of your motor.Thees 4 wires are connected the the outputs of the L293D IC,or your motor driver.

2.Connections for the L293D IC :

The reason why you will be using a motor driver is because your 12V stepper motor cant run properly on a 5V supply and you'll end up frying you arduino board to pump supply to the motor.The pin diagram of the IC can be found on the web since it is pretty much a standard switching IC. The pins and their connections are

  • EN1,EN2 : Enable(always high or '1') because it is a standard decoder and typically has an additional input called Enable. Output is only generated when the Enable input has value 1; otherwise, all outputs are 0.
  • Pin 4,5,12,13: They are connected to the ground.
  • Pin 2,7,10,15 : They are the input pins from the micro-controller.
  • Pin 3,6,11,14: They are the output pins connected to the 4 pins of the stepper motor.

3.Connections to the LCD:

The LCD has 16 pins where 8 are for data transfer and at most of the times, you can use only 4 of the 8 pins.The connections are:

  • Vss : ground
  • Vdd: + 5V
  • Vo : to potentiometer(to adjust contrast)
  • RS : to digital pin 12 of arduino
  • R/W : ground.
  • E : to pin 11 on arduino.
  • Data pins 4,5,6,7 : to pins 5,4,3,2 on arduino respectively.
  • LED+ : To +5V with 220 ohm resistor.
  • LED- : to ground.

4. Connections to the 4 X 4 Key Pad :

The connections here are pretty straightforward.There are total of 8 pins coming out of the keypad and they all directly go to the digital pins of arduino.4 are for columns are 4 are for rows.The pins on the arduino are46,48,50,52 , 38,40,42,44 .

5.Interfacing IR Sensor to arduino:

This step is also straightforward since there are only 3 pins coming out of the proximity sensor,+5V,output,ground.The output pin is given to analog in Ao pin on the arduino.

And thats all folks,we are petty much done and the next step is to just upload my code which i have attached it here!

Please refer to the circuit diagram i did having the wiring of all the components in the above pic.


Step 4: Mechanical Coupling of Stepper Motor to Throttle

After the electronics part is done,the next part is coupling the stepper shaft to the throttle lever.

The system is such that when the RPM of engine drops,the stepper motor steps to the right,pushing the lever forward,rising the RPM. Similarly,when RPM is too high,it steps backward to pull the lever backwards to reduce the RPM.

The video shows it.

Step 5: The Code

Its written Arduino IDE folks.

Also please download the necessary libraries for this.

Thank you.


Arduino Contest 2017

Participated in the
Arduino Contest 2017

Epilog Challenge 9

Participated in the
Epilog Challenge 9

Wheels Contest 2017

Participated in the
Wheels Contest 2017