element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
NXP Semiconductors
  • Products
  • Manufacturers
  • NXP Semiconductors
  • More
  • Cancel
NXP Semiconductors
Documents FRDM-KL25Z & ARDUINO - Codewarrior Tutorial: Freescale Freedom Robot with Motor Shield & Ultrasonic Module
  • Blog
  • Forum
  • Documents
  • Events
  • Quiz
  • Polls
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join NXP Semiconductors to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Engagement
  • Author Author: MAb
  • Date Created: 3 Apr 2013 12:30 PM Date Created
  • Last Updated Last Updated: 9 Nov 2021 5:06 PM
  • Views 834 views
  • Likes 0 likes
  • Comments 0 comments
Related
Recommended

FRDM-KL25Z & ARDUINO - Codewarrior Tutorial: Freescale Freedom Robot with Motor Shield & Ultrasonic Module

This tutorial was extracted from Erich Styger blog http://mcuoneclipse.wordpress.com with his agreement.

 

image image

 

I have the Arduino Motor Shield working, the Ultrasonic module is pinging around, Christmas brought some small DC toy motors, and a bag of plastic gears is on my desk. All the good ingredients for a small robot: the Freedom Robot!

 

:!: Warning: Multiple Coke bottles have been destroyed, and a FRDM box got hurt during his experiment! :shock: Do not try yourself if you cannot handle it.:-)

 

image

Smile

 

 

 

What I have in mind is to build a small autonomous robot wandering around in th house. Well, ok, at least on table or on the floor of my office. At least it should move :-) . Similar to the many robots on ‘Let’s make Robots!‘ web site which I enjoyed watching.

 

 

Budget

 

After all the Christmas expenses I wanted to do things with a small budget: this means re-using as much as possible, or recycle material available in the house. A given is already the FRDM-KL25Z board for about $15. I want the robot to do something ‘useful’, so I want to re-use the HC-SR04 ultrasonic sensor (around $10). And I have that Arduino Motor Shield available, although it adds another $25. So that would already make $50 of purchased parts.
To build an autonomous robot I’m missing wheels, a chassis, motors and batteries. And for this I want to recycle existing material.

 

 

Motors

 

Small DC motors are very cheap (around $2). But even better: they are in many toys and that way can be recycled. I have several around from old toys.

 

image

Small DC Motors

 

 

The challenge is more that I do not have a data sheet available. Experimenting with them showed that they work well in the 3V-8V range.

 

 

Wheels

 

Looking around for ’round things which could be used for wheels’, I was first thinking of using old CD’s. I made some experiments, but the two DC motors did not give enough torque. So I abandoned the idea and switched to a ‘small wheel + gear’ model. And a bunch of plastic wheel parts were available:

 

image

plastic tooth wheels

 

 

:idea: My local electronic and hobby store sells such wheels.

 

 

As wheels I have found that the plastic caps of soda bottles would be an option. So I have made my decision to use the caps as wheels:

 

image

Plastic Bottle Caps with plastic tooth wheel

 

 

I simply drilled a hole into the center of the cap, slightly smaller than the inner tooth wheel of the plastic gear. Then pressed the inner tooth wheel into the cap. To compensate the distance, I used a metal ring.

 

:!: Make sure you have several caps available. I destroyed several ones until I have found the ‘perfect’ fit. Alternatively it is possible to glue the tooth wheel to the cap.

 

 

Then the wheel gets put on a metal rod:

 

image

Wheel Cap with Metal Rod

 

 

Chassis

 

Question: What could be the chassis for a Freedom Robot?
Answer: The Freedom Box!

 

Actually, the FRDM-KL25Z cannibalized the box of the FRDM-KL05 board ;-) :

 

image

Freedom Chassis

 

 

The metal rod is going through the box. And a second rod with gears gets added. Both rods get drilled through the box.

 

The two DC motors get mounted on top of the box.Two rubber bands help to keep the motors in place:

 

image

