Posted on Jan 14, 2017 in atmega, {hardware}, energy

Common readers of this weblog may have already seen the article that I printed about Four months in the past the place I tried to reverse engineer a voltage regulator module initially designed to suit right into a Dell server. The speculation was that these can be prime quality, secure and strong designs that would show helpful if I may work out how they labored. They’re definitely price excess of the few kilos you could get them for on ebay as we speak.

I used to be capable of decide the perform of the important thing pins on the module myself by experimentation after which with some assist from eagle-eyed readers on the market on the web we have been capable of determine the module as an Artesyn NXA66 and subsequently a abstract datasheet was positioned that offered the total pinout. To summarise, the primary options of the module are:

  • Selectable voltages of three.3V and a ‘secondary’ degree selectable by the VSP pin.
  • 12V enter degree.
  • 20A (66W) steady present supply on the 3.3V degree.
  • Output allow pin.
  • ‘Power Good’ output sign.
  • Differential distant sense.
  • Potential to chain the modules to share present supply.

It’s price increasing a bit on that ‘secondary’ voltage functionality. I now have a number of of those modules and a few of them have a secondary degree of 5V and others have 2.5V. All of those ranges are helpful however I believe that if you happen to’re planning to observe the design outlined right here then you definately’ll need the three.3V/5V module.

I don’t know of a foolproof methodology of differentiating the 2 modules from their ebay listings. What I can say is that the mannequin with the black heatsink reviewed within the authentic article is a 5V module and all those who I obtained with a silver heatsink are the two.5V module.

Designing an influence provide controller

I made a decision that one of the best ways to use the outcomes of the reverse engineering effort was to design a controller board that will host the NXA66 and expose its performance by way of a entrance panel. I’d throw in a number of easy extras myself equivalent to present monitoring and information logging and at last I’d implement it as a through-hole design in order that it could possibly be applied by folks of all talent and gear ranges.

The top consequence might be a bench-power provide that’s low cost to construct and has a present provide degree larger than that of most provides priced at hobbyist ranges.

Schematic

Click on on the thumbnail for a PDF schematic

It’s a comparatively easy and modular schematic. Let’s check out every of the modules in flip and describe the performance in additional element.

Energy enter and management

The enter to this design is 12V which I envisage to be provided by a generally obtainable energy brick. Care must be taken to decide on a provide that may ship the present required by your output load. On the excessive finish 66W at 3.3V equates to five.5A at 12V plus losses, plus consumption by the controller itself. Should you plan on offering 66W to your load then you definately’d need a minimum of a 7A 12V provide on the enter.

I’ve included a relay between the 12V enter and the NXA66 as a result of I don’t need the module powering up by itself with out being co-ordinated by my controller. I found throughout experimentation that the module goes into an undefined state if you happen to try to change between the 2 obtainable voltage ranges whereas the ability is on and for that motive I need to have the ability to set the management pins to the specified state after which energy up the module. If the consumer decides to change voltages whereas energy is on then I’ll programmatically lower the ability, set the VSP pin accordingly after which energy up the module. An influence MOSFET could possibly be used equally nicely for this switching goal; I tossed a digital coin and it got here down on the facet of the relay.

All of the performance of the module is uncovered to the controller. The slot itself is a 2×25 card edge connector with a 2.54mm pitch and an inter-row spacing of 5.08mm. The VSP and OUTEN pins are switched by MOSFETs and linked on to LEDs that present their present state. Artesyn trace at a requirement for an output capacitor of their datasheet so I embrace a 150µF electrolytic on the output terminal. The output and return terminals themselves are doubled as much as present the next present carrying capability.

PGOOD is an open-drain (or collector) output. Which means that the module can drive it low but it surely floats when excessive so it have to be pulled as much as a excessive degree by the controller. Open-drain outputs are used when the I/O ranges of the controller will not be recognized by the designer. It might be no use specifying this output as a push-pull pin at 12V when the MCU on the board is 3.3V, for instance. I join PGOOD to the MCU with a pull-up resistor and use a separate MCU pin to mild the indicator LED.

