I figured out how to successfully drive a large LED bank with external power by the same circuit that powers the "C" LED on the APM 1.4 shield. I am thinking of putting together a how-to Blog post with the circuit, but I'm just wondering if there is any interest first?
Basically just using a simple MOSFET triggered off a pin on the IMU shield, you can drive a virtually unlimited load while drawing "virtually zero" amps on the APM board.
The idea behind it was that I can't see the LED's when the APM is in my heli. I wanted external LED's to signal armed/disarmed. I'm going to be using the same LED's for navigation lights.
I figure you quad guys might be interested too?
I'm using the relay as described here, but will use a FET with the APM2 board, given the lack of relay.
Yup, I thought about using the relay, but I figured since there is already a circuit on the APM doing exactly what I want, might as well just tie into that instead of duplicating it. And now I can still use the relay to do something else anyway.
Fair points - though I find it useful to flash the lights as voltage drops. Each to their own :)
No, I think it's a great idea. I will probably use both methods on two banks of lights.
Or, I may investigate using the programming logic he used to make the "C" LED flash, and then still have my relay free.
And it was fun learning how to use a MOSFET anyway. ;)
I think I'm also going to start a new section in the Arducopter Wikipedia where some of these really great User Hacks can be stored so people can find them.
So could this work on the GPS fix light as well? I thought the GPS light was "C" and the Armed was "A"?
Yup, it can work for any of the LED's. You're probably right, A instead of C, I'm not at home right now so got them mixed up.
I had actually thought of just such a thing with the GPS as well.
You can even use the same technique to drive any kind of power circuit off any open output for the Atmega. Using a FET has an advantage over the relay since it's perfectly happy switching at a high frequency. You could have a 10-step voltage sensor that tracks your voltage all the way down.
There has already been some effort on that subject. I've started a blog on my showleds (the ones that marco was also using) but was waiting for a good oportunity to make a video of them in the dark before I publish it.
I basically uses a ULN2803 darlington transistor array chip (less then $2), driven by 8 outputs of the oilpan (PortK). The idea is based on work from Max Levine in this post : http://diydrones.com/profiles/blogs/321-blink
There is some work scattered around, like here : http://diydrones.com/forum/topics/led-lightshow-for-arducopter-hexa
So a how-to blog where all the led stuff is centralised would be a very good think in my opinion. I'll make one eventually, unless you beat me to it :-)
I was also thinking of incorporating the gps status led into this, but haven't done so. Feel free to base yourself on my code for that if you like (as long as you give me credit for the original)
Below are the latest usercode files for the showleds.
Here is the zip file with the usercode
Thanks for that. I put a couple of those into the Hacks wiki page. Good stuff.
Now, I'm an electronics newbie, so what is the reason for using a darlington transistor instead of a FET? I almost used a transistor (not darlington) but determined that it was going to be required to draw about 40mA to switch my 0.25A load. Then I found an MOSFET in my bag of electronic junk and realized that was the ticket.
I know that darlington resistors draw even less power. But it seems to me like transistors are great when you want to vary the power, but FETs are better if you're really just looking for an on/off switch?
In any case, now that I know there are those dedicated PINs, I'll probably move my circuit over there. Then I can have them come on when the motors are armed, and blink when the battery is low. Thought first I guess I have to bring my battery power in to the board. Something I haven't sorted out yet.
You are right, but I mainly used the darlington because :
1) Max Levine used it too
2) It's cheap ($2 for 8 ports)
3) It comes in a nice IC that provides 8 ports, so you only need 1 component
4) It does the job
You are right that for switching on/off a mosfet would probably be better. It has less voltage drop and less powerdissipation into heat, so it runs cooler. For motors, or something that draws considerable power (a few amps) this could be important. The ledstrips however draw about 200-300mA per meter at 12V, so it doens't really matter that much I think.
If mosfets are also cheap and come in IC's with multiple ports, then I'd take mosfets.
But I'm not electronics specialist either :-)
To bring battery power into the board you must solder the 4 resistors that came with the oilpan and then connect the voltage of the battery to the oilpan on AN0 and GND pins (yellow and black wire in picture below :
Then you can get the battery voltage with the read_battery() function in arducopter software.
Yeah, I know, but I also have to refigure the voltage divider resistors because my flight battery is 8s. Not a huge deal. It's on my list to do.
I found this part, a 4-channel MOSFET chip. That would probably work.
Just unfortunate the minimum order quantity is 80...
These dual channels are availabe in MOQ of 1, only about $4 each. Rated at 8A. 2 of these would work well.