This document describes an edge-detecting robot that uses an ATMega8 microcontroller. The robot has IR sensors on the left and right sides that detect edges and cause the robot to turn in the opposite direction. When an edge is detected, the appropriate motor is turned on via a motor driver IC to turn the robot away from the edge. The IR sensors send signals to comparators and then the microcontroller which controls the motor driver IC and decides which motor to power based on sensor input.