0% found this document useful (0 votes)
153 views43 pages

Open Source Turtle Robot (OSTR) : Instructables

The document provides instructions for assembling an open source turtle robot. It discusses: 1) The electrical, mechanical, and software engineering aspects of the project. Resistors, sensors, buttons, and capacitors are installed on the printed circuit board during the electrical engineering stage. 2) Details of the 3D printed chassis, wheels, and other mechanical parts that are assembled during the mechanical engineering stage. 3) How the robot is programmed and calibrated during the software engineering stage. The open source nature of the project means that all designs, code, and instructions are freely available for anyone to replicate, modify, and share improvements. The goal is to introduce students to core engineering principles through a hands

Uploaded by

julio arriola
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
153 views43 pages

Open Source Turtle Robot (OSTR) : Instructables

The document provides instructions for assembling an open source turtle robot. It discusses: 1) The electrical, mechanical, and software engineering aspects of the project. Resistors, sensors, buttons, and capacitors are installed on the printed circuit board during the electrical engineering stage. 2) Details of the 3D printed chassis, wheels, and other mechanical parts that are assembled during the mechanical engineering stage. 3) How the robot is programmed and calibrated during the software engineering stage. The open source nature of the project means that all designs, code, and instructions are freely available for anyone to replicate, modify, and share improvements. The goal is to introduce students to core engineering principles through a hands

Uploaded by

julio arriola
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 43

instructables

Open Source Turtle Robot (OSTR)

by MakersBox

Robotics is the exciting intersection of a number of engineering elds

including mechanical engineering, electrical engineering, and computer science. This project was designed as the basis
for a two-day workshop for high school age students to introduce them to engineering principles and giving them a
jumping o point for exploring their interests further. There is something for everyone here, even if it is just for the art it
creates.

What is Turtle Robot? The concept can be traced

back to William Walter’s robotics work in the 1940s which investigated complex behaviors in simple systems. Turtle
robots are generally slow moving with tight turning radiuses and can trace a design that shows their behavior over time.

Open Source Turtle Robot (OSTR): Page 1


They make excellent teaching aides in that their programmed output can be seen visually. A number of programming
languages have “Turtle Graphics” built in. Turtle graphics can also be used to investigate advanced topics like L-systems
or a ne geometry

What is Open Source? If you can look past licences and lawyers, Open Source is a philosophy

that ideas should be shared, and if you use an idea you attribute the originator, and if you improve on it, you should share
your improvement. Every part of this project, from the circuit board to the 3D designs, are available for study, replicating,
and improving. Not only that, but it was designed and programmed used Open Source programs like Arduino and KiCad.
All you would have to do is use a computer running Linux (an Open Source operating system) and print the parts on a
RepRap based 3D printer (an Open Source project), and you would have Open Source Turtles All the Way Down . This
project is certi ed as Open Source Hardware by the OSHWA.

This project is just the latest iteration of my “Low-Cost, Arduino Compatible Robot”, which in turn is based on the work of
others. The concept of two wheel drive with pen in the center is from the Mirobot. Improvements over the Arduino
version include a printed circuit board for ease of construction and robustness, infrared sensors for obstacle detection,
and a more compact and sti chassis for more accurate movement and lower printing cost. Rewiring port assignments
and rmware improvements help remove stuttering caused by Arduino’s digialWrite() ine ciencies.

In keeping with the engineering elds we are exploring, this project is broken into three distinct sections:

Electrical (EE: PCB assembly and testing),


Mechanical (ME: chassis assembly), and
Software (SW: calibration and programming).

Disambiguation: I've published a couple of di erent drawing robots and it is getting confusing. Here is a breakdown.

Ardunio based, no soldering version


Compact Adafruit Tinket based no soldering version
Large stepper, chalk drawing robot
With Turtle Robot Board Kit:
Adafruit Trinket Based Compact version (a.k.a. OSTR Version 1)
Adafruit ItsyBitsy Version (a.k.a OSTR Version 2)
Open Source Turtle Robot (OSTR): Page 2
Adafruit ItsyBitsy "Version 2.2 February 2020": Use this Instructable!

https://youtu.be/ExhSeAjVGYc