Present monitoring is offered by the Texas Devices INA226 in a floor mount MSOP-10 bundle with a 0.5mm pin pitch. Sorry about that. Strive as I’d I simply couldn’t discover a appropriate present monitor in a DIP bundle that got here near the capabilities of this little chip. That is the one SMD bundle on the board.

The INA226 frequently senses the voltage throughout a really low worth (2mΩ) resistor positioned within the path of the output present. An inside ADC converts this to a digital worth that may be queried by an MCU utilizing the I2C protocol. You may set an inside calibration register for fantastic tuning the present studying to compensate for the inaccuracy inherent within the sense resistor worth. In addition to the present you can too question the sensed voltage and the ability. It could additionally warn you by way of an output pin if a voltage or energy threshold that you simply program is exceeded. That is all nice stuff and is right for this challenge.

The Microcontroller

Actually, It needed to be an Atmega didn’t it? The requirement for a though-hole design guidelines out the STM32 F0, my favorite general-purpose ‘do almost anything’ MCU. This design will use the identical Atmega328p made well-known the world over by hundreds of Arduino customers. That very same degree of success means you could decide up this MCU for only a few {dollars} out of your favorite elements retailer.

There are a number of factors to notice about how the MCU is configured on this design. Firstly I’m utilizing the inner 8MHz oscillator because the clock supply which, given the documented 10% tolerance, does pose a threat to the power to run a dependable UART for information logging. If I do revise this design then I’ll attempt to squeeze in an exterior crystal. Secondly, since I’ll be utilizing the ADC there’s an LC filter on AVCC which may even be used to set the AREF degree.

5V voltage regulator

The MCU and the exterior peripherals on this board all run at 5V so I have to drop the enter degree of 12V right down to 5V to generate that offer. A 7V distinction implies that a linear regulator can be burning off loads of energy as warmth so for effectivity causes a switching buck regulator is the popular possibility. I opted to make use of the Texas Devices LM2574 Easy Switcher that may present as much as 500mA which must be greater than sufficient for this design. TI’s Easy Switcher vary are very dependable and straightforward to make use of. I’ve used them many occasions up to now and by no means had any points with stability.

Show and consumer interface

The readout for a power-supply, or any bench instrument for that matter, must be LED, OLED or VFD. In my view LCD lacks the eye-catching ‘at a glance’ distinction of LED or VFD. VFD is gorgeous to take a look at however costly to purchase in module type. Small OLED modules can be found cheaply and have been a contender for this design however I made a decision to go for 2 4-digit 7-segment LED modules.

The controller is the MAX7221 from Maxim. This controller can multiplex Eight LED digits, it’s obtainable in a DIP bundle and details about its utilization is available on the web. Mainly you simply ship it a digit quantity and the state of the segments for that digit and it’ll maintain the digit in that state with out intervention till you come again and inform it a brand new state. Simple.

Throughout regular operation the voltage and present readouts from the INA226 might be constantly displayed on every of the modules. I’ll reuse the shows as a rudimentary UI to set configurable parameters for this controller. These modules are a common-cathode design and are available on ebay. I’ll go into extra element within the invoice of supplies part.

Temperature sensing and fan management

There’s a heatsink inbuilt to the NXA66 for a great motive. On the larger present ranges the module might want to dissipate a big quantity of warmth. To assist with that I’ve included a temperature sensing module and fan controller. The MCP9700-E/TO is a thermistor in a TO-92 bundle that outputs a voltage proportional to the temperature that it senses.

I plan to tape this sensor to the heatsink of the NXA66 proper above the ability MOSFET. The sense voltage might be fed to the ADC on the Atmega328p the place will probably be transformed into Celsius. If the temperature exceeds a preset worth then a regular 12V 40mm DC fan might be switched on till the temperature drops again beneath one other threshold.

As with something ADC-related the sensed studying in addition to the ADC provide and reference degree have to be fastidiously filtered to keep away from misguided readings because of noise and glitches on the strains.

UART

Not so much occurring right here. It’s a easy breakout of the pins on the Atmega328p. I’ll connect these to a type of small exterior UART driver boards you could get on ebay. The MCU will frequently output the voltage and present readings so that you could collate them on a PC for information logging.

USBASP

That is the programming header. The pinout precisely matches that of the USBASP programmer so it may be immediately plugged on to program the MCU.

