Lightning McQueen was created by Group 21 for UCT's 3rd year Mechatronics Design course. Her goal was to safely navigate a line marked out on the laboratory floor and come to a stop 10cm from a board placed at the finish line - as fast as possible. I'm very proud to say that she was the winning vehicle!
The guts of the design are a set of infrared sensors interfaced to an STM32F0 micro-controller, with logic written in C (Check out the code here). Here are some photos of the finished product and the build process.
![](https://cdn.myportfolio.com/fa4a402f-9adb-4247-b58b-ace962d7b34f/e8f88bcb-9b70-4cbe-b5de-670751ff436d_rw_1920.jpg?h=489a6aef19407fbf35a85ec87238ac37)
![](https://cdn.myportfolio.com/fa4a402f-9adb-4247-b58b-ace962d7b34f/7b2f80b8-be96-439e-8310-63c50a51494b_rw_1920.jpg?h=c7dc61a060804f48556dad314f7bd953)
![](https://cdn.myportfolio.com/fa4a402f-9adb-4247-b58b-ace962d7b34f/b4cf8543-0819-4c6f-bd7e-4cfcff5e79ca_rw_1920.jpg?h=49badd9a2f887422bc9bd1706f9a720b)
![](https://cdn.myportfolio.com/fa4a402f-9adb-4247-b58b-ace962d7b34f/a4839c5d-8f00-4f44-9461-53f757e5a1c3_rw_1920.jpg?h=f136943e34af5d4b184855a903ba4b94)
![](https://cdn.myportfolio.com/fa4a402f-9adb-4247-b58b-ace962d7b34f/2120d574-f130-4896-9334-e3f2747ce83d_rw_1920.jpg?h=822173ac29a5b3cf66a4499e1bdfb490)
![](https://cdn.myportfolio.com/fa4a402f-9adb-4247-b58b-ace962d7b34f/49b50863-530e-4338-aedf-1fe942dbb21d_rw_1920.jpg?h=916024107941e3fe33d50cb6078f81cf)
![](https://cdn.myportfolio.com/fa4a402f-9adb-4247-b58b-ace962d7b34f/f2ad6c14-19bb-47e0-b3e3-183911a8f917_rw_1920.jpg?h=329af52e60fce3bcc1af569cc2f16d1c)
![](https://cdn.myportfolio.com/fa4a402f-9adb-4247-b58b-ace962d7b34f/4fadc38a-78f4-46f2-8f4e-b5fea06f1f2e_rw_1920.jpg?h=4aae960e3a0b1d75ad0f612694b385fe)
![](https://cdn.myportfolio.com/fa4a402f-9adb-4247-b58b-ace962d7b34f/ac994873-5af5-4f2e-aa5a-4bf4a1ded3ca_rw_1920.jpg?h=bc6c5cf00887f2bd5f71e2e68cdc670f)
![](https://cdn.myportfolio.com/fa4a402f-9adb-4247-b58b-ace962d7b34f/c4258fdd-f4d5-4159-b17d-672bb0927c63_rw_1920.jpg?h=36dcc5e5db0a80b683b0d28b8fc1d724)
![](https://cdn.myportfolio.com/fa4a402f-9adb-4247-b58b-ace962d7b34f/16596103-cdd1-4f1e-81f2-591e03a8f440_rw_1920.jpg?h=5cc25eb954f64b2b8c8b2b0c60002bb3)
![](https://cdn.myportfolio.com/fa4a402f-9adb-4247-b58b-ace962d7b34f/0faf0432-8236-4725-a4f4-106a23f8c115_rw_1920.jpg?h=06830ad2be9309dfcf3d8754877e4408)
The Process
Hover over or click on an image to see more info.
![Initial mechanical design](https://cdn.myportfolio.com/fa4a402f-9adb-4247-b58b-ace962d7b34f/36e1cfe7-0185-4b21-b532-adf36f1abfa1_rw_1200.jpg?h=8ec2298bd1c79f065cc57fd1f67100dd)
Initial mechanical design
![First sensor module prototypes](https://cdn.myportfolio.com/fa4a402f-9adb-4247-b58b-ace962d7b34f/5ef46e13-ca49-49dd-b1b0-17092d036cd2_rw_3840.jpg?h=c67067409f0b9c3bd3dea47c71a81f83)
First sensor module prototypes
![Sensor drivers completed](https://cdn.myportfolio.com/fa4a402f-9adb-4247-b58b-ace962d7b34f/270e020d-c348-4d8e-814f-df0db6476358_rw_1920.jpg?h=809b59fd211719df238d6040ba1d6f7c)
Sensor drivers completed
![Modular line sensor design completed and built](https://cdn.myportfolio.com/fa4a402f-9adb-4247-b58b-ace962d7b34f/f94c3dce-0362-49d2-aa7c-4b2ba8d33c05_rw_3840.jpg?h=b804d8d19b1dc1ea37394be97144ed84)
Modular line sensor design completed and built
![Figuring out component placement on the chassis](https://cdn.myportfolio.com/fa4a402f-9adb-4247-b58b-ace962d7b34f/2fea356c-d70b-4fc1-9d90-7fee59242bfc_rw_3840.jpg?h=1842d718e40ef16bfcc29e35cdf5f660)
Figuring out component placement on the chassis
![Parts arrived!](https://cdn.myportfolio.com/fa4a402f-9adb-4247-b58b-ace962d7b34f/9e76ac0e-1c2b-4a13-88f8-3641867ff968_rw_1200.jpg?h=ee058d126c19b14562c22b9d89a180b4)
Parts arrived!
![Velcro base and motors affixed to chassis](https://cdn.myportfolio.com/fa4a402f-9adb-4247-b58b-ace962d7b34f/a008c3b0-b0bc-41fd-8988-afd7faf2c948_rw_1920.jpg?h=736569b4957f89fa832b4ea0cc0eb433)
Velcro base and motors affixed to chassis
![Preliminary layout testing](https://cdn.myportfolio.com/fa4a402f-9adb-4247-b58b-ace962d7b34f/10e6f3a9-cf0d-4c26-916d-aa4e4d9fb231_rw_1920.jpg?h=34364dce28fdd5d21b6f57fd2e125032)
Preliminary layout testing
![Everything fits!](https://cdn.myportfolio.com/fa4a402f-9adb-4247-b58b-ace962d7b34f/f01a6e5c-48da-4c68-aa07-53b25c7cb4ed_rw_3840.jpg?h=9c92bbba11fbac208271d2898722908b)
Everything fits!
![Novel plug design...](https://cdn.myportfolio.com/fa4a402f-9adb-4247-b58b-ace962d7b34f/72050a7f-838d-46bb-a74e-0b4f682ae58a_rw_3840.jpg?h=6741000dc49f6ea4470b3405af4aec13)
Novel plug design...
![Initial bodywork design](https://cdn.myportfolio.com/fa4a402f-9adb-4247-b58b-ace962d7b34f/09a0ddee-9add-4186-ab3f-8eab046ac466_rw_3840.jpg?h=8fb7ad4f4567f7f415267e05a81c4192)
Initial bodywork design
![Bodywork designed and cut](https://cdn.myportfolio.com/fa4a402f-9adb-4247-b58b-ace962d7b34f/b4745ac8-e178-44df-90b8-ad36d4fec7c9_rw_1920.jpg?h=b5329dc7aa71bd3f0082e9b01ada41e3)
Bodywork designed and cut
![We found a spoiler!](https://cdn.myportfolio.com/fa4a402f-9adb-4247-b58b-ace962d7b34f/d9b62bc9-08a2-421d-a1d2-9af314607249_rw_1200.jpg?h=2c54a00414043675e16738d583fe022a)
We found a spoiler!
![Bodywork painted and ready to go](https://cdn.myportfolio.com/fa4a402f-9adb-4247-b58b-ace962d7b34f/5814353c-3f61-4f27-9871-79912d7bb02c_rw_1920.jpg?h=08ffda1440c4010b590b16dfb5817782)
Bodywork painted and ready to go
![It fits!](https://cdn.myportfolio.com/fa4a402f-9adb-4247-b58b-ace962d7b34f/17a1b463-bdba-4432-b483-aee25cc79ddc_rw_1920.jpg?h=b079f06bc9e127d245eac5f25188c4e6)
It fits!
The Team
Group 21 celebrating our win. From left: Kabir, me, Max and Ameen.
![](https://cdn.myportfolio.com/fa4a402f-9adb-4247-b58b-ace962d7b34f/cc42cb2f-4119-4d2d-998f-21c3899ab6b0_rw_1920.jpg?h=6185e06ec23464576f1e703bca734ccf)
![](https://cdn.myportfolio.com/fa4a402f-9adb-4247-b58b-ace962d7b34f/d21fb87c-483a-4860-b0f9-7b74023e3dc1_rw_1920.jpg?h=41e400630ebbd8e684d6584b2aed844c)
The Task
A video of Lightning McQueen navigating the course. The cable max is holding is delivering power - batteries were only used for the final runs.