SCRU-FE: Simple C++ Robot with Ultra-sonic Sensor for Education: Arduino UNO Obstacle Avoidance Maze Programming

by rtheiss, published

SCRU-FE: Simple C++ Robot with Ultra-sonic Sensor for Education: Arduino UNO Obstacle Avoidance Maze Programming by rtheiss Apr 19, 2015
18 Share
Download All Files

Thing Apps Enabled

Order This Printed View All Apps


S.C.R.U.-F.E.: Simple C++ Robot with Ultrasonic-sensor For Education


If you make one of these, kindly post your make and modifications/codes/videos etc. so my students can see the progress on SCRU-FE and how far this design has made it around the world!

I plan on using this design to promote the need for a realistic way to teach elementary and middle school students how programming can be simple and fun without the need for expensive kits. Please share/print/code and keep the resources flowing for education!

This Robot build started when my two year old daughter fell in love with an old ultrasonic robot that I built in elementary school twenty five years ago. It's missing parts and no longer works, but she has treated it with love since she was one year old. For her third birthday, I set out to make a sub $50 Robot with easily replaceable parts (see B.O.M. in instructions) that we could make together. The fact that no individual part costs more than $10 and that all parts are easily found or open source gives me the hopes that SCRU-FE will be passed down to her children with all her great memories.

My three year old daughter adores this Robot. She named him Scruffy, so I made up a silly acronym that fits his silly appearance.


Bill Of Materials

Printed Body
Printed Servo Arm
Printed Sensor Mount
(2) Printed Wheel Halves