Switchgear

The entrance panel of this PSU may have SPST toggle switches for output-enable and voltage-select performance. There may even be a rotary encoder with a built-in push-button perform that I’ll use for adjusting the configurable controller parameters.

Each switches and the button are normally-open and can connect with floor when closed. Every one is connected to an enter pin on the MCU that has its inside pull-up enabled that means that it’ll learn excessive when the change is open and low when it’s closed. Wiring is simplified as a result of after connecting one pin of every change/button to the proper MCU enter pin all of the remaining pins are then widespread’d collectively and related to a floor terminal.

Invoice of Supplies

Right here’s an entire invoice of supplies for this challenge. The place a element is on the market from Farnell I’ve included the order code.

Designator Worth Amount Footprint Description Farnell Order Code Notes
C1, C2, C6, C7, C8, C9, C11, C13, C14 100n 9 2.54mm lead spacing Ceramic capacitor 2309020
C3 22u 16v 1 2mm lead spacing Polarized Capacitor (Radial) 1870976
C4 220u 1 2.5mm lead spacing Polarized Capacitor (Radial) 1902883
C5 220u 1 2.5mm lead spacing Polarized Capacitor (Radial) 1902883
C10 10u 1 2mm lead spacing Polarized Capacitor (Radial) 1902913
C12 1u 1 5.08mm lead spacing Capacitor 2112910 1
D1, D7 1N4007 2 DO-41 1 Amp Basic Function Rectifier 2317417 2
D2 1 LED-3MM 3mm LED 3
D3 1 LED-3MM 3mm LED 3
D4 1 LED-3MM 3mm LED 3
D5 1 LED-3MM 3mm LED 3
D6 SR150 1 DO-204AL Schottky Rectifier 1861420
FB1 BLM18PG221SN1D 1 AXIAL-0.3 Inductor 2292304
K1 OJE-SS-112HMF,F000 1 Relay TE OJ/OJE Single-Pole Single-Throw Relay 1891668
L1 RLB0914-331KL 1 RADIAL 5x9x9.5 Inductor 2309243
L2 RLB0712-100KL 1 RADIAL 10×7.2×3 Inductor 2434811
P1 Edge connector 1 2×25 2.54mm pitch, 5.08mm row spacing 4
P2 PM5.08/2/90 1 PCB terminal block – 2 pin WEIDMULLER PM5.08/2/90 1131855 5
P3 PM5.08/2/90 1 PCB terminal block – 2 pin WEIDMULLER PM5.08/2/90 1131855 5
P4 PM5.08/2/90 2 PCB terminal block – 2×2 pin WEIDMULLER PM5.08/2/90 1131855 5
P5 Fan header 1 HDR1X3 Header, 3-Pin 588581
P6 1 2.54mm Header, 4-Pin 6
P7 1 2.54mm x 2 Header, 5-Pin, Twin row 6
Q1, Q2, Q3, This fall BS170 4 TO-92 N-Channel MOSFET 1017687
R1, R9 680 2 AXIAL-0.3 Resistor 2329545
R2, R3 470 2 AXIAL-0.3 Resistor 2329531
R4, R7, R10, R12, R13, R14 10okay 6 AXIAL-0.3 Resistor 2329474
R5, R6 2.2k 2 AXIAL-0.3 Resistor 2329584
R8 2m 1% 1 2512 Welwyn ULR2-R002FT2 1292491
R11 68okay 1 AXIAL-0.3 Resistor 2329546
SW1 PM5.08/2/90 3 PCB terminal block – 3×2 pin WEIDMULLER PM5.08/2/90 1131855 5
SW2 1 PCB terminal block (Three pin) Header, 3-Pin 7
U1 LM2574N-5.0/NOPB 1 DIP-8 0.5A Step-Down Voltage Regulator 1469169 8
U2 INA226AIDGST 1 MSOP-10 Present Sense Amplifier 1924807
U3 MCP9700-E/TO 1 HDR1X3 MCP9700 plus fan-style header 1332166,588581 9
U4 MAX7221CNG 1 DIP-24 8-Digit LED Show Driver 10,8
U5, U7 03641A 2 0.36″ 12 pin Four digit 7 section LED widespread cathode 410561X 11
U6 ATmega328P-PU 1 DIP-28 8-bit AVR Microcontroller 1715487 12,8