Step 1: Parts

The current Bill of Materials with part numbers and URLs is located at: https://github.com/aspro648/OSTR/. A number of
components like resistors and capacitors are generic, so substitutions are acceptable. In general, the cost is about $60-80.

A kit for this project is available on Tindie.com. Purchasing the kit will save you the time and expense of ordering from
several di erent vendors and avoid the minimum PCB order premium. You will also be helping me develop and share
other projects in my workshops!

In general, here is an outline:

Electronics:

Turtle Robot Board Kit


Adafruit ItsyBitsy Microconroller (M4 recommended)
USB micro cable

Electromechanical:

2 Geared 5V 28byj Steppers


1 Micro servo
2 2 x AA Battery Holders
4 AA batteries

Open Source Turtle Robot (OSTR): Page 3


3D Parts:

Chassis
2 wheels
Caster

Hardware:

M3 screws and nuts


5/8 steel bearing
2 Dash 223 O-rings

Step 2: Electrical Engineering Overview

Electrical Engineers deal with the application of electronics, electricity, and electromagnetism. The eld is broad and has
many sub-disciplines:

Power: Generation, transmission, and distribution of electricity, which could include solar, wind, and
hydroelectric applications.
Control: Electrical control of dynamic systems such as aircraft, automotive, or industrial automation.
Microelectronic: Dealing with the design and manufacture of the circuitry inside microchips used in
computers and cell phones.
Signal Processing: Dealing with the transmission and analysis of electrical signals such as in radar,
communication, or audio.
Instrumentation: Design and use of sensor systems to measure physical properties.

As part of an engineering team, Electrical Engineers need to work closely with Mechanical Engineers to ensure motors
and sensors meet system requirements. They may also work with Firmware engineers to help troubleshoot and repair
electronics as they are developed and tested with software.

Open Source Turtle Robot (OSTR): Page 4


As part of the Turtle Robot project, you could be expected to explain how the robot is powered, how it’s stepper and
servo motors function and are controlled, and how the circuit was designed, manufactured, assembled, and tested. The
electrical schematics and printed circuit board (PCB) layout les were created in the Open Source KiCad program and are
located in the /design_ les folder.

Step 3: Electrical Engineering (EE): TLDR;

A well designed circuit should be "build-able" by an experienced hobbiest based on the bill of materials and the PCB
silkscreen. For those of you who like to charge ahead, this graphic should be enough to get you past any quirks in the
design.

For the rest of us mere mortals, follow along and I'll discuss assembly in detail.

Step 4: EE: Resistance Is Essential.

Open Source Turtle Robot (OSTR): Page 5


I like starting with the resistor because:

1. They are relatively heat resistant while you are getting into your soldering groove and the iron is coming
up to temp,
2. They have no polarity, so orientation is not critical, and
3. They are the lowest component on the board so sit tight when soldering when the board is ipped on it's
back.

Since these are our rst components, we'll cover them a little more in depth starting out. There are three pairs of two
di erent values:

10K ohm for sensors [brown - black - orange - gold]


330 ohm for LED current limiting [orange - orange -brown -gold]

Check out www.resistorguide.com/resistor-color-code/ if you want to


learn more about reading resistor color codes.

You can do one at a time, or all six at once.

Bend the leads to the width of the pads and insert the resistor.

Open Source Turtle Robot (OSTR): Page 6


Flip the board over and heat both the pad and lead for about two seconds.
Introduce solder, and maintain heat until the solder melts and ows around the pad.
Remove the solder, and then the heat, in that order.
If your solder gets stuck, just re-heat the joint.

Trim the leads with ush cuts.

Open Source Turtle Robot (OSTR): Page 7


Step 5: EE: Eyes!

The front end of the robot contains two sets of devices for detecting and indicating obstacles, one for the left side, and
one for right. From the outer edge working inward, we have an:

IR Detector (black),
IR Emitter (clear), and
LED (colored).

They each have polarity, so must be put in the correct orientation. I've tried to make it easy and have all devices with the
same orientation. Long leg goes through the square pad. Bend the legs so the device points toward the edge of the
board.

Solder one lead of each component.


