modular design - cockpit power mgt

Hi, first post, but hopefully not a painful one.

I'm building a cockpit sim and I'm trying to get my head around the necessary hardware requirements. I'm fine with the programming of an Arduino, but I looking to learn more about the electronics parts of it and my question is about powering my contraption.

My current plan is to using a AC/ to DC 12v, 5A power supply to drive the necessary parts I'm building.

I plan to use the following stepper as part of the motorized throttle and that would take the 12v power through the driver board to the stepper:
NEMA11 Bipolar 0.67A 6.2v single shaft

The driver would be a A4988 plugged into a Banggood motor driver expansion board

I want everything to be powered from the same 12V power adapter to avoid multiple wall warts.

Can I just use a buck converter and it connect to the same 12V line that feeds the stepper and have the buck converter output a 5v line for my cockpit modules?

The 5v line would be used to power the Stepper driver logic side, an array of LED indicator lights and other digital displays such as 6 x 8digit 7segment displays.

The arduino would be powered via the USB connection that is needs to communicate with the PC.

I figure it would be better to not power anything through the arduino directly as I have stuff that that will exceed it's current availability.

Second question is that I want to be able to turn on/off various sub sections, and figure I could use a NPN transister switch controlled by the arduino to toggle power the various displays and stuff.

Am I going about this the right way is keeping the low/high power sections separate while still being on the same line?

Yes, the Arduino max through the board current is 200mA, half that continuous is reasonable regardless of what any pin can take.

You want to use MOSFETs for anything but low power where at least the BJT isn't wasting much. MOSFET gate only draws current to charge the gate, that's all your pin sources and you may need a resistor to protect the pin for that short time. MOSFET gates can have high capacitance.. but not all.

Window shop and read up on MOSFETs before you buy. I found different deals and had to use crib notes to read datasheets before I went for what I got. I made sure that mine would open full with TTL 3V/5V on the gate.
I jumped for some 2N7000's that can handle 250mA max.... ooops but they were only 10 cents each.
I found IRLZ44N's on eBay and got some discount buying 60 for under $10 shipped! They conduct like 15A at 60V.

There is a guy on YouTube with the channel name addohms (or is it AddOhms?). He has a MOSFET video that explains it all, it's where I got my (long lost) crib sheets to look up what was on sale. He also made the "Post Your Code" song video.
If you watch the MOSFET video enough times, it starts to soak in a bit. I wonder if he ever made the DVD with the shows?

Thanks for the reply. Where were you suggesting for the MOSFET be used?

I was planning on BJT as power on/off switches on the 5V line parts (such as the stepper driver), lights circuit, etc... as most things I was going to use could be powered individually via the arduino, just not all at once (hence the external power source.

I figure with the 8digit 7segement displays that only use 40mA each and I'll have 4 of these in series. As I'll be wanting to switch them on/off, is there where you mentioned I could be using MOSFETs? I figure with the low current, a BJT might be OK?

Figured I'd ask and see if I missde something in my research.

Separate question - is there any conditions I need to worry about any current coming back through the logic/signal pins of the Arduino with the various devices I'm controlling?

There's a few chips I'm fine with creating my own circuits (MX7219 & IO Extenders) from datasheets. The rest I'm trying to keep the connections modular with breakout boards and modules so it'll just be the power and relevant signal wires to the arduino / IO Extenders.

Chips being controlled:

5V:
4 x MCP23017 IO Extenders (for button / toggle switch / rotary dial array)
2 x adafruit 16x8 LED matrix HT16K33 (via I2C for LED)
1 x LCD1602A 16x2 LCD Dot MAtrix display (via SPI connected to Interface board)
4 x MAX7219 (via SPI - for 8digit segement displays)

5v / 12v:
1 x Stepper motor
1 x driver expansion board & A4988

Maybe:

  • looking at adding 3 additional steppers (all ~0.6A 6v) for a FDAI display
  • Might also add a servo controller board and 8x servos (servos will only be 9g low torque for indicator dials)

If I do the maybes, I'm pretty sure I'll need a beefier power supply as 5A probably won't cut it for all that, more steppers AND servos.

There's different MOSFETs, N-type and P-type. You get what fits in your design and you study to find out not just that tidbit but how to get what you need out of datasheets.

The AddOhms MOSFET tutorial video is probably less than 20 minutes long, for example. Is that too much?

If you put more than 5.5V or negative volts on an Arduino pin that inputs, it will burn.

If you connect an inductive load (anything with a coil, like motor) and don't put in the backsurge diode then you can get smoke out of project parts and maybe the controller too.

Ordinarily though we set up circuits so the OUTPUT HIGH sources current from a pin and OUTPUT LOW sinks current. A digital read on a pin moded as INPUT will 'eat' 1 microamp of charge but can do that a few times per microsecond.

5A is a lot if your motors are small.

The 7-seg displays are 40mA Maximum. They should be bright at half that and last a lot longer, 10mA is probably good depending on background light. There is an example in the Arduino Playground on using a led as a light sensor that shines the led with PWM most of the time but takes a few millis off detecting how bright the ambient light on it is and adjusts the PWM brightness of the led that you only see shining.

How many of these parts have you tried out and made work already? Do you plan on putting everything together, writing a massive code than -then- debug it all together?

Thanks again for the reply. Also, apologies for not mentioning that I did watch the AddOhms video you recommended. I had also watched ep.10 about transistors which is what prompted my additional question in the last post.

My take away from the vids were that they both can be used for switches and MOSFET would be more efficient due to no current waste at the gate. I'd also need to be selective about which one to use as I'd need the appropriate logic level type for my design.

I understood that using a BJT solution would be 'OK' when switching low level currents and I thought that might be appropriate for the HT16K33 LED matrix element of this plan. As it's <40mA (at maximum - not expected to be anywhere near that) wouldn't that be appropriate for a BJT solution?

From my reading, I'd put the HT16K33 module on the emitter side as that module would still be fine after the voltage drop from 5V to run fine. But I'd need to check/test that the drop wasn't too much.
Nevermind the above - more reading tells me I need min 4.5V for the LED controller and I'm stupid thinking otherwise. So, if I go with a BJT, the load would on collector side with a resistor between pin and base.

Would that setup be fine for a small load? From your response, it sounds like I missed a lot in the video explanation, but I did look into the suggestion of a 2N7000 MOSFET. That looks to work too and would be just as easy to use.

FYI: I'm not set on BJT, I was just thinking about the 'why not BJT' part... I'll probably just use the suggested 2N7000 based on your recommendation alone. I'll still check the datasheets so that it's applicable for my design, but I think I need to do some additional browsing on the 'why' part of that choice. There seems to be a lot of articles on BJT vs MOSFET decision which makes the choice all the more cloudy to understand.

For switching on/off the a4988 stepper module, I learnt that it might be easier to use the built in MOSFET via the Sleep pin available to cut the 12v line to the steppers and put the module into low power mode rather than using an external MOSFET for power control.

I recently found this helpful page so as to learn through failure and several of the cases (especially #3) include those you mentioned. :slight_smile:

For testing all at once - heck no. :o I'll be checking each item on it's own, writing code that works so I understand that component as well as possible on it's own. I'll refactor that code and then add individual systems one at a time to ensure it all works together. eg: Throttle control first with stepper, then (in rough order) numeric displays; indicator light arrays; buttons and switch array; instruments using servos; instruments using steppers.

By making it modular and keeping track of the current draw vs my power source, I hope that will keep things managed. Initial post was to ensure I get my head around things to consider regarding powering of the project with difference voltages. I've read ATX PSU might also be an option down the track.

I fully expect that I'll need a higher speed Arduino than my current Uno for the final build due to speed / memory. But for just learning each of the components, the Uno should be fine I think. At the end of the build, I might even utilise that Uno as a subsystem to just manage LED lights and non time sensitive indicator outputs. (I can live with a 1/2 second delay for the gear indicator for example.)

Sorry - more wall of text:

My experience so far (specifically to this build - I've played around with utilities monitoring with battery powered sensors):

HT16K33 - running 2 quad 7segment displays and custom code. Used to learn multiplexing, modified the adafruit library to generate 8 digit numbers and learnt the wiring required for both chips and LEDs. It's underpowered (datasheet says 4.5-5.5v) at the moment at 3.3v and draws 14mA with all '8's across all 8 digits (no dot points), so it'll draw the expected 20mA (on max brightness) once I move it to a 5V supply and <10mA on the lowest brightness (which would be the ideal level).

Note: I know it's not the most appropriate chip for driving quad 7 segments displays (no internal alphabet, etc...), but it was on hand and it forced me to learn a few things at once just to get it to work. I'm plan to tear it all down and use the knowledge about the array for the individual LED indicator lights in the cockpit.

MAX7219 - still being delivered, but from my messing about with the HT16K33, I feel better about the possibility of playing with these, the 7segment displays and writing code for it once they arrive. I also think it'll be better to power them in groups of 4 in series to ensure sufficient power.

MCP23017 - No experience on the IO extenders as yet as I'm waiting on a $2 pack of 100 crap buttons. Was only going to use the buttons and other parts just as a practical learning exercise about building and coding for a button matrix. There lots I need to pick up here with button de-bouncing, handling rotary encoders, rotary switches, 3 stage toggles and the coding needed to handle each. Not relevant to this power chat though. I'll put up a separate post if I get stuck, but there is a lot of reference material out there already.

Steppers & Servos - I'm hesitant with these due to the required higher external voltage and all the things to cater for in the reference link I mentioned so as to protect the Arduino pins. This hesitation is also what prompted me to avoid powering anything through the Arduino at all so I would learn more about power control in circuit design. I plan to use the Arduino for logic control and build/utilise the required circuits to disable power to the systems when required.

A BJT is fine for small current, the waste from 40mA will be tiny.
By the bag, BJT's are cheap. FETs cost more and they are extremely sensitive to static, 20V can ruin a FET.

I watched AddOhms video more than a couple times using the pause button while cribbing notes. For a while there I could walk through the selection process without em but 2 or 3 years later I only remember highlights and don't-dos.

I've revisited button debounce with a sketch.... debounce is a du jour thing here, there's so many ways to debounce.
https://forum.arduino.cc/index.php?topic=531402.0

Some of what you want is covered on Nick Gammon's site. I show 3 addresses below, he covers many topics very well.

Just backing up a bit, you mentioned:

GoForSmoke:
5A is a lot if your motors are small.

The 7-seg displays are 40mA Maximum. They should be bright at half that and last a lot longer, 10mA is probably good depending on background light. There is an example in the Arduino Playground on using a led as a light sensor that shines the led with PWM most of the time but takes a few millis off detecting how bright the ambient light on it is and adjusts the PWM brightness of the led that you only see shining.

Are you just saying I've over spec'ed the power supply? OR am I doing something that will cause damage to the motors / PSU / elsewhere in project?

Reason I listed 5Amps is so I have to spare capacity to expand extra steppers / servos later on.

Just thinking about power requirements for stuff that draw more that 200mA:

  • There will be about 6 to 7 steppers, each ~0.6A/phase NEMA8. Although I might switch 2 over those to DC motors (haven't got a spec for those yet).

  • I also expect to need to use a servo controller board with about 8x 9g servos and they draw about 600mA-ish at max, but the exact draw number will depend on what servo I end up choosing.

Not everything will be driven to it's max at the same time (although I do plan to add a current monitor to keep an eye on what the draw is at any point in time), so I figure a 5A would do for a while until I expand past it's available output.

I also thought I might change from a buck converter to get a 5V rail from the 12v power supply.
I'm thinking I might get a dual rail MeanWell 5V/12V power supply as I figure that'd be a little better than the buck.

wile1411:
Just backing up a bit, you mentioned:

Are you just saying I've over spec'ed the power supply? OR am I doing something that will cause damage to the motors / PSU / elsewhere in project?

Especially with switching power supplies, you always want a wide margin of extra capacity. The more that a switcher (the efficient type as opposed to boat-anchor linear supply) loafs, the longer it will run. Having twice the capacity as your requirements is a nice insurance policy since as the PS dies it sends spikes that have killed many a PC/card/drive/etc. I've built my own PC's since 1986 when the clone parts arrived and extra power has been my rule all along. If you need 2A, get at least 3 but 5 is better especially if you plan to use more, which you do but might plug a heftier supply in later.

With power loads you only need to count how many run at the same time.

Reason I listed 5Amps is so I have to spare capacity to expand extra steppers / servos later on.

Just thinking about power requirements for stuff that draw more that 200mA:

  • There will be about 6 to 7 steppers, each ~0.6A/phase NEMA8. Although I might switch 2 over those to DC motors (haven't got a spec for those yet).

  • I also expect to need to use a servo controller board with about 8x 9g servos and they draw about 600mA-ish at max, but the exact draw number will depend on what servo I end up choosing.

Not everything will be driven to it's max at the same time (although I do plan to add a current monitor to keep an eye on what the draw is at any point in time), so I figure a 5A would do for a while until I expand past it's available output.

7 steppers at 0.6A each gets you 4.2A. Watch your head already.

8, 9g servos at 600mA total? Oh... cockpit dials. What about the artificial horizon? What vintage planes? Will you need MFD's?

And everything at once.

I'd be looking at a half-loaded 10A PS lasting way longer than a full-loaded 5A PS.

I also thought I might change from a buck converter to get a 5V rail from the 12v power supply.
How many Amps of 12V?

I'm thinking I might get a dual rail MeanWell 5V/12V power supply as I figure that'd be a little better than the buck.

I got some generic OEM supplies on eBay that are cheap for the quality. The enclosure and much else for 25W is the same for 50W, price per Watt gets lower with more Watts. They do have a voltage adjustment screw, you buy capacity. If you can mount the 25W supply, the 50W will fit the same, I kinda like that.

They're having a sale too, here's a twofer 12V 5A for $14.50 from US warehouse so no 3 to 5 weeks delivery,
https://www.ebay.com/itm/Universal-12V-1-3-5-10-15-20-25-30A-Switching-Power-Supply-Driver-for-LED-Strip/162812840246?hash=item25e866c936:m:mELIhsWasVg6Rchec50gvFQ

In your cockpit, run thick power lines and make a frame you can ground anything to.

GoForSmoke:
I'd be looking at a half-loaded 10A PS lasting way longer than a full-loaded 5A PS.

They're having a sale too, here's a twofer 12V 5A for $14.50 from US warehouse so no 3 to 5 weeks delivery,
https://www.ebay.com/itm/Universal-12V-1-3-5-10-15-20-25-30A-Switching-Power-Supply-Driver-for-LED-Strip/162812840246?hash=item25e866c936:m:mELIhsWasVg6Rchec50gvFQ

Thanks for suggestion - unfortunately, they don't ship outside the US. I've found that a lof of the stuff from China 'says' 10A, but only can push 5A due to components - so I'm a bit leary of ebay for something like this.

I have a 750W PSU for my PC...... they're < $50 by now.