Notes

A few of the elements have observe numbers towards them. The next numbered paragraphs correspond to a numbered observe within the invoice of supplies desk.

  1. 2.54mm components can be used if you happen to fastidiously bend the leads outwards to suit the broader 5.08mm pitch.
  2. Any of the 1N400x collection might be fantastic. All of them value about the identical so I are inclined to preserve a inventory of the most important one, the 1N4007 round.
  3. Any color of 3mm LED will work. I’ve used amber for Energy/PGOOD, white for EN and blue for VSP for no different motive than I felt prefer it.
  4. This could be a difficult one. I obtained the sting connector on ebay, merchandise quantity 140888533934. Half 2668415 at Farnell seems prefer it could possibly be persuaded to suit – the row pitch is simply 0.2mm off the required 5.08mm.
  5. PCB terminal blocks with the 5.08mm pitch are plentiful on ebay they usually slot collectively to type longer blocks. There’s no motive to not use the cheaper ebay blocks for the switchgear however I’d persist with a high quality merchandise for the ability in/out blocks (P2, P3 and P4).
  6. The male 2.54mm pin headers are at their least expensive on ebay.
  7. The three-way 5.08mm PCB terminal blocks can be found on ebay.
  8. I mount all my ICs in sockets. You don’t need to but when you could change one…
  9. I’ve included a 3×2.54mm header footprint for the TO-92 temperature sensor and I selected to make use of a 3-pin fan header because the connector. You may simply as simply use female and male pin headers when you’ve got them, and even solder the sensor wires on to the board as essentially the most economical methodology.
  10. The MAX7221CNG is on the market cheaply on ebay in a number of 5. As traditional with ebay there’s a great likelihood of them being clones however that’s the place I purchased mine from they usually appear to work.
  11. The 7-segment 0.36″ LED show is on the market from many ebay sources. Be certain that it’s a standard cathode configuration. These shows all appear to share a standard pinout, however simply in case click on right here to see the datasheet for the one which I purchased.
  12. You may in all probability purchase an Arduino clone on ebay from China with an Atmega328P on board for lower than Farnell will cost you for one piece of the IC alone.

PCB structure

The PCB was laid out to suit the 10x10cm form that’s so economical to provide on the Chinese language prototype homes. The NXA66 sits on the left with a direct, vast path alongside high and backside floor fills from the present return terminal to the bottom entry level. Additional optimisation could possibly be made right here by ignoring the return floor terminals and wiring from the entrance panel floor immediately again to the ability entry floor on the again.

Indicator LEDs and switchgear terminals are positioned on the entrance and energy entry is on the again. I’ll place a 2.1mm panel-mount connector on the again of the case in addition to an on-off change.

The three-pin fan and temperature connectors encompass an oblong cutout within the PCB. The cutout is designed for routing the wires from the sensor and fan beneath the board for aesthetic causes.

The regulator output runs via high and backside polygons to the sense resistor the place it unavoidably shrinks to move via the element whereafter it expands to a pair of polygons related to twin output terminals. The INA226 is positioned as shut as attainable to the sense resistor.

I discussed earlier that the TI Easy Switcher regulators are a simple to make use of design, and they’re, however good follow continues to be so as when laying out the elements that participate within the switching loop.

TI’s utility observe AN-1229 covers all of it however the fundamentals are that the switching elements must be positioned as near the regulator as attainable (difficult with via gap), they need to be organized within the order proven within the schematic and the bottom returns for every of them must be tied collectively and terminated to a floor airplane on the floor pin of the IC. Hopefully you may see how I’ve performed that within the above picture.

PCB manufacturing

It’s the standard process to get these boards constructed. Generate the gerbers, add to your favorite Chinese language prototype producer and wait nevertheless lengthy you’re keen to pay for supply.

For 2 layer boards equivalent to these I feel all of the board homes equivalent to Seeed, ITead, Elecrow and PCBWay are all a lot the identical so I went with PCBWay as I’ve been utilizing them just lately and have discovered their high quality to be nice and their customary supply appears to be a bit faster than a few of the others, though it’s nonetheless a minimum of two weeks.

