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 NPN 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 CircuitHow This WorksThe Circuit
In the simplest explanation, an NPN transistor allows large amounts of current to flow from the collector to the emitter when small amounts of current flow from the base to the emitter. The current flow through C-E can be varied by varying the current flow in B-E.
The NPN 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 NPN 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 NPN transistor as a switch.
For more information on NPN transistors see this NPN Transistor Tutorial.
The diode D3 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