



- Make sure you have all the required parts before starting. Everything you need is included in the Ultimate Microcontroller Pack.
- First, install the transistor. With the flat part of the transistor facing away from you, the leftmost leg should be inserted into E20 on the breadboard, followed by the other two legs in E21 and E22.
- Next, install the diode. Polarity matters here, so make sure the side with the white stripe is in C16 and the other side is in C20.
- And now, the resistor. Plug it into pins C21 and C26 (polarity doesn't matter here).




- We need to power the circuit with 5V from the Arduino. Use a jumper here, and plug into pin E16 on the breadboard.
- And of course we need ground as well - use another jumper to go from the Arduino GND pin to A22 on the breadboard.
- To control the speed of the motor through the transistor, use another jumper wire to go from Digital Pin 3 on the Arduin to pin A26 on the breadboard.

- Finally, it's time for the motor! Plug the power (red) wire into A16 and the ground (blue) into A20.
- That's it, you're done! Head over to GitHub to download (or copy-paste) the sample code, and have fun!
Trying to figure out the programing of uno, its been a struggle. What I’m trying to actually do, Shrink the electronics on an HO train layout for my grand children. I’ve bought all smd chips,mcp 41010 digital pot, mega328p- pu, L293d dual h bridge and single h bridge,555 timers, caps, resistors, diodes, npn mosfets,4 channel 315 MHz remotes. You name it, I’ve got it. My problem is there is no one code for a dc motor that I haven’t spent less than 3 hours debugging that actually work, the way I need it to. I’ve been looking and playing with my uno now for almost 2 months- 2 weeks off because of heart problems- still no luck. I’m not cutting and pasting, its all copied by hand, word for word, dot for dot. This is for the actual locomotors, track switches activated by reed switches.The goal, turn a loco on with the 315 remote, I’ve piggybacked a latch chip onto a toggle chip of the remotes so you can latch forward and toggle the speed. 1st problem is 41010, I’ve not yet figured the circuit to operate it. I cant seem to get it to toggle up and down, o volts to 16 then back again. So I’ve invested in the uno. I realize the 5 volt max, which is the purpose of the Mosfets. What I want is to operate the uno” Bootloaded” chip with the remote and control the train forward and backward travel and speed up and down. I realize Bachmann has a dcc system as do others but I’m not willing to plop down 800 plus dollars for those systems. Track layout is 40 feet long, one way, 8 foot diameter curve then back. 3 track on main line with side tracks. Kinda complicated. If you can steer me in the right direction I’d greatly appreciate it. Thank you. Henry