After a long break I’m back with a new project. This autonomous street sweeper was inspired by the type we have driving around here in Ireland. It started as a simple project to build a 3-wheeler trike using a turntable, and like most LEGO it morphed into something else entirely.
I’m very proud of the compact build on this model. The Power Function motors mounted at the rear add a degree of realism as the “water tanks” used by the sweeper.
The Street Sweeper is rear-wheel drive and rear-wheel steering. The rear wheels are driven through a differential so that they can rotate in place. The large PF motor drives the wheels, and the smaller PF motor turns the turntable.
The NXT needs to know when the rear wheels are pointing in a straight-ahead direction. I tried a number of designs using a touch sensor to detect when the wheels are straight, but ultimately settled on using a light-sensor from the NXT kit. A small white 1×2 plate mounted to the turntable will reflect light back to the sensor when the wheels are aligned to drive straight. It’s not terribly precise, but it works well.
I mounted the “sweepers” on the front of the vehicle in a modular unit. It’s also possible to attach a lawnmower to the front. It’s a tight squeeze to get all of the wiring in place; I tend to use the flexible cables from mindsensors.com where possible. I find the standard LEGO NXT cables too stiff over short distances.
The Mindsensors NXTSumoEyes are used for obstacle avoidance at the front. The rear wheels are turned in the correct direction and the sweeper reverses for a random amount of time, sounding a warning of course!
See also my page showing the final version of this I brought to LEGO World Zwolle!
I wrote the example program for this robot in NXC. It’s pretty simple – just a regular obstacle avoidance algorithm. The fun bit is centering the steering on startup.
Download the NXC source sweeper.nxc.
The full building instructions are available in Street_Sweeper_lpub.pdf (with thanks to Kevin Clague who helped to edit these instructions). This is a very large file at 13MB! However I have also placed the building instructions as images in this gallery for easier viewing online.
The short video below shows the Street Sweeper in operation; it drives around and avoids obstacles.