1st engineering student in need of help?!

Hi

I have been working in a project to create and drive a small vehicle to start from a point drive to a wall touch it and return to the same point.
My group and i planned on doing this by driving the vehicle from a 3v geared motor. also to measure the distance we used a slotted disk attached to the shaft which ran through an optical sensor. the plan was once the vehicle had travelled to the wall a micro switch on the end would reverse the polarity of the motor and send it back in reverse and match the distance recorded from the optical sensor.

At first we tried to achieve this by using and circuit of 3 up/down counters but encountered several problems. we have now been advised to use and program an arduino board and use a h-bridge to reverse the motors polarity. However we are all new to arduino boards and are quite rushed for time to get it done?

If anyone can give any help or give suggestions on how to achieve this it would be really appreciated!

Hi

I have been working in a project to create and drive a small vehicle to start from a point drive to a wall touch it and return to the same point.
My group and i planned on doing this by driving the vehicle from a 3v geared motor. also to measure the distance we used a slotted disk attached to the shaft which ran through an optical sensor. the plan was once the vehicle had travelled to the wall a micro switch on the end would reverse the polarity of the motor and send it back in reverse and match the distance recorded from the optical sensor.

At first we tried to achieve this by using and circuit of 3 up/down counters but encountered several problems. we have now been advised to use and program an arduino board and use a h-bridge to reverse the motors polarity. However we are all new to arduino boards and are quite rushed for time to get it done?

If anyone can give any help or give suggestions on how to achieve this it would be really appreciated!

You should have a look at the 'playground' wiki. It can be found on the main arduino site. Especially the section 'interfacing with hardware' should answer a great deal of your questions: H-bridge / rotary encoder / counting pulses ...

An Arduino seems like a good choice for this - you can interface the optical counter, the motors, the switch and even a distance sensor to give you a warning of when to expect to reach the wall.

You will probably want an Arduino Uno, a motor controll shield (which will have the two h-bridge circuits for controlling the motors) plus the vehicle you have now. Connection should be fairly easy - you'll need something like 2 PWM and 1 control pin for each motor, plus one for the counter, one for the limit switch and perhaps a couple more for an ultrasonic ping sensor. That's 4 PWM plus 4 general I/O pins out of 6 + 8 digital pins and 6 analogue. That gives you plenty of pins.

I don't know how much coding you have done but if you work through a few of the examples in the learning section of arduino.cc you should get it quickly enough.

Just to keep things straight, you are not the 1st engineering student in need of help. Nor are you the first that doesn't really know if he/she needs help.

@madworm cheers mate :smiley:

@Pauls cheers.... for being a ****! yeah i did clearly need help hence the reason why i posted in this forum. not sure why you even bothered to comment? are you that much of a loser you go on electrical forums to unhelpfully reply to posts?

Moderator edit: personal insult diluted. Keep it civil.

I'm glad I didn't post my comment. Try to retain a sense of humour. It helps. Paul was just making a light joke about your subject. Perhaps you meant "1st year engineering student in need of help!" The question mark led to the second part of the comment. I was going to say that I hoped it didn't mean there was a queue behind you. Not particularly funny, I know.

PaulS is one of the best and most informative and helpful participants on this forum. You just have to post a compilable code, a clear circuit diagram, and a description of why your code doesn't do what you think it does if you want him to help. :slight_smile:

First. I agree with John_S responce. Need schematics, code, possible block diagram and a step-by-step of what you want the robot to do.

Let see if I understand correctly...

Input : A bumber switch
Opto coupler sensor of a encode disk

Output : 2 motor

Process : Arduino

So far... Correct ?

And you want us to code for you ? Hmm... Good luck on that one. If I have a robot being build, I will share my code, but the hardware maybe differents.

Let see for a pseudo-code...

Move motors
Check Switch

  • hit --> Back up
    Read opto
    Store opto data
    repeat...

That it. Unless you forgot to mention others things like com link and others stuffs.

I've merged the two near identical posts.
Do NOT cross post, it simply wastes time.