Verify they are oriented and seated correctly.
Trim the excess lead with ush-cut pliers.

Open Source Turtle Robot (OSTR): Page 8


Step 6: EE: Button and IC Socket

We have a single button to use for input.

Match the holes with the leads and gently press them in.
Solder them in place and clip the leads.

The IC Socket is a small bit of insurance against putting the chip in backwards. It also allows a chip to be replaced if
needed (never had to on these boards yet).

Solder one lead in each corner.


Verify the component is seated at.
Solder the remaining leads.

Step 7: EE: Capacitors

Open Source Turtle Robot (OSTR): Page 9


There are three capacitors of various capacities to help smooth power transients that occur while the motor signals
switch on and o . The two larger black capacitors (10 uF and 100 uF) are electrolytic and have polarity. Like the LEDs, the
long leg is positive, and there is a white strip on the body indicating negative.

The smaller capacitor (1 uF) is ceramic and has no polarity.

Step 8: Power Switch

The power switch can installed in either direction.

Insert the switch and solder a single lead.


Verify the switch sits ush on the board and adjust if necessary.
Solder the remaining leads and cut ush.

Step 9: EE: Headers & Terminals

The two stepper motors are connected using the white JST headers. They have two slot on one side that face outward.
There is also a small locating pin that ts in a hole in the circuit board.

Open Source Turtle Robot (OSTR): Page 10


Insert the header and verify it is seated correctly.
Solder the pins in place.

Power from the two battery holders are connected via the two black terminal headers. The openings face outward as
well.

Solder one pin from each terminal.


Flip the board and verify the terminal is at and openings facing out.
Solder the remaining pin.

The control from the board comes from a microcontroller inserted in to two rows of 14 pin headers.

Solder one pin of the header (any location).


Verify the header is seated at and vertical and adjust if needed.
Solder the remaining pins.

Open Source Turtle Robot (OSTR): Page 11


Step 10: Servo Header

The servo is connected via a 3-pin header. There is a pin for power (+), ground (-), and signal (s).

Insert the header and solder a single pin.


Flip the board and verify the header is at and vertical.
Solder the remaining pins.

Open Source Turtle Robot (OSTR): Page 12


Step 11: Speaker

We are going to use a small piezo speaker to generate tones.

Fold the leads at to the body so the speaker will be vertical when mounted (we ran out of board space!).
Insert the speaker and solder a single lead.
Flip the board and verify the arrangement is suitable.
Solder the remaining lead and clip ush with board.

Open Source Turtle Robot (OSTR): Page 13


Step 12: EE: Darling Darlington

The single IC on the board is a Darlington array, which is used to control the power going to the motors. From the
manufacture, IC pins are splayed slightly outward and need to be bent to 90 degrees to t in the holes.

Place the IC on a at surface and bend each side inward gently.


Match the divot on the end marking the side with pin one with the silk screen.

Open Source Turtle Robot (OSTR): Page 14


Step 13: EE: Brains

The Adafruit ItsyBitsy connects to the motor board via two 14-pin female headers.

Cut the headers to length and insert them into the sockets with the short ends upward.
Place the ItsyBitsy onto the pins.
Ensure the the top (USB, microchip, and reset pin) are upward!
USB connector toward the edge.

Solder the pins in place .

Open Source Turtle Robot (OSTR): Page 15


Step 14: Mechanical Engineering Overview

Mechanical Engineers use physics, math, and material science to help design, build, and maintain mechanical systems.
Like Electrical Engineering, it is a broad eld with many sub categories:

Mechanics: Not the one who works on your car, but someone who studies forces and motion including
static and dynamic forces as well as uid dynamics.
Mechatronics and Robotics: The combination of mechanics and electronics in systems as small as the
drive ejection on the CD player and up to large industrial robots.
Structural Analysis: Dealing with how material and parts handle force and stresses.
Thermodynamics: Studying energy creation, ow, and transfer in systems such as engines, power plants,
and ventilation.

As part of an engineering team, Mechanical engineers would be responsible for designing the chassis and drivetrain of
the mechanical systems, working closely with the Electrical Engineers to understand the size and forces involved. They
would use computer assisted drafting (CAD) to create drawing and oversee their manufacture and testing of parts by a
machine shop or using 3D printing.

