This code and associated hardware implements speed control of a DC motor. Written in micro Python, implemented on an Arduino Nano, and using a BJT transistor
arduino nano
: for sending a pusle width modulated (PWM) signalTransistor
: with appropriate current rating
The
The app as follows:
- Place the motor where the LED is in the preview photo
- Then, drop in your selected power supply with the positive lead straight to the motor, and link the ground to the arduino ground
- The arduino sends a PWM signal to the Base lead of the transistor
- The transistor allows current to flow from the collector to the emitor side proportional to the effective voltage on the Base. Use a PNP transistor to have an inverse relationship and an NPN for a positive relationship.
Python | micropython | arduino | arduino nano | microcontroller
Motor control | DC motor | brushed DC motor | speed control | Transistor
Self taught coding | Mechanical engineer | Robotics engineer | hardware engineer | controls engineer
Brian Lesko | Brian Joseph Lesko
╭━━╮╭━━━┳━━┳━━━┳━╮╱╭╮ ╭╮╱╱╭━━━┳━━━┳╮╭━┳━━━╮ ┃╭╮┃┃╭━╮┣┫┣┫╭━╮┃┃╰╮┃┃ ┃┃╱╱┃╭━━┫╭━╮┃┃┃╭┫╭━╮┃ ┃╰╯╰┫╰━╯┃┃┃┃┃╱┃┃╭╮╰╯┃ ┃┃╱╱┃╰━━┫╰━━┫╰╯╯┃┃╱┃┃ ┃╭━╮┃╭╮╭╯┃┃┃╰━╯┃┃╰╮┃┃ ┃┃╱╭┫╭━━┻━━╮┃╭╮┃┃┃╱┃┃ ┃╰━╯┃┃┃╰┳┫┣┫╭━╮┃┃╱┃┃┃ ┃╰━╯┃╰━━┫╰━╯┃┃┃╰┫╰━╯┃ ╰━━━┻╯╰━┻━━┻╯╱╰┻╯╱╰━╯ ╰━━━┻━━━┻━━━┻╯╰━┻━━━╯
follow all of these or i will kick you