loading

This instructable was created in fulfillment of the project requirement of the Makecourse at the University of South Florida (www.makecourse.com)

This is a simple project in which an arduino is used to run model of a V6 engine using two stepper motors, three led lights, and several 3-D printed items. In this Instructable all files will be provided as well a step by step process explaining how to build and program the V6 engine (including ways to improve it).

Step 1: Print 3-D Parts

The V6 Engine works by using two stepper motors under the engine. The motors spin the crankshaft by using a pair of gears for each motor. The crankshaft then pumps the pistons up and down the cylinders.

The first thing that should be done is to print the 3-D parts that are needed for this project. There are 39 pieces that need to be printed. There are 3 basic sections to the engine: the engine block, the pistons, and the crankshaft. The engine block is made up of 5 parts, and the crankshaft is made up of only one part. The piston itself is made up of 5 individual parts and there must be 6 copies of the piston totaling 30 parts for the pistons.

You are free to design your own motor to your specifications if you'd like. My parts were designed using SolidWorks 2015. My designs will be included in this Instructable if you would like to use my parts.

I used super glue to keep the parts glued together.

Step 2: Circuit Setup

Components:

  • Stepper Motor
  • Motor Module
  • Various wires
  • 3 LED Lights
  • 3 1k Ohm Resistors

Setting up the LED lights:

First you must connect the 3 LED lights on the breadboard. Connect the 1k ohm resistors to the positive end of the LED light. Then, connect the LED lights to the arduino inputs in the following order:

Red --> 2

Green --> 3

Yellow --> 4

The shorter end of the LED light should be connected to the negative end of the breadboard. Then there should be a wire that connects the negative end of the breadboard to the GND (ground) input on the arduino.

Setting up the Stepper Motor:

The stepper motor needs to be plugged into the motor module first. Then it should have a wire connecting the negative end of the motor module to the negative side of the breadboard. The same should be done with the positive end of the motor module and the positive side of the breadboard. Then connect a wire from the positive side of the breadboard to the the 5V output from the arduino. Then connect the motor module to the following input pins: 9,10,11,12.

Setting up the Potentiometer:

The negative and positive ends of the potentiometer need to be connected to the negative and positive side of the breadboard respectively. The middle end of the potentiometer is connected to the analog input A0 on the arduino.

Step 3: Code

#include <StepperAK.h> // Stepper Motor Library

#define Red 2 // LED Pins

#define Green 3

#define Yellow 4

const int stepsPerRevolution = 2040;

int stepCount = 4;

Stepper myStepper(stepsPerRevolution, 9,10,11,12);

void setup() {

pinMode(Red, OUTPUT); // LED lights are set as outputs

pinMode(Green, OUTPUT);

pinMode(Yellow, OUTPUT);

}

void loop() {

int sensorReading = analogRead(A0); // reads data from the potentiometer

int motorSpeed = map(sensorReading, 0, 1023, 0, 10); // converts the data from the potentiometer

if (motorSpeed == 0){ // turns red light on and green light off

analogWrite(Red, 255);

analogWrite(Green, 0);

}

else{ // turns red light off and green light on

analogWrite(Red, 0);

analogWrite(Green, 255);

}

if (motorSpeed == 99){ // turns yellow light on when the maximum speed is reached

analogWrite(Yellow, 255);

}

else { // turns yellow light off when the speed is anything less than 99

analogWrite(Yellow, 0);

}

if (motorSpeed > 0) { // turns the stepper motor on when the motorSpeed value is greater than 0

myStepper.setSpeed(motorSpeed); // the stepper motor speed is based on the value given by the motorSpeed

myStepper.step(stepsPerRevolution/100);

}

}

Shown above is the code used for the V6 Engine. Basically, it uses a potentiometer to control the stepper motors. The potentiometer is the input which tells the arduino how fast to move the stepper motor. There are also 3 LED lights which are turned off and on based on whether the motor is on or off. The red light is turned on if the motor is off. If the motor is turned on, then the red light turns off and the green light turns on and remains on until the motor is turned back off. The third light is a yellow light which only activates when the motor reaches its maximum speed.

<p>Thanks for sharing :)</p>

About This Instructable

119views

1favorite

License:

More by pabsfer:V6 Engine (MakeCourse) 
Add instructable to: