Mechanical Engineer needing help!!!

Hello all,

I am a mechanical engineering student at the University of Michigan. I do not know anything about microcontrollers, and am very limited with my electrical engineering experience. For my senior design project, we are designing an automated golf ball tee feeder. Unfortunately, I am stuck with the distance sensor - micro controller - motor design.

Quick synopsis on design:
A 5 gallon bucket holding golf balls will have a rotating plate on the bottom of the bucket powered by a motor. A golf ball tee with a hole drilled through it will be risen up by an air compressor (once the golf ball lands on the tee, the air pressure will build up and the cylinder will rise above the platform to be hit). Once the golf ball is hit, the cylinder will go down, and process restarts.

Here is my thought. I will have a optical distance sensor near the tee. It will detect that there is NO BALL on the tee, which will power the motor to turn the plate to feed a golf ball. Once the golf ball lands on the tee, the sensor will recognize it. The air pressure will build up, and the cylinder will raise. The sensor will still sense that there is an object in front of it (golf ball, then cylinder). Once the ball is hit, the cylinder will drop down, and there will be nothing in front of the sensor...Sensor doesn't detect golfball, process repeats.

I NEED HELP!
What components do I need to wire this? The motor is a 12 VDC Motor. I will be using an Arduino Uno (or do you recommend something else??), a optical distance sensor, and obviously a voltage regulator to regulate the voltage across the Arduino Uno...

Other then that,I have no idea what I'm doing, or how I'm going to wire this. Can anyone provide ANY ADVICE??? (Wiring diagram, other items I may need to wire this).

Welcome!

I think a light sensor on the tee may just do the trick. When the ball is on top, there is little light. When the ball is hit, the sensor is revealed and receives light. You can certainly use an optical distance sensor but I bet the light dependent resistor may do the trick.

liudr:
Welcome!

I think a light sensor on the tee may just do the trick. When the ball is on top, there is little light. When the ball is hit, the sensor is revealed and receives light. You can certainly use an optical distance sensor but I bet the light dependent resistor may do the trick.

I'm kind of worried about the current/voltage from the motor through the microcontroller. How do I control this? A transistor/voltage regulator??

You won't be passing motor current through the microcontroller. The microcontroller just flips the transistors to control the motor. There's plenty hardware you can use to control motors.

You could do the ball raise/lower using a servo to push the ball up a tube when the weight of the ball on the tee shorts pin 4 to ground, and when the ball is removed pin 4 is unshorted and the servo moves the tee back down into the tube. code below.

//zoomkat servo button test 7-30-2011

#include <Servo.h>
int button1 = 4; //button pin, connect to ground to move servo
int press1 = 0;
Servo servo1;

void setup()
{
  pinMode(button1, INPUT);
  servo1.attach(7);
  digitalWrite(4, HIGH); //enable pullups to make pin high
}

void loop()
{
  press1 = digitalRead(button1);
  if (press1 == LOW)
  {
    servo1.write(160);
  }
  else {
    servo1.write(20);
  }
}