• Sajiv Shah

Basics of Analog & Digital PWM Signals

Updated: Jan 6

Computers all around us today communicate between different devices and sensors using many types of signals. When it comes to electronics like encoders, servo motors, Arduino, and other microcontrollers, the two prominent types of signals are analog and digital signals. Additionally, Digitial signals can be used in PWM form, which allows their pulse to be interpreted in a different way.

So what do analog and digital signals look like?

An analog signal is a continuous wave that has different amplitudes and frequencies. An analog signal can represent data in many different ways, but the most common is to have one time-based variable, and another variable attached to the data that is represented by the frequency. For example, if a specific sensor needs to send temperature values to a microcontroller, the sensor would send an analog wave, and the controller would then read the frequency of the wave in a set time interval. The frequency of the wave would change with the sensor value for the temperature so that data can easily go into a basic algorithm to output the temperature that the sensor is sensing.

Digital signals are square waves that simply represent ones and zeros. They can also be controlled in different ways, one is using something similar to an analog wave. In a set time interval, a controller could simply read the signal as a binary number and compile many digits to form a command or sensor reading. The main signal system on our FRC robot, CAN protocol, uses a method similar to this to send data all across our robot. With a simple starting string letting the controller know that the sensor is about to send commands, and then the set of commands, controllers can quickly get data. But square waves have many other functions. PPM and PWM are two ways of measuring square waves to represent data, which the sensors from my research project utilize, so in an upcoming article, we will look at data from these sensors using an oscilloscope and an arduino.