The Turtle Robot chassis was designed using CAD and 3D printed. The quick turnaround for 3D parts means an engineer
can rapidly test and modify parts to meet the system requirements or explore new ideas.

Open Source Turtle Robot (OSTR): Page 16


Step 15: Mechanical Engineering (ME): Parts

Time to switch gears from Electrical Engineering to Mechanical Engineering.

The required hardware is on the bill of materials (BOM): https://github.com/aspro648/OSTR/blob/master/BOM.md.

A current copy of printable STLs are located on Thingaverse. You will need:

1 Chassis
2 Wheels
1 Caster
1 Pen Collar
1 Nameplate (optional).

Again, a kit for this project is available on Tindie.com if you don't have access to 3D printing.

Open Source Turtle Robot (OSTR): Page 17


Step 16: ME: Chassis Prep

A "chassis" is the fame of a motor vehicle or other wheeled conveyance, and in this case the robot's chassis forms the
platform for the electronics, motors, and servos.

Time to get familiar with your hardware. We will be using three di erent types of Phillips screws you will have to be able
to identify:

Pan Head Screw (M3 x 6 mm) -> Stepper motors to Chassis


Flat Head Screw (M3 x 6 mm) -> Battery Holders to Chassis
Round Head Thread-Forming Screw (#2 x 1/4") -> PCB to Chassis

In order to attach parts, we are going to embed M3 nuts into the chassis.

Open Source Turtle Robot (OSTR): Page 18


Use an M3 round-head screw and tighten it to pull the nut into the pocket so it is seated ush.
Remove the screw.

Step 17: ME: Batteries

Integrating the electrical components like motors and batteries with the chassis will fall into the ME's domain.

Attach the battery holders using two M3 at-head screws and thread the wires through the openings
under the motor mounts.

Open Source Turtle Robot (OSTR): Page 19


Put on your "EE" hat and attach the positive and negative wires to the terminals marked "+" and "-", one
set of batteries for each terminal.

Attach the circuit board to the chassis using #2x1/4 thread-forming screws.
If the screws wont start, remove the PCB and use the tip of the screw driver to open them
up a bit.

Open Source Turtle Robot (OSTR): Page 20


Step 18: ME: Servo

The servo is used to raise and lower the pen for drawing.

Place the arm on the hub and gently rotate the stepper counter-clockwise looking down on it until it
reaches the stop.
Remove the arm and position it facing left (this will be the down position).
Insert the small thread-forming screw and tighten.
Insert the servo in the mount with the hub end upward and attach using two larger thread-forming
screws.

Open Source Turtle Robot (OSTR): Page 21


Step 19: ME: Stepper Motors

Before we mount the stepper motors, check the t of the wheels on the shaft. These should slid on fairly tightly if your
printer is calibrated correctly.

If they are too tight, use a jewelers le to open up clearance. You can also heat the hub with a hair drier,
but do so sparingly to avoid warping the rim.
If they are too loose, you can use an M3 round-head screw to hold the wheel to the shaft (after the motor
is mounted).

We are going to pass the wires of the stepper (and servo) under the body to help with wire management.

Start with the left side and thread the wires for the stepper (and servo) through the opening with wires

Open Source Turtle Robot (OSTR): Page 22


coming from the stepper following down the back side.
Insert the motor into the mount and attach with two M3 round-head screws and nuts.
Gently pull the wires through.

Step 20: ME: Caster

The caster allows the robot to pivot with low friction.

Gently press the bearing into the holder.


If it is too tight, use a hair dryer to soften the plastic.

Attach the caster to the chassis using M3 round-head screws.

Open Source Turtle Robot (OSTR): Page 23


Step 21: ME: Wheels

Slip the o-ring into the rim groove and stretch it to snap in place.
Gently press the wheel on to the stepper shaft as far as it will go.
If the wheel is too loose on the shaft, you can drill a hole and thread a M3 round-head screw in the hub.

Open Source Turtle Robot (OSTR): Page 24


Step 22: ME: Power

Attach the stepper connectors to the terminal headers on the PCB.


Fold and press the wires into the cavities between the headers and the steppers to keep them clear of the
servo arm during operation.
Insert the Adafruit Trinket Pro into the headers with the USB hub facing the edge and press into place.
Ensure the power switch is set to o .
Insert the batteries.

Open Source Turtle Robot (OSTR): Page 25


Step 23: Software Engineering Overview

Open Source Turtle Robot (OSTR): Page 26


A software engineer is a person who applies the control the motors and servos and may create graphical
principles of software engineering to the design, user interfaces (GUIs) to control and test functions of the
development, maintenance, testing, and evaluation of robot. They would work closely with the mechanical and
computer software. electrical engineers to understand the speci cations and
control of the various components used.

Turtle robot has stepper motors, servo motors, sensors,


and LEDs that all need to be programmed in order for it
to function. The robot is programmed in Python, a
popular and useful language that is known for it ease of
learning and readability.
Margaret Hamilton

promoted the term "software engineering" during her The ItsyBitsy board
work on the Apollo program. The term "engineering"
was used to acknowledge that the work should be taken
just as seriously as other contributions toward the
advancement of technology. A software engineer is
responsible for writing and maintaining software used
to control electrical hardware devices such as cell
phones or systems in automobiles.
controlling the robot was designed and manufactured
Educational requirements vary, but include degrees in by Adafruit Industries in New York, a company founded
computer science, information systems, information by Limor Fried, also known as Lady Ada, a MIT graduate.
technology, or software engineering. A software Her company promotes Open Source DIY electronic
engineer would be expected to have familiarity with projects. Visit http://Adafruit.com for inspiration on your
electronics and mechanical systems. next project. The ItsyBitsy can be removed from the
robot and placed in a breadboard or other project and
As part of a robotics engineering team, the software reprogrammed to do your bidding.
engineer would be responsible for writing the code that

Step 24: Software (SW): Testing and Blinking

The current design uses the Adafruit ItsyBitsy microcontroller family, which come in a number of avors. These are the
ones that will work with the robot

Cortex M4 (Python or Arduino) (Recommended)


32U4 at 8Mhz @ 3.3V (Arduino Only)

The 32U4 is inexpensive, but it is a bit more di cult for beginners to use and limits you to using the Arduino IDE to
program it. Follow the link above to learn how to set it up. Firmware is located on Github, but I have not done too much
Open Source Turtle Robot (OSTR): Page 27
work on it other than to test basic functionality. Check the V1 rmware folder for C examples.

The M4 version is slightly more expensive, but is powerful enough to run Python which makes it the perfect platform for
beginners.

If you bought a kit from Tindie, the ItsyBitsy will come with the correct version of CircuitPython and be preloaded with
rmware and examples. You only need to install the Mu editor as outlined below:

Follow the Adafruit instructions to install the Mu editor. It recognizes the ItsyBitsy automatically and gives
us access to serial console and plotting.
The rmware was written to work with Circuit Python 4.1. Depending on when are where you get your
Itsy from, you may need to update it. Follow these instructions.
Download and unzip the Turtle Firmware and copy it onto your ItsyBitsy.

If all has gone well, the RGB LED on the ItsyBitsy should turn magenta while the current Python script is running.

If the board is plugged into the Robot Base, you should also hear some beeps.
If the batteries are installed and the power switch is on, the robot should exercise the servo motor twice
and then begin to draw squares.

If these do not happen, don't panic! Skip ahead to the trouble shooting section. If all else false, ask for help! I've done my
best to ensure your success, but if you have trouble you can help me improve it by helping me gure out why.

Step 25: SW: Calibration

Because of variations in assembly and alignment, the robot must be calibrated so that it can move precise distances and
angles. This is controlled by two parameters, the diameter of the wheel and the distance between the wheels. While we
can measure these, they need to be tweaked a bit to get more precision.

The Python code to make the calibration squares is called "wheel_calibration.py" and is executed by the main " code.py"
script. Calibration parameters, if they need adjusting, are located in "calibration.py"

Open Source Turtle Robot (OSTR): Page 28


Prepare the pen:

Remove the cap and slide the pen collar from the tip side.
Insert pen in holder with servo arm straight up.
Ensure the pen is just barely above the paper in this position.
If the pen binds in the shaft, us a le to remove any roughness.

Draw a square:

Slide the power switch to "On".


Wait several seconds for the bootloader to begin.
After the robot completes it's rst square, remove the pen and turn the robot o .

Open Source Turtle Robot (OSTR): Page 29


Adjust wheel_dia parameter rst. Measure the length of side of the square. It should be 100 mm:

If the measured distance is too long, increase wheel_dia.


If the measured distance is too short, decrease wheel_dia.

Open Source Turtle Robot (OSTR): Page 30


After you have the distance calibration, adjust the wheel_base parameter which a ects the angle of the turn. Place the
robot on a fresh sheet of paper, turn it on and let it draw all four squares:

If the robot is turning too sharply (box is rotating clockwise), decrease wheel_base value.
If robot is not turning sharply enough (box is rotating counter-clockwise), increase wheel_base value.
Because of rounding errors in the stepping code and slop in the gears of the inexpensive steppers, you
will never get it perfect, so don't spend too much e ort on it.

Open Source Turtle Robot (OSTR): Page 31


Step 26: SW: Servo Adjustment

The servo raises and lowers the pen. At the beginning of can try changing the min_pulse and max_pulse
the wheel calibration script, it raises and lowers the parameters.
servo twice. If it is not traveling between vertical and
horizontal, we can adjust the parameters in If you are unable to achieve the positions you want, you
calibration.py. may have to remove the servo, unscrew and remove the
horn, and readjust it's position.
If it does not appear to be moving a full 90 degrees, you

Step 27: SW: Vision Check

Open Source Turtle Robot (OSTR): Page 32


Now that you have a calibrated turtle, let's look at how it's eyes work. There are lots

ways for robots to detect their environment:

Bump sensors (limit switches).


IR emitter/detector pair
Sonar
Laser range nding
Beacon detection
GPS

We are using IR because it is easy and inexpensive. The downside is that detection distance is short (several inches),
varies by surface re ectance, and is subject to interference from other IR sources like the sun.

Modify "code.py" to run "turtle_eye_check.py" and save it.


Click the [Serial] button on Mu. You should see a stream of numbers.
What happens if you move your hand in front of the detector?

Click on the [Plotter] button in Mu.

If you are not getting the desired response:

Use a phone or camera to observe the IR emitters are working.


Verify the emitter and detector alignment. If they angle toward each other, it will cause interference.
Direct or indirect sunlight contains IR and can interfere with the signal.

Open Source Turtle Robot (OSTR): Page 33


Step 28: Trouble Shooting

This is a pretty complex project, and will likely give you ts at some point. I like to tell workshop participants that they
need to have:

Patience - Don't give up at your rst failure.


Persistence - You have to keep trying di erent things to solve problems.
A Positive Attitude - You can do it!

If you are having trouble saving sketches to the ItsyBitsy:

Unplug and reinsert the USB cable.


When saving any sketch, the board should reset (you should hear beeps).
Ask for help in the comments or Adafruit forums.

No power when on-switch turned on:

Ensure you have fresh batteries.


Ensure batteries installed correctly.
Double-check battery connections to terminal blocks.
Disconnect servo & steppers.
Use a volt meter to verify voltage at terminal blocks.

Wheels do not move or stop moving during run for calibration step:

Ensure you have fresh batteries installed correctly.


Check white stepper connectors inserted fully.

Open Source Turtle Robot (OSTR): Page 34


Ensure battery wires are not binding the wheels.
Ensure steppers rotate by hand.

Robot turns the wrong direction:

You have the left and right steppers plugged in to the opposite headers.

Pen doesn't leave a trace:

Ensure pen is free in barrel and will drop below the wheel.
Use a le to remove roughness and open barrel diameter.

Ensure pen holder is at the proper level hold the pen up.
Ensure servo points straight up during penup() command. If not, adjust PENUP angle in rmware.

Pen Too Loose:

Verify your 3D printing parameters.


Add some tape to the pen to increase the barrel diameter.

If you are stuck, ask for help in the comments. I've done my best to make this a successful beginners project, but it is
complex. Asking for help lets me know what needs improvement.

Step 29: Curriculum Ideas

For my workshops, we use the Hour of Code activity at GROK Learning: https://groklearning.com/hoc/activity/snow ake/
. It provides a gentle introduction to Python, Turtle commands, and loops.

Once the participants nish, they can create their own custom snow ake in the browser. This can be directly placed in
the "mySnow ake.py" template. The rmware also contains the nal snow ake example from the tutorial in
"turtle_snow ake_example1.py".

For younger students who may bene t from the simpler "block" programming style, I like the Code with Anna and Elsa
tutorial. Students can again create their own custom snow akes, but it will require a more experienced coder translate
the code from Javascript to Python. There is an example from the tutorial in "turtle_snow ake_example2.py". I have also
posted an Instructable about using the turtle robot with these on-line resources.

In addition, the following example scripts are available in the rmware folder:

music_example.py: Generate 8-bit style music using a tone(duration, frequency) command.


rtttl_example.py: Generates tunes based on the Nokia ring tone codes. Examples are include for Star
Wars, MahnaMahna, and The Simpsons to name a few.
obstacles.py: Uses the IR sensors to stop the robot when an obstacle is encountered. Encourage the
student to complete the algorithm to have the turtle maneuver to avoid the obstacle.
Open Source Turtle Robot (OSTR): Page 35
The following examples can run on the robot, or in a Python interpreter on a computer. This allows the student to
modify the scripts and test them virtually before unleashing them on the robot.

turtle_snow ake_example1.py from the


groklearning tutorial.

turtle_snow ake_example2.py from the Code with


Anna and Elsa tutorial.

turtle_font_example.py: Uses a simple vector font to


write messages out.

turtle_cursive_example.py: Uses a vector font from


the 1960s called "Hershey font". It was originally
designed to write text on CRT screens.

turtle_goto_example.py: Uses the goto(x, y)


command to create simple line drawings. The
example recreates the turtle icon used in the Python
Turtle implementation. How is that for meta?

Challenge Activities:

From the snow ake tutorial, create your own custom snow ake and put the code in my_snow ake.py
template.
In snow ake examples, use the function random.randint(low, high) to generate random number of arms,
angles, and/or lengths.
Modify turtle_font_example.py or turtle_cursive_example.py to write your name or a message. Could you
use random.randint(low, high) to create random messages?
In turtle_obstacles.py, the turtle only stops when sensing a wall. Write code to have turtle navigate away
from obstacles it senses.
Create a maze for the student to solve. ( example)
Open Source Turtle Robot (OSTR): Page 36
Try the di erent songs in rtttl_example.py to nd your favorite.
Open music_example.py to see how tones are played. Can you adapt your favorite tune in code?
What does turtle_goto_example.py draw? Use the handout to create your own object.
There is a isButtonPushed() function that returns True if pushed, False if not. What could you use that for?
Hint: look in eye_check.py!
Bonus level: Since turtle can see and emit IR, with a friend could you create a predator / prey pair, with
one seeking IR, and the other eeing IR?

Step 30: Workshop Notes

Join the Turtle Robots forum to share your robot and teaching ideas!

Resources are always limited when doing workshops, so I've been breaking students into three groups and rotating them
through three areas, each with a knowledgeable volunteer.

Open Source Turtle Robot (OSTR): Page 37


Electrical: Soldering the PCB.
Soldering irons, one for every two students so they can work in pairs.
Flush cuts
Safety glasses

Mechanical: Chassis assembly with steppers and servos.


screwdrivers
pliers
hot glue

Software: Turtle tutorials, LED blinking, uploading rmware, calibration.


Laptops/computers, at least one for every two students so they can work in pairs.
Rulers for calibration
Pre-built robots for testing code if they haven't assembled their robot yet.

Safety with the electrical portion is important and should be discussed before starting. Safety glasses should be worn. I
have a squirt bottle of water at the table for cooling burns (and wetting sponges).

Here are a couple of the soldering videos I like to show:

https://youtu.be/P5L4Gl6Q4Xo
https://youtu.be/QKbJxytERvg

Most examples run on a 8.5" x 11" sheet of paper. Lay down some butcher paper on the oor for larger drawings.

Open Source Turtle Robot (OSTR): Page 38


Step 31: Bonus Activity: 3D Name Plate

I like having the 3D printer at the workshops since it shows how the robot was made. I usually print out tree frogs to give
the students. They usually end up riding the robots around.

If time allows, a simple 3D design exercise allows the student to learn more about 3D printing while creating a custom
name plate for their robot. The at, thin object prints quick, and swapping lament out creates a nice contrast.

Resources:

Tutorial
Blank Nameplate STL
Shared Tinkercad example

Open Source Turtle Robot (OSTR): Page 39


Step 32: Turtles in the Wild

I love seeing these robots out in the wild, especially when they have been modi ed in ways I would have never have
thought. Here are a couple of notable examples, with hopefully more to come:

Instructable User Aaqup has taken the Turtle to the


next level with his Otto Turtle Project! He was able to
make it more compact by having the pen travel
through the circuit board!

Russ Hughes does workshops and has created a


custom circuit board, uses Tiny Basic, and has
implemented the Hersey Vector Font .

Open Source Turtle Robot (OSTR): Page 40


Instructable user seancuttle sh added both sonar and line following

An in the "where there is a will, there is a way"


category, Samarsis created a version with no 3D
printing!

If you make a Turtle bot inspired from my examples, use the "I Made It!" button below, upload a picture, and make my
day!

Open Source Turtle Robot (OSTR): Page 41


This looks fantastic! There are hundreds of "arduino robot platforms" out there but this one stands
out for a few reasons:
1. The pen plotter! Just like the Turtle graphics that introduced so many kids to programming in
the 1980s...
2. Proper source files! Not just a Tinkercad link, but real editable 3d files for Freecad.
3. Just like 2 above, but for a Kicad PCB. great stuff.

I do have one question though. A few of the links to the Github source files are dead - I assume
this is because you are continually evolving and improving the design! Can you please tell me
which versions of the PCB and printable files are the most recent/best? For example, I get a 404
if I look for the Freecad files at https://github.com/aspro648/OSTR/blob/master/V2/3D

Thanks again :-)