Arduino UNO
UNO Motor shield (I use the L298P with buzzer, Ping and servo inputs)
Two "Smart Car" Gearmotors and wheels
Two 3AA Battery holders
SG-90 9g Micro servo set
HC-SR04 Ultrasonic sensor
200mm female/female 4 pin cable
High Amperage toggle switch (15A or better still looking for a good source can skip and take a battery out to shut the power off I burnt through a few 5A switches already :()
(4) 25mm sections of wire for motors

(2) F623 bearings (wheel)
(4) M3x25mm socket capscrew (motors)
(1) M3x15mm socket capscrew (neck)
(1) M3x20mm socket capscrew (wheel)
(4) M3x8mm flat head socket capscrew (batteries)
(4) M3x6mm socket capscrew (UNO)
(6) M3 washers (wheel)
(10) M3 nylon locking nuts
several small rubber bands

optional: (3) 12mm long M3 coupler nuts to make internal assembly easier (replaces 6 m3 locking nuts, (4) 12mm (6mm threaded) m3 standoff nuts for the arduino board to give it a more professional look

Tools Needed:

2mm allen key
2.5mm allen key
2-3mm phillips screwdriver (small $2 kobalt set works if you dont have an electrical set)
2-3mm slotted screwdriver
5.5mm wrench (optional but recomended, $4 for kobalt)
small needle nose plies
tweezers (ESD-15 if possible)
Soldering iron with smal tip and solder
small drill
1.5mm or 1/6" drill bit
3mm or 1/8" drill bit
drill bit for chosen toggle switch

Building tips:
After printing the body drill out all holes with a 3mm drill bit except for the UNO mounting holes. On my prints the M3x6mm bolts self threaded in to the plastic itself. If this doesn't work, use 8mm bolts and nylon locking nuts instead.

The wheels need 3 washers or 2mm spacers on either side to allow for clearance from the lock nuts that hold the battery box on. If there is not enough clearance you can use a regular M3 nuts for the battery box or add more washers between the wheel and the body.

Code: the sample code included is a quick working code, however I am no master at C++ nor Arduino so please use it as an example only.

More from Robotics

view more

All Apps

Auto-magically prepare your 3D models for 3D printing. A cloud based 3D models Preparing and Healing solution for 3D Printing, MakePrintable provides features for model repairing, wall thickness...

App Info Launch App

Kiri:Moto is an integrated cloud-based slicer and tool-path generator for 3D Printing, CAM / CNC and Laser cutting. *** 3D printing mode provides model slicing and GCode output using built-in...

App Info Launch App
KiriMoto Thing App

With 3D Slash, you can edit 3d models like a stonecutter. A unique interface: as fun as a building game! The perfect tool for non-designers and children to create in 3D.

App Info Launch App

Print through a distributed network of 3D printing enthusiasts from across the US, at a fraction of the cost of the competitors. We want to change the world for the better through technology, an...

App Info Launch App

Treatstock is an online platform that offers decentralized manufacturing services such as 3D printing and CNC machining for clients all over the world. We offer free and instant access to comparati...

App Info Launch App

3D print your favourite design with NinjaPrototype, a professional 3D manufacture with consistent quality and speed.

App Info Launch App

hello, can you provide me with assembly instruction. video instructions. thanks

Hi dear friend. My name is Reşat Nuri Çobanoğlu. I'm writing from Turkey. I'm teacher too. We want to do ur project in our school. But Me and my students are new abouth Ardiuno. We wrote all 3d parts. and got all electronic staff. We need Map of connection. Or "how is it made ?" videos. If u send us, We will be gratefull. :)

How it can works?
When you use Servo.h you can't use PWM on pin 10 on Arduino UNO, because it on the same Timer?

True, the board I used was good for learning with young students since it was labeled clearly. It did however have downsides.

Edit: for some reason, it worked with PWM motor control on pin 10 with servo.h included - not sure why. You bring up a good point.

good work, not much use shield L298P, although has many advantages. what if the robot is coupled with bluetooth
I wait for another robot work with shield L298P ..

Cuevas4, you woud need some kind of H bridge motor driver, there are many other options out there. I just like that particular board since it easy for students since it is clearly labeled for servo and ping sensor and includes a buzzer. If you look through the other makes you can see what other motor drivers people have used, you would possibly have to modify the pin inputs in the code. Good luck!! Please post your make and country if you get to!

Hi man, sorry, I have an issue, I don't have the L298P so do you think that I could do it only whit an Arduino UNO?

adafruit v1 shield info

Comments deleted.

where are the instructions for this?

he is just promoting some bizness, do not expect any help

So far confirmed makes in 5 out of the 6 habitable continents, anyone know of one made in Africa (I have a lot of unconfirmed locations)? Thanks for making this a great student project to all the makers out there!

Yet another! https://www.youtube.com/watch?v=ATqDLwLBLRY

If you made it, please post your video to the makes and and let me know your location so I can add it to the map!

Another unkown SCRU-FE: https://www.youtube.com/watch?v=g9WudGxOneg
If you made it, please post your video to the makes and and let me know your location so I can add it to the map!

Another unkown SCRU-FE: https://www.youtube.com/watch?v=w64z-F4mwp4&t=0s
If you made it, please post your video to the makes and and let me know your location so I can add it to the map!

hello, could you tell which parts of electronics did you used? please

The bill of materials is in the instructions tab, If you have anything that needs to be explained more please let me know. SCRU-FE can be made with any arduino UNO compatable board and any motor shield that you have the pin-out information for. I like the L298P motor shields, however be careful not to ground out the B motor contacts (on the back of the motor shield) on the UNO usb port (a couple layers of electrical tape works fine) or else you will run into problems. I also started using battery boxes with switches attached to simplify the build a little.

Can you provide a wiring diagram?

I am not sure what a wiring diagram would include other than the batteries are in series. Everything else is dependent on the motor shield that you use.

How about for the shield you used?

I really like this shield for student use because it is all labeled. Ping goes to the UltraSonic Sensor, servo goes to servo, Motor A goes to Motor A, Power goes to power etc. For the Pinout see the example code, it's a pretty nice board, just watch that you don't ground the motor solder joints to the arduino Uno USB port (if it is a ful sized usb port).

SCRU-FE makes cover 3 continents! Europe, North America and South America, anyone on another continent please chime in!

This looks awesome. I'm a teacher / robotics club coach in Australia. I've just downloaded your project. Hopefully I can get it up and running on our continent for you. Nice work! :-)

Made key chains for presentation giveaways: http://www.thingiverse.com/thing:818595

Robot Keychain - Promote SCRU-FE and programming in Education
by rtheiss

Updated the servo arm # 2 to work better with larger nozzles and faster prints, worked great with a .75mm nozzle