The hardware choices will favor simple and cheap parts for better scalability while sacrificing the ability of the individual robot of doing complex behavior. An 8-bit micro-controller from Atmel was chosen as the brains of each robot, this 8pin chip is simple to program and has enough computing power to achieve the desired design. A duel H-bridge motor driver chip from Texas Instruments is used to interface and control two DC motors for movement. A combination of and and not gate array chips will act as I/O extenders so as to free pin on the chip for other uses. A combination of several IR transmitter diodes, a single IR receiver diode and two limit switches are used for sensing and interacting with the environment. The flowchart is shown in Figure 1. On first powered an initializing phase will commence, in this stage all the needed modules inside the microchip will be activated and in case of the ADC module, it will perform several reading that will be discarded. This is done to insure accurate and fast reading during operation. After the initialization phase the robot will start to operate. It starts by continuously turning in place and reading values from the IR sensor. This method is needed because of the IR array shape which leaves blind gaps that are eliminated by contin- uously turning the array. If a spike in the voltage reading is sensed this will indicate that another robot is in Figure 2. Dual H-Bridge connection diagram After deciding how the robots will behave we examine the main control unit to decide how to achieve the wanted design using it. The ATtiny85 MCU with its five bidirectional ports is used to control outside peripherals such as motors and motor driver. Because of how it is designed the ATiny85 cannot supply enough current to run a motor directly, we use a motor driver to interface the MCU with the motors. The chosen driver is the DRV8833 on a prebuilt board from Pololu. This driver interfaces two bidirectional DC motors to the MCU as seen in figure 2. The scheme of control Unit is depicted in Figure 3. Figure 5. whiskers circuit design This IR pair system is only useful when sensing other robots it can’t sense obstacles. For this project micro switches were used. By connecting a micro switch to a long whisker-like metal rod it can sense object sin front of the robot. Using two switches the robot can discern the location of the obstacle in relation to movement direction. A micro switch has three pins which are; common, connected and not connected. The pins flip w nen the switch is dispersed. This system need to work with only two pins. One pin will alert the MCU to an obstacle and the other pin will decide the location of the obstacle. The location mechanism is achieved by using a voltage divider, when a switch is pressed the value of the divider will change, this value is then read the MCU and compared against a known value that will give which switch was pressed. The chosen design be seen in Figure 5. by can In order to lessen the noise from digital part of the circuit we isolate the analog and digital lines tc different sides of the MCU. In the real circuit decoupling capacitors were mounted for each individual IC tc help with power supply stability. The final circuit was built in four independent PCB boards that are connectec using headers to make the circuit more compact as seen in Figure 6. Figure 7. Prototype To power each robot two rechargeable 4.2V lithium-ions are used; one for the motor circuit and the other for the control circuit. The chassis for the robot is made from plexiglass in the shape of a non-uniform 1exagon. This shape was chosen for its ease of manufacturing. Three robots prototype are shown in Figure 7. 2.2. Software The code for the robot was written in AVR assembly using Atmel Studio. The code was broken down into small subroutines then they were connected together after testing each one. The algorithm was decided upon after testing how the values read from the infrared receiver correlate with distance as seen in the hardware section. The equation is a simple second order polynomial; this equation will make the robots get closer to each other. Once they are sufficiently close, the algorithm will prevent them from straying too far from each other. This effect can be seen in Figure 8. The x-axis in graph above represents the voltage being read from the infrared sensor. The MCU will convert the voltage into a 10 bit digital value using the following equation: