Close

Building a new Brain (picking transistors)

A project log for Kerbal Spaceship Potato

This is an input focused control panel for Kerbal Space Program.

matthew-peverillMatthew Peverill 02/11/2020 at 20:240 Comments

Ok my dissertation is handed in! That means I have some time to work on this. I'm starting over on version 3 of the enclosure, because I don't want to spend time getting old designs working (the translation control in particular was not workable - more on that later). Because PCBs take the longest lead time, I'm working on that first. One of my notes was that I should switch to surface mount components and make one board. 

Among other things, that means picking new transistors. I chose a 2n2219 and a 2n3906 for rev 1, following the fairly standard advice to try one of those and see what happens. Only one of those worked, and neither is available in surface mount, which means it's time to actually try and figure out how to pick these. There are two applications where I need a transistor, both related to lighting control. Here are my notes. Keep in mind I am not an engineer, and all of this is me trying to hack something together.

Backlight Control - Enhancement MOSFET

Ok application one is our strip lighting. I have about a third of a meter of LED strip lighting which I bought on aliexpress. According to their site, 1/3 of a meter will consume about .864 W at 5V (we might want to take that with a grain of salt). That comes out to .173 A of current, which we should round up to 200mA.

We need to pick between BJT and MOSFET. This can be done either way, but adafruit suggests MOSFET will use less current, so let's do that.

The Gate of the MOSFET hooks up to the 5V logic on the microcontroller. I'm using a PWM pin so that I can dim my lights.

Most posts of the type 'how do I pick a transistor' punt the question and say 'just use this one'. This was the most helpful guide I found, as it talks about why that is the typical advice AND tells you when it doesn't apply.

According to that page, we need a little more current than the typical application, so it may make sense to choose something carefully. Our dream MOSFET:

Mouser has a page on MOSFETs. I set up filters to only show:

I get 397 results, which I sorted in ascending price order and looked at the datasheet for the first

I see that Drain-Source voltage is 500mA, definitely enough, and that maximum drain-source voltage is 30V. No problems there. I see that the device starts to turn on around 1 V, and is fully on at 3V - perfect. The package type is SOT-23, which is perfectly fine. Switching speed is hardest, but I think I can check it like this: Max PWM frequency on the 32u4 should be about 1kHz. According to this stack exchange post, We can sum the turn on time ( 7ns) and the turn off time (+30ns = 37ns), divide it by the percent time we are willing to spend turning off and on (so multiply by 100 for 1%), and get a period of 3700ns, which translates to about 270 kHz. So we should fine here.

LED Dimmer - Same

Ok our second application is as follows: our panel LEDs are driven by two ULN2803 darlington array chips. We don't have enough PWM for all the input pins, so instead we are using a common transistor to switch ground. We should still be able to use an enhancement MOSFET, which will be appropriate for the same reasons. We're going to drive up to 16 standard power LEDs. Each LED will probably take about 20mA, giving us 300 mA power draw. So we should be able to use the same MOSFET.

Discussions