Starfish Project: Servo Motors and Circuit

We utilized Arduino’s IDE to code our microcontroller and thus give commands to our servo motors on which way to move, and when. Our code can be broken down into three parts. Within the first part of the code, we created four servo objects using the Servo library available within Arduino, and created integers for each of the pins we wanted to use. Within the second part of the code, we coupled our servo objects with their corresponding integer pin. This way, when a signal was sent to a specific pin, that pin would send directions to the respective servo. In the last part of the code, we utilize a loop to rotate each of our servos clockwise by 120 degrees, and then a second loop to rotate each servo back to 0 degrees. In multiple iterations of our code, we tested different angles, as well as trying to turn the servos in a simultaneous manner. After multiple tests, we found what best worked for our case was the original collective turning of each motor 120 degrees, and back to 0 degrees. To couple with the code, we also designed a simple circuit to allow clean communication to the servo motors from the microcontroller shown in Figure [15].

Figure 15: Circuit Diagram

The microcontroller we chose was an Arduino Feather M0 due to its small size, which allows it to fit in our central electronics housing circle, and simple implementation. The M0 can only output a 3V signal, but the servo motors operate smoothly from 4-6V, thus we needed to include a level converter into the circuit. We chose a level converter from Sparkfun, part number BOB-12009 because it has four high voltage output pins. The circuit also features two batteries: a smaller 3.7V LiPo battery with a 500 mAh capacity and a 6V NiMh battery with a 1600 mAh capacity. Our servos will last 48 minutes with the NiMh battery assuming each draws 500 mA.The LiPo battery was used to power the microcontroller and the NiMh battery was used to power the servo motors. The LiPo battery will last an hour, assuming the microcontroller draws 500 mA which is its peak current output. The level converter has a low voltage (LV) and high voltage (HV) side. The 3V digital outputs from the M0 board is connected to the LV side and the 6V output from the NiMh battery to HV, all with a common ground to maintain a solid 0V reference point for the entire circuit. Then, a the servo motor digital signal wires were connected to the 4 HV pins, and the digital signal wires from the M0 to the 4 LV pins, allowing the microcontroller to send 6V signals to the servo motors, as opposed to the standard 3V output. 

Previous Page<    >Next Page