Electronics

Intro


EEEEEE-ELECTRONICS! WOOHOO! Although the electronics do not come with your Buddy 4000 robot, this page will serve as an example of how you could do an electronics configuration for your robot.

Tools Required
- Necessary electronics
- Wire
- Perf Board
- Wire cutters & strippers
- Soldering Iron & Solder

Here is an overview of the electronics to familiarize yourself with all the boards.







Below you will find a table with all the boards used. Afterwards, some helpful text about how the electronics were added to the robot's body. If you run in to any issues, feel free to ask away on the forum!

LET'S GET SOLDERING!

All Pieces


Here are the electronics we used in our example Buddy 4000.

Electronics


Quantity Piece Description
1 The main brain of the robot- this is what we program to make the routines and such!
1 Changes the 3.7V to 5V for the servos & LED power.
1 Power for the robot. Good size for a reasonable amount of run time.
1 Breakout perf board with screw terminal to access Gnd, 5V, and 3.3V.
1 Breakout perf board with a header for the LED wires to plug into. Has each colour going to the Arduino for control.
1 Turns on/off the 5V power. (this could be improved)

Electronics Description


Power
The robot is powered off of a single LiPo battery, 3.7V 850mAh. This is used for both the servo power and Arduino power. The battery plugs into the LiPower board, which has wires from the 3.7V side going into the Vin and Gnd of the Arduino. On the other end of the LiPower board are wires from the 5V side going into the 'Power Area' perf board.

The Power Area perf board has a screw terminal for Gnd, 5V, 3.3V. The servos and LEDs (Common Anode) are powered by the 5V connection. There is a wire from the Arduino's VCC to the 3.3V terminal.

The power switch makes the connection for the 5V line. (Meaning, yes, the microcontroller is still powered. This is something to be improved in the future)

Servos
There are three servos used in this robot. The headers for plugging in the servos are broken out on the same 'Power Area' perf board. Each header has a signal pin that connects onto the Arduino.

To control the servos, we use the Servo library. Since Servo library uses Timer1, we connect the servos to pins 9 & 10, and 11 (the last pin can be whichever you choose really). Pins 9 & 10 normally have PWM disabled when using the Servo library, so it's good to put them to use for the servos.

The power for the servos comes from the 5V out of the LiPower board, from the LiPo battery. Sometimes when moving quickly or all servos moving at once, you may notice the LEDs and power fluctuating. If you were to use a sepparate battery for the servos and microcontroller, this would not be noticable.

LEDs
The LEDs used in this example are Common Anode. There are 47 ohm resistors on each of the colours. Choice of resistor was based on what resistors were in my box- you can choose more suitable values for your LEDs.

Both red, green, and blue leads from the two LEDs go to the same pins. This decision was made in order to save on pins, and provide the LEDs with PWM capability.

Arduino
Apart from the details already discussed, the Arduino's FTDI header is where it is programmed. Meaning, it is useful to attach wires and a header to this so that it can still be reachable while inside the robot.

The 328 @ 8MHz might be a little overkill for this robot, you can probably use a smaller microcontroller and still have the nice smoothed motions and everything. For now, this is what we are using.

Electronics Inside


Time to fit the electronics inside of Buddy 4000! Here's how we did it.

The servo cables and battery are nearest to the front wall:



Everything gets patiently wiggled inside. The servo & power perfboard breakout goes near the bottom.



That breakout then gets folded over, and the servos are plugged in.



Finally, after more poking, it looks like this!



It's important to be really patient with all the wires and boards so that you don't break any of them. ;) That's all for the electronics section!

Next


Let's add some code to make Buddy 4000 dance! Onwards to the programming!

Programming