PWM Generator

January 2017 - April 2017

My robotics coach asked me to make a PWM generator to control variable speed motor controllers. The device needed a screen on it to show the current setting. I started development by looking at the PWM protocol. Because it passes data through repeating pulses, I knew this would make the code a little complicated. Not only did I need to output pulses, but I also needed to read from a potentiometer and update the screen.

The microcontroller I used did not have enough outputs to control two digits of 7-segment displays. I had to learn about multiplexing. The kind of multiplexing I used involves putting power on the positive leads for each segment and tie it to the leads for the same segment on the other digit. Then you output power to the segments to make the digit you want and ground the digit you want to display. Although this only allows one digit to be displayed at a time, pulsing the screen will make it seem continuous.

Someone else on our robotics team built a 3D printed case for the device and we assembled a prototype. Everyone liked the device, so we recruited some freshmen to make them in an assembly line. While they were making them, I explained what each of the parts did and why we were connecting them in that specific way.