college project help

hi there I have a college project to do on a arduino board, I have every little knowledge about arduinos or programing. so I need to hand this project up the day after tomorrow or I have failed my college year.
my project consists of a push button, pir sensor, servo motor and a dc motor

when the pushbutton is pressed the dc motor should turn on, when a object comes to the first pir sensor the dc motor needs to turn off, a servo motor then rotates 180, pauses for a second then turns back to its start position. the dc motor then should start again and continue on till it meets the next sensor. im really stuck with this and cant seam to get it working.
I tired righting a script for it but can not seam to get it working in any way and cant solve the errors in it.
this is the code I have ( I know it should be in the code tag things but I cant figure out how to do that when posting on the forum sorry ) if any body can help I would really appreciated it or if they could point me towards any sort of help it wold be great. I have read most articles I can fin on them and watched most videos but cant seam to get this working

const int buttonPin = 1; // start button
const int pirPin = 2; // pir sensor
const int myservo. attach(4) // servo motor
const int motorPin = 5; dc motor
void setup() {
// put your setup code here, to run once:
pinMode (buttonPin, INPUT); //pushbutton is a input
pinMode (pirPin, INPUT); // pir sensor is a input
pinMode (motorPin, OUTPUT);// dc motor is a out put
pinMode (myservo, OUTPUT); // servo is a output


void loop() {

buttonState = digitalRead (buttonPin); // check state of push button
if (buttonState == HIGH)
digitalWrite (motorPin == HIGH);

buttonState = digitalRead (pirPin); // check state f pir sensor
if (pirPin) == HIGH) // if sensor is activsted
digitalWrite (motorPin, LOW)
if(digitalRead(pirPin) == HIGH){ //if the PIR output is HIGH, turn servo

for(pos = 0; pos < 180; pos += 1) //from 0 to 180 degrees
{ //in steps of one degree
delay(1000); //servo to reach the position
for(pos = 180; pos>=1; pos-=1) //goes from 180 to 0 degrees

//wait for a transition to LOW before further output is made
lockLow = false;
Serial.print(“motion detected at “);
Serial.println(” sec”);
takeLowTime = true;

if(digitalRead(pirPin) == LOW){

lowIn = millis(); //save the time of the transition from HIGH to LOW
takeLowTime = false; //this is only done at the start of a LOW phase

//if the sensor is low motion stopped
if(!lockLow && millis() - lowIn > pause){

lockLow = true;
Serial.print(“motion ended at “); //output
Serial.print((millis() - pause)/1000);
Serial.println(” sec”);



just using my hand as a object, im replicating a conveyer belt system,
I managed to get the pir sensor to turn the motor last night using a different code, but it was very temperamental and only worked with my hand very close to it

is there any website I can pay to send the design of my circuit to that they will wright a code to suit my project? or even to fix the code on mine

is there any website I can pay to send the design of my circuit to that they will wright a code to suit my project? or even to fix the code on mine

Does your college permit that?

It sounds like cheating to me.

I would hate to employ someone with a college degree that they obtained without having to know the stuff on their course.

I would probably also hate to employ somebody who leaves important things to the last minute.


+1 for what Robin2 has said.

"A lack of planning on your part does not constitute a panic on my part."

This is a simple project that would have been done in plenty of time if started earlier.

A PIR is not something that would be used in a conveyor system. It relies on the object being hotter than the ambient.

Have you broken the code down into small sections and got each one working on its own? IE, write code to detect via PIR, write another to drive the servo etc. then join them together.

How have you got the DC motor connected to the Arduino? It must have a driver transistor and NOT be connected direct to the Arduino.


+1 for what Robin2 and Weedpharma said - if you have waited until two days before it is due and your entire year's "pass or fail" depends on this project, you have already failed. Part of the project is to plan and learn - sound like neither has happened here (and if the entire year depends on this, it is not the first part of your studies this has happened with). Sorry - most of us here have spent years working and earned our degrees etc. Part of getting that degree (a big part) is learning to plan ahead. What weedpharma says about determining the requirements is critical - you can't build something without first coming up with the requirements and determining what is involved in driving the various pieces of hardware (both output and inputs). I'm so old I remember dancing in lines at the cardfiles in the engineering library trying to find reference materials for what I was working on. Google didn't exist and we lived for our stacks of punch cards. Sigh.

Just wondering what the OP’s native language is and dreading to find it’s American Public School English.

He presumably failed his college course at least 3.5 years ago so it may be a little late to worry about his speeling and grammer.


How the Hell did that thread get on page 1?

How the Hell did that thread get on page 1?

Someone replied and then deleted their post?