I went with a inexperienced PCB to match the color of the NXA66 module that might be plugged into it. For via gap designs I’m reasonably a fan of white however on this case I feel it might conflict an excessive amount of with the inexperienced of the NXA66 so inexperienced it’s.

The designs have been uploaded, I went on vacation and by the point I obtained again they have been in my letterbox ready for me. Let’s see how they give the impression of being.

I feel they’re trying nice. No manufacturing flaws have been anticipated as a result of I wasn’t pushing any of the printed limits and a fast once-over beneath a magnifying glass didn’t present up any issues. Time to assemble a board and do some testing.

Meeting

Assembling this board begins with the 2 floor mount components, the INA226 and the present sense resistor. I tinned the pads with an iron after which reflowed the 2 components in my reflow oven. It definitely felt like overkill for 2 components however I’ve the oven so I take advantage of it each time I can.

Should you don’t have a reflow setup then it’s not tough to do these two components by hand with an iron when you’ve got loads of flux, good mild and a few hands-free magnification. There are numerous tutorials and movies on YouTube about how you can hand-solder SMD components.

After the 2 SMD components are performed it’s on to the easy however time-consuming activity of bending, inserting, soldering and trimming the through-hole components. It’s finest to do these beginning with the bottom profile resistors first and dealing as much as the tallest components. That means once you flip the board the wrong way up to solder a component will probably be held in place while you’re employed by its personal contact together with your work floor.

Lastly after a reasonably lengthy however unusually therapeutic soldering session it’s all performed.

I do know I’ve stated it earlier than however I do just like the look of a challenge constructed with through-hole components. It’s definitely a marvel to examine a densely packed SMD board however the look of a through-hole challenge with all these chunky bits on it appeals extra to me. Subsequent I’ll insert the NXA66 into the sting connector and construct up the temperature sensor cable.

I made a cable for the temperature sensor out of an affordable 3-pin pc fan cable that I obtained on ebay. The connector on the opposite finish was snipped off and the ensuing wire ends have been soldered to the MCP9700 TO-92 leads. The fan’s not fitted in these images. I’m nonetheless ready for that to be delivered. Hopefully it’ll be prepared by the point I shoot the video that’ll accompany this text.

I used some heat-shrink tube to insulate the legs of the TO-92 after which kapton taped it to the again of the heatsink the place I can see that it makes contact on the opposite facet with the ability MOSFET. This must be the most popular a part of the heatsink and subsequently the very best place to take measurements.

The firmware

I related up the 12V enter to my bench PSU and switched on. The facility LED got here on which meant that the 5V regulator was working. In fact there was no output from the NXA66 as a result of the relay that controls energy to it was switched off. What I did subsequent was to verify that the AtMega328P would discuss to me via the ISP header. It did, so now I’m good to go along with writing the firmware.

The fundamental goals of the firmware are:

When the system is powered up it ought to restore its most up-to-date settings from the onboard EEPROM. If the output allow change is within the ‘on’ place then the output must be instantly enabled. This permits the system to proceed the place it left off within the occasion of an sudden reboot or energy outage.

The higher LED ought to present the voltage degree reported by the INA226. The decrease LED ought to present the present reported by the INA226.

There are two switches and a rotary encoder with an built-in button. Their performance is as follows:

  • The VSP change ought to change between 3.3V and no matter various voltage degree is offered by the NXA66, both 5V or 2.5V.
  • For the reason that NXA66 doesn’t like switching ranges whereas the ability is on we’ll use the relay to chop the ability earlier than setting the brand new degree and switching the relay again on.

  • The output allow change electronically disables the output.

The rotary encoder and its built-in button might be used to navigate via a single-level menu of configuration choices displayed on the higher show. Urgent the button will carry up the primary menu merchandise. Turning the knob will ‘scroll’ via the choices. Urgent the button once more will enter that menu possibility after which the knob can be utilized to regulate the configured worth and the knob will affirm it and save the brand new worth to EEPROM. Doing nothing for an idle time of 10 seconds will abort the menu course of and return to the primary voltage/present show.

