Project 1
A
Here's an example of how you could write the software for the camshaft arrangement using Arduino Uno:
#include <Servo.h>
Servo inletValve;
Servo outletValve;
int inletSensor = 2;
int outletSensor = 3;
int inletLED = 4;
int outletLED = 5;
void setup() {
inletValve.attach(9);
outletValve.attach(10);
pinMode(inletSensor, INPUT);
pinMode(outletSensor, INPUT);
pinMode(inletLED, OUTPUT);
pinMode(outletLED, OUTPUT);
}
void loop() {
int inletSensorValue = digitalRead(inletSensor);
int outletSensorValue = digitalRead(outletSensor);
if (inletSensorValue == LOW) {
digitalWrite(inletLED, HIGH);
inletValve.write(120);
} else {
digitalWrite(inletLED, LOW);
inletValve.write(0);
}
if (outletSensorValue == LOW) {
digitalWrite(outletLED, HIGH);
outletValve.write(120);
} else {
digitalWrite(outletLED, LOW);
outletValve.write(0);
}
}
In the code above, two servo motors are used to represent the inlet and outlet valves. The inlet and outlet sensors are connected to digital pins 2 and 3 respectively and are used to detect the position of the cam lobes. The inlet and outlet LEDs are connected to digital pins 4 and 5 and are used to represent the opening of the valves.
In the setup() function, the servo motors are attached to digital pins 9 and 10 and the inlet and outlet sensors and LEDs are set up as inputs and outputs respectively.
In the loop() function, the values of the inlet and outlet sensors are read and stored in inletSensorValue and outletSensorValue. If the inlet sensor value is LOW, it means that the nose of the cam lobe is near the sensor, so the inlet LED is turned on and the inlet valve is opened by moving the servo motor to an angle of 120 degrees. If the inlet sensor value is not LOW, the inlet LED is turned off and the inlet valve is closed by moving the servo motor to 0 degrees.
Similarly, if the outlet sensor value is LOW, it means that the nose of the cam lobe is near the sensor, so the outlet LED is turned on and the outlet valve is opened by moving the servo motor to an angle of 120 degrees. If the outlet sensor value is not LOW, the outlet LED is turned off and the outlet valve is closed by moving the servo motor to 0 degrees.
b.
To build the crankshaft arrangement, you would need:
- Arduino Uno
- DC Motor
- Proximity sensor
- Reluctor wheel (made of cardboard with 60-2 configuration)
Steps to build the crankshaft arrangement:
- Connect the DC motor to the Arduino Uno board and attach the reluctor wheel to the shaft of the DC motor.
- Place the proximity sensor in a way that it can detect the air gap in the reluctor wheel.
- Connect the proximity sensor to the Arduino Uno board.
- Write a program in the Arduino Integrated Development Environment (IDE) to control the DC motor and detect the position of the reluctor wheel.
The proximity sensor in this setup acts as the crankshaft sensor and will detect the position of the reluctor wheel. The DC motor will rotate the reluctor wheel continuously. The program you write in the Arduino IDE will be responsible for controlling the DC motor and detecting the position of the reluctor wheel using the proximity sensor.
Once you have completed the hardware setup, you can write a program to simulate the working of the crankshaft arrangement. The program should control the rotation of the DC motor and detect the position of the reluctor wheel using the proximity sensor. The output of the program could be displayed on the serial monitor of the Arduino IDE.
c.
To implement the design for the inside of an automobile cylinder arrangement, you would need to perform the following steps:
-
Design a slider-crank mechanism: Cut out a cardboard to represent the slider and crank in the mechanism. Connect them using a hinge mechanism to represent the slider-crank movement.
-
Connect the circular wheel to an Arduino Uno: Connect a DC Motor to the Arduino Uno. Attach the circular wheel of the slider-crank mechanism to the shaft of the DC Motor. The DC Motor and circular wheel will represent the movement of the piston inside the engine.
-
Connect a temperature and pressure sensor: Connect a temperature and pressure sensor to the Arduino Uno to measure the temperature and pressure inside the cylinder.
-
Connect an LED to represent the spark plug or fuel injectors: Connect one LED to the Arduino Uno. The LED will represent either the spark plug for gasoline engines or fuel injectors for diesel engines.
-
Write the software: Write a program for the Arduino Uno to control the movement of the piston and measure the temperature and pressure inside the cylinder. The LED should also be programmed to turn on and off according to the simulation of the spark plug or fuel injectors.
The final setup should simulate the working of the crankshaft-piston arrangement inside an engine and measure the temperature and pressure inside the cylinder.