Follow the Snap Circuits platform!
OverviewWhat Are Snap Circuits?
Snap Circuits makes learning electronics easy and fun! Learn how to integrate Snap Circuits with your hardware. Fun for Kids!
Introductory Project
If you have not completed the introductory project, please see Snap Circuits - Introduction. This project also contains a complete index of Snap Circuit projects.
Let's Get StartedProject Objective
This experiment will demonstrate how the Snapduino can control an analog motor using an PNP transistor.
Building the Circuit
The minimum set requirement for this project is SC-300 and the Snapduino. Build the following circuit by following the directions in the PDF file:
Scroll down to see and download the PDF file containing complete build instructions (the PDF file can also be found in the GitHub repository).
Completed CircuitThe Circuit
In the simplest explanation, an PNP transistor allows large amounts of current to flow from the emitter to the collector when small amounts of current flow from the emitter to the base. The current flow through E-C can be varied by varying the current flow in E-B.
The PNP transistor allows us to control a device that requires a large amount of current using a device only cable of providing a small current. The pin on the Snapduino cannot provide enough current to make the motor turn. So instead, the output of the Snapduino pin is connected to the base on the PNP transistor. The collector is tied to the motor and an external power supply large enough to drive the motor (batteries in this case).
In this experiment we are not varying the speed of the motor so we are essentially using the PNP transistor as a switch.
For more information on PNP transistors see this PNP Transistor Tutorial.
The diode D1 is there to block the motor back current to keep it from flowing back into our circuit. When the motor runs, it builds up an internal current that is released when the motor stops. This current (with a voltage spike) can damage the transistor or the Snapduino.
The Software
The sketch in this example sets the Snapduino pin to output mode and then toggles the pin between HIGH and LOW for three seconds each. This results in the motor running for three seconds and then turning off for three seconds, repeating this pattern indefinitely.
Comments