Rudimentary however intelligible letters could be displayed on the 4-digit LED show and that might be sufficient for me to offer the menu navigation. The configurable choices might be:

  • Calibration. The INA226 is configured with a calibration worth for an ideal 2mΩ present sense resistor. In the actual world the precise resistor worth might be off by a small quantity and this feature will enable me to compensate for that. By making use of a load and monitoring the present circulation with an correct instrument I can change the calibration so my displayed present matches the instrument.
  • Over-current safety. I can program an upper-limit to the output present. If this restrict is exceeded then the output might be robotically disabled. I’ll be doing this by monitoring the polled output from the INA226 so there might be a delayed response of some hundred milliseconds — roughly the identical as a slow-blow fuse.
  • Knowledge logging. I’ll periodically transmit the measured present and voltage values to the UART port. This feature permits me to configure how typically that occurs, or disable it.
  • LED brightness. A comfort characteristic to permit me to regulate the brightness of the LED shows.
  • Fan activation ranges. The fan could be configured to change on when a sure temperature is exceeded after which change off when the temperature falls again beneath a decrease degree. I’ll be capable to customise these temperature ranges with this feature.
  • Temperature show. There’s nowhere to constantly show the temperature so this feature will enable me to verify its present degree.

It didn’t take lengthy to jot down the firmware and I’m fairly happy with the consequence. It’s all open-source in fact and you may view it right here on github. Within the bin listing you will discover hex information that correspond to every launch. These could be uploaded on to the AtMega328p utilizing the USBASP programmer.

avr-size nxa66.elf | tee nxa66.siz
textual content information bss dec hex filename
7486 180 191 7857 1eb1 nxa66.elf

Wanting on the compiled measurement it seems that I may have fitted it into an AtMega8 however there’s no value benefit for me to do this since they each value about the identical in single models. That’s one factor I actually like in regards to the AVR 8-bit instruction set – the code density is so excessive that you simply get loads of performance right into a small quantity of flash. This firmware would have been a minimum of double the scale if applied within the ARM 16-bit thumb instruction set.

The MCU operates on its inside 8MHz oscillator. The fuse values required for which might be programmed utilizing avrdude:

$ avrdude -c usbasp -p m328p -e -U lfuse:w:0xe2:m -U hfuse:w:0xde:m

The principle loop of the firmware polls the INA226 each 200ms and updates the show. The configuration menu, if lively, additionally runs in the primary polling loop. Every little thing else runs asynchronously utilizing interrupts:

  • A 1Hz timer periodically triggers an asynchronous ADC conversion on the MCP9700 analog enter. The ADC completion interrupt is used to learn and convert the temperature studying. Click on right here to see how that’s performed. Be aware that conversion to celsius is completed with purely integer arithmetic – we don’t wish to pull in bloated and gradual floating level libraries only for this.
  • The straightforward 8-bit Timer0 is used as a common goal millisecond ticker. Click on right here to see how that’s performed.
  • The facility good sign from the NXA66 is related to the INT0 pin. When the pin adjustments state we get an interrupt and set the onboard LED accordingly. Click on right here to see the code for that.
  • The UART transmitter makes use of an interrupt to inform it when the transmit register is prepared for information. We use this to ship out our information logging strings with out having to do a blocking ballot on the register that holds the ‘ready’ flag. Click on right here to see the code.

Programming utilizing interrupts can significantly improve the effectivity of your firmware, certainly a lot of my STM32 firmware implementations are solely interrupt pushed. That’s, the primary loop does completely nothing in any respect. Programming utilizing interrupts does require extra care and a spotlight although. A few of the most necessary that spring to thoughts are:

The risky qualifier have to be used on information that’s to be shared with code executed in a special context. It will cease the compiler re-ordering directions or caching writes that would mess issues up. Don’t use risky until you want it although as a result of it restricts the optimiser’s makes an attempt to make you look good.

You can not learn or write a variable in the primary loop that’s accessed in an interrupt context if that variable is wider than the MCU can write in an atomic instruction. For the AVR which means you can not share an int as a result of it’s 16 bits vast and requires two directions to jot down. An interrupt can happen between the 2 directions and depart the variable in an incorrect state. To get round this on the AVR, both disable interrupts whereas a large variable is accessed or use an 8-bit flag to point a ‘locked’ state.

