Blog How to Make a Cargo-Handling Robot with Rollman - Arduino Projects

How to Make a Cargo-Handling Robot with Rollman - Arduino Projects

Remember the Lego robot you played as a child, or the cargo truck we usually see on the dock? They fetch cargos from the sorting center and transport the goods to the destination. Seeing them hustle and bustle is quite an interesting experience.

Today let's try to make such one! Use Rollman as a carrier vehicle – go to the sorting center following the line; once the ultrasonic sensor in the center detects the vehicle, it'll open the door automatically and pour the cargo into the vehicle; then the carrier "truck" will carry the goods along the set route to the destination, unload and go back to the center again. It may need many components and devices to make one, but the process is quite inspiring.

Sound funny? Check how we make it!

Check the video here:

Prepare Materials

Assembled Rollman

3 boxes

Some ping-pong balls

Battery holder

4 18650 batteries

Uno board

Sensor Shield (Uno extension board)

2 servos

Ultrasonic module

Several wires

Glue gun

Soldering iron

Needle-nose pliers

Wire stripper


Cable spiral warp

3D-Printed acrylic plate


Step 1: Make Two Cargo Containers

Three boxes are used here: one to be fixed to the Rollman to load goods, one to the sorting center, and another at the destination to receive goods. Their size should be about 10 x 7 x 7cm; avoid making them oversize or too small or they will be too large or heavy to carry, or too tiny to convey goods.

Take one box, cut out its roof and stick tight the card stocks on the sides. In its front, dig and cut a slot of 5x5cm, and then at the lower left corner (facing slot side) a more slot of 1x1cm, making the whole slot a square hole with a bulge.


It should be like this:

Make a door for another container similarly.


Step 2: Make a “Door” for Container

Place the servo on the bottom of the box, align the shaft with the slot, and fix it with glue. Cut the paper sheet (the roof of the box previously cut out) into a 6x5 one, insert the screw packaged with the servo through the sheet from the white side, fix it with the glue gun, put the round rocker arm onside, and insert the servo shaft into the rocker and fasten with screwdriver.


Step 3: Extend Servo Wires

Since Rollman is connected by the RJ11 port, connection with the servo needs adjustment. First carve and cut out another slot on the bottom of the box. Cut off the 3-pin socket of the servo wires and one end of an RJ11 cable. Note: There are 8 wires in the RJ11 cable and you need to connect some with the servo ones – green one to brown wire of the servo, blue one to the red, and black one to the yellow wire of the servo. And remember to wrap each connected wire with black tape in case of short circuit.


Step 4: Make Container Brackets

Take two rectangle components (sensor mounts in Rollman kit) and combine them into a ladder-like shape. Glue them to the side of the slot of the box.


Repeat the procedures and make another box, like the following ones:


Step 5: Fasten the Containers

Fix the box to Rollman with a long plate, and plug the servo to port S2 at the back of the Rollman.


Step 6: Make a Sorting Center

Make a bottom board by 3D printer (or find a long hard cardboard), fix the Uno board and a cuboid stand (motor box in Rollman kit) to the bottom board with screws, and fasten the battery holder on one side of the stand, and another box, with servo attached, to the top of the stand. Fix the ultrasonic module at some point (height refers to that of the box on the Rollman) on the upper cuboid of the stand.

Don’t forget to connect the Uno to battery box.


Step 7: Wire the Sorting Center

After the sorting center is built, connect the ultrasonic and servo to the Sensor Shield.



The orange wire of the servo to Pin 3 (signal) of the Sensor Shield, red wire to VCC, and brown one to GND.

GND of the ultrasonic to G, VCC to V, ECHO to Pin A0, and TRIG to Pin A1.


Finally they're all completed! Remember to mount batteries to the Rollman and the Sorting Center.


Step 8: Download and Upload Code

Download the code at and extract.

Delete -master in the name.

Before upload the code to the Uno board, add the library Rollman by Sketch -> Add ZIP Library, find the Rollman library file and click Open.

Add Cargo_Carrying_Car code to the Rollman.

Sorting_center to the Uno board of sorting center.

Remember to select the Port and Board (Uno) before uploading.

Step 9: Make a Map

Take a large white card board, or find some broad white floor, design the transport route and paste the black tape to make the map.



1)  Better to make turnings of an obtuse angle – avoid rectangle or angle smaller than 90 degrees.

2)  Proper width of the route line – making it wider would be better, two piece in parallel is suitable.

3)  Avoid folding or wrinkles when pasting.

Step 10: Calibration

1)  Calibrate the servos (change Cargo_Carrying_Car.ino and Sorting_center.ino)
In the initialization part in the code, the initial angle can be 0 or 10 degrees. Take down the door and place it at the position where stuff in the box are just about to fall down. Adjust the angle of the door and the box based on actual use. Use pins among pin A0-A5 based on the real conditions - accordingly change the pin in the code.


2)  Calibrate the turning speed of the Rollman (modify Cargo_Carrying_Car.ino)
There are curving route and T-shaped crossing in ROLLMAN_DIY, which complies with the right-hand rule. The distance between the black chunk at the stop point and the route end should be 4-5cm; adjust it on the map if needed or modify the code instead (the delay time and the speed i).


3)  Adjust the turning angle (change the code file Cargo_Carrying_Car.ino)
In the ROLLMAN_DIY route, if the programs for each are different, adjust the PID parameters so the Rollman turns according to the curves of the route. Adjust the P and D values in the program.


4)  Adjust the distance to Rollman detected by the sorting center (Sorting_center.ino)
The sorting center needs to detect the distance to the Rollman via ultrasonic and control the opening and closing of the door. So it would be better to adjust the limit of the distance or move the center.


Wow, so everything is done then! The code may be a bit complex but once you understand the principle it is not difficult to make.

Happy time! 


Also published on Instructables:



Leave a reply :