The power source configuration shown in the picture below is the one shown in class. Its advantage over the other configuration (to be shown later) is that it only uses one source (4xAAA Batteries). The down side with this configuration is that the mCU and as well as the logic circuit inside the L293 IC are easily affected by the transients caused by the 2 DC Motors when they turn on. If the your mobile robot seems to hang up, then you might want to try the other configuration.
The alternative power source configuration is shown in the picture below. This configuration uses two sources, one source solely for the the DC motor (connected to the VCC2 pin of the L293D ic) and the other to source both the mCU (via the LM317 ic) and the logic circuit inside the L293 ic (connected to the the VCC1 pin of the L293). The advantage of this kind of configuration is that the effects of the DC motor transients are minimized, thus your line following robot is more stable. The downside is that you will be needing 8 AAA batteries in 2 "4xAAA" group.
In both configurations, some pins of the Z8F0822A mCU IC and L293 Motor Driver IC are omitted for simplification purposes. They are still needed in the real circuit, the ones shown in the picture is simply to emphasize on the power source connection.
There are lot of comparator IC sold in the market. The ones I have used so far for line following robot purposes are shown in the picture below. The circuit for a light sensitive sensor is also shown.
Let us win this!!!!
Hope this post helps :)
See you all at the 2014 Robotics Competition!!!