I've posted a few times here and mentioned that I'm really new to Arduino and so I experiment on little projects to better understand things before using libraries and code created by others. With that in mind, here's what happened tonight, lol...
I was given an awesome early Christmas present yesterday. It's a little robot chassis labeled as for Arduino. Here's the link:
It came with 4 wheel drive and 4 motors...the motors aren't labeled and there are no specs on the web site except that they are 3-12v drive motors.
So, I wrote some code to send pwm to two 3904 transistor bases (using pins 9 and 10 on the Arduino) to control a 9 volt battery driving 2 of the motors. I just wanted to see if I could get it to drive across the kitchen floor. I know in the long run I'll want better code and a motor shield or controller....this was just to see Herbert (my robot code name....named after H.G. Wells) drive across my kitchen.
Anyway, all went well for about a minute...then one of the wheels slowed down causing Herbert to turn....then smelly smells...then poof! Smoke from the 3904 controlling the left motor.
I'm guessing I just had too much current for the little transistor to handle but I thought I'd throw it out there to see what you guys thought.....tomorrow I try the same thing with mosfets!
Most likely a current issue... those motors can run up to 5-10A @ 5v or so. Also, probably not the cause of the issue, but as a general reminder, don't forget to connect all your grounds!
Thanks, Jezuz! I checked and all the grounding was good....I had the transistors on a mini-breadboard with a Boarduino....nice ground bus and Vcc bus for the motors and diodes to protect the microcontroller from back voltage...the Arduino clone was powered via USB.
Surfing some other sites it does look like it probably was current or power....everyone says those little motors are power hungry! KaBoom! Nothing like the smell of burning electronics, heh....
Thanks, Brutus....ya know, I had a 1k resistor just sitting on the breadboard and didn't hook it into the circuit, duh....oh well, live and learn! At least the Arduino is okay, it was just the transistor that blew...heh...
In lieu of a motor controller board, any suggestions on the best transistor for little 3-12v motors? I know in the long run I'm going to want an H bridge setup (my robot Herbert is 4wd with now steering mechanism so maneuvering will have to be with the wheel motors) but just to mess around and understand the circuits and the code I just wanna drive the motor circuit without frying my Arduino....
Yeah, I figure if you need more than 5 AMPS you need to start tinkering with bigger parts... but the TIP120 is just fine for most motors. I picked it mainly because they were so common... not because it was a Darlington-type.