For the electronics projects you’re working on, one thing is for sure: you need to power it! Anything from directly connected to the outlet, a battery, a buck converter to a linear regulator and so on. When consider testing a power supply, the first thing you should think about is how to measure its output voltage. Another important aspect that should be tested is how that power supply performs under load. In this video, Milos will show us a few different practical circuits to achieve this.
Watch the Video:
Downloads & Links | Bill of Material | Discussion
Let’s go through the different circuits that Milos develops and demonstrates in the video:
The Analog Circuit Version
An easy circuit to test your power supply involves only five components. The added benefit is that it can be made cheaply with just fifteen minutes of soldering!
This is a simple circuit that gives great results. The Op-Amp in the middle regulates the gate of the N channel MOSFET so that a constant current is flowing through it. This is achieved by having the feedback voltage come from the power resistor which is used as a shunt here for measuring current. The Op-Amp is trying to keep the voltage U1 and U2 equal, and we’re controlling the voltage U1 by setting it with the potentiometer, and that is how we are setting our desired current for this circuit. For any kind of quick test, this circuit is great, if you want to make it handle even higher currents, you can put a couple of MOSFETs in parallel and attach them to a heatsink.
A Digital Circuit Version
There are numerous ways of being able to digitize this, in the video, Milos decides to go with an approach that works in a similar fashion to the analog circuit, but the reference that is being sent to the Op-Amp is done through a microcontroller, or more specifically, a Raspberry Pico W.
The feedback now comes from an ACS current sensor and is directly fed to the Op-Amp. Milos originally wanted to use an INA219 module which is an I2C current and voltage sensor, but it died during testing. One thing he warns about is that you should be careful when buying clone boards with the ACS sensors since a lot of times they can go unstable as he experienced.
The ACS current sensor returns and analog voltage 0-5V with 2.5V being 0mA voltage since the sensor is bidirectional. To feed the reference to the regulator Op-Amp, we see that Milos adds a summing amplifier which adds a 2.5V signal coming from a potentiometer and the signal from the Raspberry Pico so that the reference can be set between 2.5V and 5V.
This digital version enables the user to control the current by varying the PWM duty cycle through software, additional things can be done with this setup as well, like constant power draw and battery capacity measurement.
The Simple Button ON/OFF Circuit
The last part of electronics that he wanted to do was the powering up of the whole system. The easiest way to accomplish that would be by using a switch, but Milos opted to go with a button, which needs some extra circuitry. To get some help on this topic, Milos leaned on the knowledge of the members of the Community, receiving a great deal of fantastic responses and suggestions, ultimately going with the idea that was most recommended and the benefits it brought. You can check all the ideas that are discussed here:
The Final Circuit
This circuit works by using high side switching with a P channel MOSFET, that’s done through 2 optocouplers, one is controlled by a button, and the other one is controlled by the Raspberry Pico. The idea is that Pico drives the pin high as soon as it turns ON, latching the power ON. To turn OFF the device, the Pico has a pin that can detect whether the button has been pressed or not, if it detects that the button has been pressed for longer than 3 seconds, it unlatches the power and the whole device turns OFF once the button is released.
The Enclosure Design
The only thing left to do was for Milos to design an enclosure. Deciding to start with an off-the-shelf enclosure and add 3D printed parts to it. Milos wanted a 16x2 LCD in the front for displaying information, LEDs for signals and 4mm banana jacks for connecting what’s being tested. This steered the eventual design. You can see the full design as well as the finished device below.
{gallery}My Gallery Title |
---|
|
Appendix: Schematics
{gallery}My Gallery Title |
---|
Downloads & Links
- Download Code & CAD Files!
- Press ON - Hold OFF Latching Circuit
Bill of Material:
Product Name | Quantity | Buy Kit |
---|---|---|
MULTICOMP PRO Banana Test Connector, Jack, Panel Mount, 32 A, 1 kV, Nickel Plated Contacts, Black | 1 | Buy Now |
MULTICOMP PRO Banana Test Connector, Jack, Panel Mount, 32 A, 1 kV, Nickel Plated Contacts, Red | 1 | Buy Now |
DFROBOT Wattmeter, Gravity: I2C Digital, Arduino UNO/Raspberry Pi 3B Boards | 1 | Buy Now |
DFROBOT Expansion Board, Gravity I2C 16x2 Arduino LCD, DFRduino UNO R3 Board | 1 | Buy Now |
INFINEON Power MOSFET, N Channel, 100 V, 36 A, 0.044 ohm, TO-220AB, Through Hole | 4 | Buy Now |
SEEED STUDIO LED Strip, Waterproof, WS2813 RGB, 60 LED/m, 1m, 5V, Seeedunio, Arduino+BaseShild Board | 1 | Buy Now |
DFROBOT Rotary Encoder Module, Breakout, Fermion, EC11, DFRduino UNO R3 Board | 1 | Buy Now |
MULTICOMP 3D Printer Filament, 1.75mm Dia, Purple, PLA, 1 kg | 1 | Buy Now |
CAMDENBOSS Plastic Enclosure, Multipurpose, ABS, 45 mm, 80 mm, 130 mm, IP40 | 1 | Buy Now |
ABL HEATSINKS Heat Sink, TO-220/218, 3.7 °C/W, TO-218, TO-220, 50 mm, 28 mm, 75 mm | 1 | Buy Now |
RASPBERRY-PI SBC, Raspberry Pi Pico W, RP2040, ARM Cortex-M0+, 264kB RAM, 2MB Flash, Wifi, Micro-USB | 1 | Buy Now |
TEXAS INSTRUMENTS LM324AN/NOPB | 1 | Buy Now |
VISHAY 4N27 | 2 | Buy Now |
INFINEON IRF9530NPBF | 1 | Buy Now |
STMICROELECTRONICS L78M05ABV | 1 | Buy Now |
Fan 60mm 12V - MULTICOMP MC011527 | 1 | Buy Now |
Additional Parts:
Passive components and wires - Parts like resistors, capacitors, wires, perfboard, etc |
Screws - M2.5 and M3 screws |
Push button - Any kind of button |
Barrel jack connector and 12V charger - Connector used to power the whole device as well a suitable charger that's at 12V |