top of page

Arduino

 

For the Arduino project a bipedal dancing robot was made. This was inspired by a walking robot and a piano Arduino. It would be more challenging to create a robot that dances without it toppling over, than a walking robot. This, therefore, was the idea for the project.

The bipedal robot, once provided power, will dance and emit a melody. This tune can be changed using the button located on the top on the breadboard. The tune is coded using a header file containing the definitions (frequencies) for the notes.

The motivation behind the project was to create a fully functioning robot as it would be a great achievement to be able to complete. There are many applications to this project including a child’s toy. The buzzer could be replaced by a speaker or a microphone could be installed; to create a robot that can have a personalised audio to. It could also be developed as a walking robot rather than dancing, which can be adapted and applied to many helpful devices such as: small appliances to help carry objects to and from places for those who are unable to do so.

This prototype involves servo meters, a button and a piezo buzzer as its main functioning components. The four servo meters’ act as legs as they turn in a 180 degrees rotation, joined together perpendicularly. This allows for joint rotation, giving a more accurate representation of bipedal legs than an unjointed block would.

As said, leg movement is one feature of the Arduino robot, another is its ability to playback songs. The piezo buzzer is connected to ground and assigned to a pin A0 on the Arduino. This allowed the output frequencies to be adjusted. A button was also placed on the breadboard and connected to A1. Both are connected to analog input pins to ensure tidiness throughout, as although the piezo buzzer requires analog inputs, the button uses a digital base; however, the analog pins can be used as digital pins.

The design was founded using the human body as a reference, with a main body and two legs. Initially the design was to have three buttons located on the top, each holding a different function: dancing, walking, and kicking. However, walking and kicking have already been implemented in bipedal robots in many examples, so this idea was changed. This then leaves us with a dancing robot – the second iteration. The dancing robot was built as just that, a robot that dances with its feet. This model was deemed too simplistic and monotonous, and so music was implemented within the design, leading to the final prototype.

The circuity is set us as follows, with the Arduino acting as the main computer system whilst the breadboard connects the circuit. The battery was added to allow for portability as other the prototype would be confined to a small radius around the computer. It may have also tripped up on the lead whilst moving.

As you can see above, within the header file “#include ‘Arduino.h’” is included. This is a library that is automatically included within the sketch but not added header files. With the addition of this include, Arduino functions can now operate. Notes.h is a key header file as it is the basis of the melody, storing and holding all the frequencies for the piezo buzzer to play – where NOTE_C4 translates to the fourth pitch of C. All the notes were previously defined for ease of access and quick use.

In the above code the definitions of the notes are used to write out the song. The piezo buzzer requires both the frequency of the note and when to play it, here they are labelled as the melody and tempo. Both are placed in arrays to reduce storage space, decreasing the time taken to execute. 

Along with music, the code for the movement is also involved. However, unlike the notes, the servo meter movement are soley placed within the loop as the robot does not want to complete one cycle the stop.  The notes on the other hand require cycles and transition times to be calculated, therefore these calclations have been placed in void sections at the end of the code to be called within the loop. This saves space and execution time as void funtions do not return a value and also are not called unless needed.

bottom of page