Don’t spend ages in an interrupt service routine if different issues could possibly be held up by you. In an setting with out hierarchical interrupts all the pieces else is suspended and necessary interrupts equivalent to those who preserve time won’t be working.

You will be unable to make use of performance that relies on different interrupts being serviced. For instance, polling a millisecond timer counter in an interrupt routine isn’t going to work as a result of the code that updates the counter can’t run.

Testing

Writing the firmware steadily opened up every characteristic of the board and I used to be shortly capable of log out all the pieces as working as designed. A bonus of utilizing the MCU embedded within the Arduino is that there’s loads of open supply code on the market to drive ICs and MCU peripherals. Not all of it’s nice, however even the low-quality code may give you a head begin with the basics of how you can start.

I used to be capable of re-use a personality font library for the MAX7221 and the favored ‘Wire’ library for driving the I2C peripheral that I wanted to speak to the INA226. Right here’s an image of the system up and working, supplying 95mA to a check load.

I’m going to design a case for this energy provide with switchgear and banana sockets on the entrance however till that comes I wanted a fast hack to entry the switches and the rotary encoder. I did this with a dremelled and drilled piece of stripboard that I may push the switches via and solder them to some entry wires on the copper facet.

It’s a hack, and it’s needed to be patched up as soon as already but it surely has allowed me to get via this testing part with out a actual case.

The temperature monitoring and dynamic fan management additionally appear to be working nicely. Right here’s a snapshot of the configuration menu merchandise that shows the present temperature.

Now let’s check out the information logging. I connected the UART pins to a type of little adapter boards you could get on ebay. The protocol is 19200-8-N-1.

This allowed me to attach a serial cable to the again of my PC and obtain the logged information. Every line of information comprises the millisecond timestamp of the pattern, the voltage and present readings and the 8-bit CCITT CRC of all characters previous the CRC quantity itself.

The default configuration transmits a brand new line as soon as per second however this may be modified within the configuration menu.

Room for enchancment

There’s at all times room to make enhancements to a challenge. Right here’s a few issues that I observed that could possibly be improved.

  • The board cutout is just not giant sufficient to permit a regular 3-pin fan plug to be threaded via it. I needed to lower my fan lead and resolder it again collectively after plugging it in to the board.
  • I forgot so as to add silkscreen pinout data for the UART header so it’s important to have the design open for reference when connecting up the UART.

Each of the above points are fastened within the Gerber information you could obtain from my website.

Video

Should you’d wish to see me attempt to make one thing as mundane as an influence provide seem attention-grabbing in a video then you are able to do so by clicking beneath. Higher decision could be had by viewing the video on the primary YouTube website.

Construct your personal

Should you’d wish to have a go at constructing one in every of these your self then I’d definitely suggest it. Should you’re assured you may solder the surface-mount INA226 then all the pieces else is a stroll within the park.

Click on right here to go to my downloads web page the place you’ll discover a hyperlink to obtain the Gerber information in a type you could immediately add to a website like PCBWay, Elecrow, ITead, Seeed and so forth. The board is a two layer 10x10cm design.

Click on right here to go to the Github repository for the firmware. Within the bin listing you’ll discover a compiled .hex file for every launch. In case you have avrdude put in then the firmware could be flashed and the fuses set with the next instructions:

$ avrdude -c usbasp -p m328p -e -U flash:w:nxa66.hex
$ avrdude -c usbasp -p m328p -e -U lfuse:w:0xe2:m -U hfuse:w:0xde:m

Change nxa66.hex with the identify of the hex file that you simply downloaded.

Clean boards on the market

I’ve obtained some spare boards remaining from the batch of ten in my authentic order. Should you’d favor to purchase one reasonably than have your personal set manufactured then you need to use the PayPal type beneath to make an order.

Last phrases

It’s good when one thing works first time and I’m happy that this challenge was a type of. I now want to complete it off with a pleasant clear acrylic laser lower case which suggests spending some hours in entrance of Inkscape. I’ll try this and make sure you write up my expertise in one other article right here.

Should you’d wish to touch upon something on this article the please be at liberty to make use of the feedback part beneath. In case you have extra detailed feedback or questions then please use the discussion board and I’ll get again to you as quickly as I can.