1st engineering student in need of help?!

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.