Introduction: Linkit One: PWM

Picture of Linkit One: PWM

In this instructable, I will show you how to control outputs using PWM. The circuit that I am using uses a transistor rated at 700 mA. To control devices that use higher voltage/amperage, you will also need a relay.

Pulse Width Modulation simply turns an output on and of rapidly, which can be used for dimming LED's and changing speed on motors.

Step 1: Parts and Tools

Picture of Parts and Tools

Here are the parts and tools needed to build this project:

Parts:
NPN transistor I'm using a (2222a)
1k Ohm resistor
Linkit ONE board
Small DC motor (Or any kind of output) OR an LED
Breadboard

Tools:

Computer with linkit ONE drivers and latest version of the Arduino IDE

Step 2: Wiring

Picture of Wiring

For this step, you can choose the difficulty, you can either plug the led directly into pin 9, or connect a transistor to control higher powered things, like motors.

LED: Put the ground pin of the LED (the shorter one) into the GND pin on the board, and the longer lead into pin 9 on the board.

Transistor: Plug the base of the transistor (centre pin) into pin 9 remembering to add a 1k resistor in between, then the emitter (right pin) to a ground pin, and the collector to the negative pin of the device that you are driving. In my case, the negative lead of a motor. Onto the next step.

Step 3: Upload Code

Picture of Upload Code

Download the code here; then double click it to open it. Now, press upload.

Comments

About This Instructable

226views

4favorites

License:

Bio: My name is Zach Sousa and I'm a Canadian highschool student that has a passion for making.
More by Zach Sousa:CNC Oak Watch BoxCNC Camera SD Card HolderEdge 3D 3.0 - A $200 3D Printer
Add instructable to: