As per the Python Program, the motor will rotate in either forward or reverse direction. In this project, the motor driver (L293D) is given with two control signals from Raspberry Pi through GPIO Pins. They take the control signals from Raspberry Pi and provide the necessary drive current to the motor from the power supply. Motor Driver play an important role in this situation. Hence, we should never connect a motor directly to Raspberry Pi (or any other microcontroller). This is a huge current for devices like Microcontrollers, Arduino, Raspberry Pi etc. This current will then fall down 150 – 200 mA as the motor gains speed to around. A Motor Driver is a special circuit or IC that provides the necessary power (or rather the current) to the motor for smooth and safe operation.Įven a small 5V DC Motor draws a high initial current of around 300 – 400 mA. The main principle in controlling a DC Motor with Raspberry Pi lies with the Motor Driver.
Working of the Project and Code Explanation.Python Program for Controlling a DC Motor with Raspberry Pi.