Yup, I'm having trouble keeping everything current. Thanks for calling it out because it helps me
do just that!

I the link should be:


https://github.com/aspro648/OSTR/tree/master/V2/me...

Let me know how it goes!


Thanks for the fast response! That link looks good. This project has just moved from the back of
my "to do list" to the front :-)

I think I am getting the hang of the directory structure on Github. Is it correct that some of the
"V1" files still need to be printed, UNLESS there is a replacement in the V2 folder?
Open Source Turtle Robot (OSTR): Page 42
Thanks

Nick
This project was great! My eight year old children were able to complete it, with some help from
me. The Tindle kit had everything we needed, and the instructions are very accurate. The kids
enjoyed soldering the boards, although they did need some help in attaching the adafruit, as the
pins are quite tight. Rob was great about providing support and suggestions, and really went
above and beyond to create a great project, and something that motivates kids to keep learning
about programming and the wonderful world of robotics. Thank you!!!

Thanks for posting the picture! I love seeing the results of all that work paying off!

Just a heads up, the notes above about the resistor values are incorrect. The 10K is Brown-
Black-Orange-Gold, and the 100 ohm is Brown-Black-Brown-Gold. We should have read the
guidelines first to confirm. Unfortunately we soldered a couple in before we realized our mistake.
Ouch. That was a mistake. Thanks for catching and reporting it and sorry for the extra effort it
caused!
I've updated the step.
Would like to purchase the kit but would also like to see a video of it working is there one?

A video is worth a million words . . .


https://youtu.be/ExhSeAjVGYc
Wow, This is the first drawing bot that I have seen that can actually write decently.

Is there a video of it working?

I like the way you divide into 3 engineering sections in order to build a robot, very well done!

How Nostalgic!
I always wanted one as a kid
Awesome very neat project :)

wow! that is so cool!

Open Source Turtle Robot (OSTR): Page 43

You might also like