ARDUBOT:
Making robots are easier when the code is graphical.. ! Here with Ardublocks (A graphical programming language for Arduino) you can make a robot who detects obstruction, and never get hit anywhere.
here a few steps you can try out: