We present a neural network that learns to control approach and avoidance behaviors in a mobile robot based on a form of animal learning known as operant conditioning. Learning, which requires no supervision, takes place as the robot moves around an environment cluttered with obstacles and light sources. The neural network requires no knowledge of the geometry of the robot or of the quality, number, or configuration of the robot's sensors. In this article we provide a detailed presentation of the model, and show our results with the Khepera and Pioneer 1 mobile robots.