This research focused on preventing collisions between cyclists and heavy goods vehicles (HGVs). A collision avoidance system, designed to avoid side-to-side collisions between HGVs and cyclists, is proposed. The cyclist's motion relative to the HGV is measured with an array of ultrasonic sensors. The detected distances from ultrasonic sensors are processed in real time to construct a smooth trajectory for the cyclist. The controller assumes constant acceleration and constant yaw rate for both the HGV and the cyclist and extrapolates the relative motion forward in time. The HGVs' brakes are engaged if a collision is predicted. A prototype system was built and fitted onto a test truck. The proposed collision avoidance system was tested in real time and proved to be effective within certain speed ranges.