Motors attached to the gears

 

 

image

Motor Chassis Top View

 

 

Two wheels are not enough: something else is missing to stabilize the chassis. One way is to use a third wheel, or to use a ball or similar which rolls on the ground. I have found that the plastic caps are usable too: they are cheap and available, and serve as a ‘ground slider’ if there is not much friction:

 

image

Position for ground slider

 

 

With a cap I draw a circle and cut it out. To attach the cap, I have cut the top-most part of an (empty!) bottle:

 

image

Top of Bottle mounted

 

 

Then the cab gets mounted:

 

image

Cap mounted

 

 

Power Supply

 

For an autonomous robot, batteries are needed. The Arduino Motor shield has a dedicated motor power supply connector, and it can pass the motor voltage to the FRDM-KL25Z board.

 

:idea: In general it is a good idea to separate the motor power from the microcontroller. To keep things simple, I used only one battery.

 

But this would only give 3.3V to the FRDM-KL25Z, and no 5V which are needed for both the motor shield and the ultrasonic sensor. The FRDM-KL25Z has a coin battery holder, but again: no 5V :-( .

 

The best option I have found is to give 5V through the USB connector (either OpenSDA or KL25Z). For this an old L7805CVpositive voltage regulator from STM was right at hand. To connect it to the Freedom board, a USB cable got hurt for writing this article:

 

image

Powering though USB

 

 

As battery a LiPo with two cells (7.4V) is used to power the motors, and the L7805CV generates the 5V for the Freedom board:

 

image

LiPo Powering Boards and Motors

 

 

Battery Compartment

 

Why not place the battery inside the freedom box? The black ‘inlet’ box could be easily used for this:

 

image

Inner Black Freedom Box

 

 

Remember that the two metal rods for the gears are going through the outer box? Well, that means that I need to cut some parts of the black inner box to make it fit again:

 

image

Cut parts of the black inner box

 

 

The result is a U-shaped inner box, with that U just fitting above and blow the two metal rods:

 

image

U Shaped Inner Box

 

 

That way the inter box fits into the outer box:

 

image

inner box fits again

 

 

While the sliding of the cap on the underground is desirable, it is not good for the wheels. For this I pulled rubber bands over the wheels:

 

image

Rubber Bands Mounted

 

 

:idea: I loved the look and feel of the original caps. I feel that the rubber bands ruined the look :-( .

 

 

Finishing Robot

 

Two rubber band safety belts keep the Freedom board in place:

 

image

Rubber Bands for Freedom Board

 

 

The Motor Shield and the Ultrasonic Module get stacked onto the Freedom board. And the battery fits easily in the inner box compartement:

 

image

Battery Compartment

 

 

With this, here is it: the Freedom Robot:

 

image

Front View

 

image

Side View

 

image

Back View

 

image

Top View

 

 

Oh, yes, one more thing: my daughter thought that this way the robot is *much* better:

 

image

Modding of a Robot

 

 

Summary

 

It might not be the most robust and advanced robot, but creating it in an afternoon was not too hard, including programming a small demo application. So this might be even something for junior programming and robotics projects. The most expensive part is the Arduino Motor Shield. I was just lacy to build a cheaper one (time is money too).

 

As always, there are multiple ways for improvements:

 

  • Use motors with built-in gears: more expensive, but simpler to use
  • Build a 4-wheel chassis
  • Use toy rubber tires
  • Add a position/wheel/quadrature encoder/decoder
  • Use the accelerometer to detect obstacles (running into it), or use it to sense the ground
  • Separate battery pack for the microcontroller
  • Adding more sensors
  • Improving the moving options
  • Experiment with beer caps instead of soft drink ones ;-)
  • Try different post-it :-)

 

Happy Roboting :-)

  • freescaledocs
  • Freescale Tagged Content
  • kinetis
  • codewarrior
  • developpement-tools
  • arduino
  • Share
  • History
  • More
  • Cancel
  • Sign in to reply
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube