HackerBox 0078: Power Delivery

by HackerBoxes in Circuits > Electronics

3850 Views, 7 Favorites, 0 Comments

HackerBox 0078: Power Delivery

HB0078 Whole Box.png

Welcome to HackerBox 0078. Let's explore the delivery of electrical energy and power.  Structure and function of AC/DC power supplies including transformers, rectifiers, regulators, and filters.  Assembly of an AC/DC power supply with extra functionality including continuity tester, logic probe, and square wave signal generator. Boost converter switch mode power supplies. USB power delivery including traditional 5V and USB-PD triggered up to 20V.  Benefits of using USB data blocking devices.

HackerBoxes are the original monthly subscription for electronics, computer technology, and hacker culture. Each HackerBox is a discovery box, which means all members await and enjoy a new surprise each month. Tech, toys, knowledge, and fun. It's like having a hacker convention, your birthday, and the first day of school - every month - right in your mailbox.

There is a wealth of information for current and prospective members in the HackerBoxes FAQ. Almost all of the non-technical support emails that we receive are already answered there, so we'd really appreciate it if you can take a few minutes to read the FAQ.

Supplies

This Instructable contains information for getting started with HackerBox 0078. The full box contents are listed on the product page for HackerBox 0078 where the box is also available for purchase while supplies last. If you would like to automatically receive a HackerBox like this right in your mailbox each month with a $15 discount, you can subscribe at HackerBoxes.com and join the party!

A soldering iron, solder, and basic soldering tools are generally needed to work on the monthly HackerBox. A computer for running software tools is also required. Have a look at the HackerBox Workshops for basic tools and a wide array of introductory activities and experiments.

The most import thing you will need is a sense of adventure, hacker spirit, patience, and curiosity. Building and experimenting with electronics, while very rewarding, can be tricky, challenging, and even frustrating at times. The goal is progress, not perfection. When you persist and enjoy the adventure, a great deal of satisfaction can be derived from this hobby. Take each step slowly, mind the details, and don't be afraid to ask for help.

Delivering Electrical Energy

Energy 101: Electricity Generation

The video above explains the generation of electricity and how it gets delivered over power lines into our homes, schools, and business.

We are here to work on the rest of the story - what happens to the electrical energy after the AC power receptacle on the wall.

But before we get to that, let's consider the basic question of how energy gets delivered "through" wires.

WARNING: Things are about to get a little weird. Keep an open mind.

In 2019, Science Asylum challenged that Circuit Energy Doesn't Flow the Way You Think

In 2021, Veritasium offered up The Big Misconception About Electricity (over 14 MILLION VIEWS)

Which incited analysis and commentary from various members of the online electro-illuminati, including...

Dave EEVblog - Analysing Veritasium's Electricity Misconceptions Video

ElectroBOOM - How Wrong Is Veritasium?

AlphaPhoenix - I bought 1000 meters of wire to settle a physics debate

As of just a few days ago, Veritasium has revisited the matter with How Electricity Actually Works

This mind-blowing discourse calls attention to an important different between Physics and Engineering. Physicists seek to understand underlying natural phenomena. This understanding usually gets boiled down into abstractions to make things practical to discuss and apply to everyday work. The lumped-component models we use to explain electrical circuits is such an abstraction. It isn't exactly "real" but it works.

Applying our understanding of nature to practical work is called Engineering. Engineers can construct layers and layers and layers of practical solutions to solve so many problems because we stand on the shoulders of Physicists and their abstractions. The abstractions are useful because they work, but in extreme cases (for example, super conducting wires extending off into space) the abstractions break down. When facing such a breakdown, we are given the opportunity to reconsider our assumptions and find deeper understanding.

"He not busy being born is busy dying." -Bob Dylan

AC/DC Power Supplies

ACDC Theory.png

For those about to rock, we salute you.

An electrical socket in the wall provides alternating current (A.C.), which means the voltage (and current) oscillates up and down like a sine wave. In British English (and increasingly elsewhere) this is called mains power and it ranges from 120 to 240 volts depending upon where in the world is Carmen Sandiego.

The first stage is to "step down" this AC power to a more reasonable voltage (often 5-48V). This is done using a transformer which works exactly as implied by its schematic symbol. A primary coil of wire induces a magnetic field in a core which then induces a current in a secondary coil of wire. The current in the secondary looks just like that in the primary, but it is smaller. It has been stepped down. Clearly, transformers are more than meets the eye!

Next, four diodes make up a bridge rectifier. The rectifier inverts the negative portions of the power signal to make them positive. The signal before the rectifier was half positive and half negative. After the rectifier, the signal is all positive.

One or more capacitors (see C1) come after the rectifier to smooth out the lumpy rectified output. This step leverages the filtering capability of the capacitor(s).

Finally, a voltage regulator maintains a stable output voltage providing a flat, constant direct current (D.C.) output signal. Regulators can have a fixed output voltage (for example 3.3V or 5V) or they can be the variable/adjustable variety where a voltage divider (two resistors) outside the regulator sets the output voltage level. If one of these two resistors is a potentiometer, then the output voltage can be adjusted by turning a knob.

If you'd like to review these concepts in video form and learn about how they relate to the power supply in your computer, then this video from Linus Tech Tips is for you.

AC/DC Kit: Bill of Materials

HB0078 Kit.png


U1           LM317 Voltage Regulator TO-220
U2           CD4069 Hex Inverter DIP14
Q1           9014 NPN Transistor TO-92
LS1          Buzzer
D1-D6        1N4007 Diode
D7           Blue (clear lens) LED
D8           Yellow LED
D9           Green LED
D10          Red LED
R0, R2, R3   1K Resistor (brown, black, black, brown, brown)
R1           240 Ohm Resistor (red, yellow, black, black, brown)
R4           100K Resistor (brown, black, black, orange, brown)
R6           10K Resistor (brown, black, black, red, brown)
R5           100K Trim Potentiometer 
R8           5K Potentiometer 
C2, C3       0.1uF Ceramic Capacitor (“104”)
C1, C4       1000uF Electrolytic Capacitor
C5, C6       10uF Electrolytic Capacitor
P1           Two Port Screw Terminal
P2           Three Port Screw Terminal
P3           Voltmeter
T1           Power Transformer
             Printed Circuit Board
             TO-220 Heat Sink with Screw
             IC Socket DIP14
             Potentiometer Knob
             Six Panel Laser-Cut Acrylic Housing
             Heat Shrink Tubing
             AC Power Cord
             13 Small Machine Screws
             13 Small Nuts
             6 Large Machine Screws
             6 Large Nuts
             6 Acrylic Washers

AC/DC Kit: PCB

KIT PCB.png

AC/DC Kit: Axial Components

Kit Axial.png

Best practice is to solder components onto a PCB from the lowest thickness/height first and then increasing in size.

In this case, start with the axial lead components.

Note the values of the six resistors before stuffing them into the PCB. Check the color stripes (verify with a meter if necessary) and match the value to the PCB silkscreen. Resistors are not polarized - they can be inserted in either direction.

The six diodes must each be inserted in the correct direction. Match the stripe on the diode to the line on the PCB silkscreen.

Wear safety glasses when trimming wire leads from the back of a PCB.

Keep a few of the nice thick diode leads after trimming them off. They will come in handy in a later step.

AC/DC Kit: Larger Components

Larger Components.png

Keep adding components as shown.

DIP socket: orient the semicircular notch in the socket to match the same marking on the PCB silkscreen

Ceramic Capacitors: not polarized, they can go in either way

Electrolytic Capacitors: must be inserted in the correct orientation, the positive lead in longer, the negative lead is marked on the capacitor housing, and the PCB silkscreen shows a "+" marking near one hole

Transistor: the shape of the device case is round on one side and flat on the other, the PCB silkscreen has a similar shape to match the device to

LEDs: the positive lead is longer and must be matched up to the "+" marking on the PCB silkscreen

AC/DC Kit: Even Larger Components

Larger Still Components.png

Keep going with the larger and larger components. We're almost there.

Screw Terminals: be sure to orient the openings for inserting wires towards the edge of the PCB

Buzzer: match the "+" marking on the housing with the "+" marking on the PCB silkscreen.

LM317: place the device with the flat metal surface against the heatsink and firmly tighten the screw, then solder the three leads of the device and the two pins of the heatsink onto the PCB at the same time.

AC/DC Kit: Integrated Voltmeter

Kit Voltmeter.png

The stranded wires of the voltmeter module can be tricky to maneuver. Replacing them with three device leads (remember the trimmings from the diodes earlier) makes things a lot easier.

Once the leads are inserted into the PCB, bend the module into position BEFORE soldering the leads to the main PCB.

Insert two of the acrylic washers between the voltmeter and the PCB as standoffs.

Use two of the SMALLER nuts and bolts nuts to attach the voltmeter as shown.

Once the module is tightened into position, the three leads can be soldered to the main PCB.

AC/DC Kit: Transformer and Acrylic Base

Transformer and Base Plate.png

Trim the blue leads (secondary coil) of the transformer to length and strip a few mm of insulation from each one.

Solder the blue leads (secondary coil) of the transformer to the main PCB as shown. Either way is fine.

Identify the acrylic base. It is one of the largest pieces and it has six mounting holes match the PCB and transformer.

Peel the protective paper layers from the piece of base acrylic. You can optionally leave the outside paper on for protection while you work.

Mount the PCB to the base using four of the LARGER nuts and bolts along with four acrylic washers as standoffs.

Mount the transformer to the base using two of the LARGER nuts and bolts. No washers this time.

Cut the heat shrink tubing into the sections and thread them onto the red leads (primary coil) of the transformer.

Solder the AC cord onto the red leads (primary coil) of the transformer. Either way is fine.

Slide the shrink tubing to be centered over the solder joint and heat the tubing to shrink it into place.

Safety Warning: Be sure these AC cord joints are completely and tightly covered with shrink tubing for safety.

AC/DC Kit: Acrylic Enclosure

Full Acrylic.png

Peal the paper from the remaining five pieces of acrylic.

Identify the sort side having the notch for the AC cord strain relief.

Slide the strain relief into the acrylic (it's tight).

Identify the long side of acrylic having the opening for the potentiometer.

Connect those two sides together and onto the base plate using the smaller nuts and bolts. For the long sides, be sure the notch in one upper corner is oriented closest to the blue screw terminals on the PCB.

A good trick for affixing the hardware is to the put the bolt through its hole and turn the nut on until just flush with the end of the bolt. Once the pieces are together, hold them steady with one hand and tighten the bolt up with the other hand.

Next position the other two side pieces and finally the top piece.

AC/DC Kit: Operation

LM Kit Operation.png

The power supply portion of the kit provides variable DC voltage in the range of 1.3 to 6 Volts to the Vout and GND screw terminals.

The value can be adjusted using the large potentiometer to 3.3V or 5V logic voltages.

The blue power LED only illuminates when the output voltage is set to 2.5V or higher.

LOGIC ANALYSIS FEATURES

The buzzer input will sound the buzzer when a high logic level is applied. This can function as a continuity tester or may be used for circuit tracing.

The logic probe input will illuminate the green or red LED to indicate the applied logic level.

The square wave output provides a test signal that alternates between logic high and logic low. The frequency of the alternating signal can be adjusted using the small trimmer potentiometer. The output signal is displayed by the yellow LED.

Connecting the square wave output to the buzzer input or the logic probe input and then adjusting the square wave frequency provides a simple demonstration of these features.

USB 5V Alligator Clip Breakout

USB 5V.png

Pretty much any of the traditional rectangular USB ports (known as USB-A ports) on your computers, or wall chargers, can provide 5V at up to 0.5A for your projects and experiments. Yes, that is only 2.5W, but as you know if you've ever had to feed a Raspberry Pi, traditional USB-style "chargers" are available up to a few amps if you need more.

When using a breakout cable, or any USB module really, be sure to never short power to ground - especially if plugged up to a laptop or other expensive equipment. A powered USB hub can be a great piece of insurance against power shorts.


Boost Converters

How Boost Converters Work!

A boost converter is a DC-to-DC power converter that steps up voltage from its input (supply) to its output (load). It is a type of switched-mode power supply that pumps up voltage on a capacitor by switching current on and off through an inductor. Timing of the switching is pulse width modulated to establish the desired output voltage. A diode is used to prevent backflow out of the capacitor, much like a one-way valve might be used at the output of a pump for liquids or gases. Wikipedia

Boost Converter Module

Boost Module.png

The HW-132 Power Supply Module is quite versatile.

It can be powered from 5V USB (either USB-A or using a microUSB cable).

It can also be powered directly via solder terminals with any DC voltage in the range of 3.5 - 12V.

It's output range is 1.2 - 24V DC with power delivery of up to 3W.

The button can be clicked to turn the output on/off.

The button can be held down to turn the display on/off (without affecting the output state).

The HW-132 features a boost mode controller chip in a tiny SOT-23-6 package. Compatible controller chips go by various names including MT3608, SDB628, HM1549, and XT1208 (datasheet). These controllers switch at 1.2MHz which allows for the use of equally tiny inductors and capacitors.

The HW-132 also includes a 7133 Low Dropout (LDO) Regulator in a SOT89 package to drop the voltage as needed to provide a full output range down to 1.2V (or even less).

USB Power Delivery

Here is why USB Type-C is AWESOME and how you can use Power Delivery for your electronics!

The above video begins with a nice overview of USB-C and why it is awesome. At time offset 5:23, the video dives into the subject of USB Power Delivery (USB-PD), so you can jump right to that point if you wish.

The Power Delivery functionality added to USB-C finally provides us with more than five volts. In fact, peripherals can request the host to switch between 5V, 9V, 12V, 15V, or 20V at up to 100W of total power.

USB-PD can support fast charging, provide enough power to run laptop computers, and much more.

Emerging revisions to the USB Power Delivery standard will extend support to 28V, 36V, and 48V settings with power levels up to 240W. An interesting emerging feature will support negotiated power direction, so delivery of power will no longer be limited to only host-to-peripheral. For example, one mobile phone will be able to power another.

Power Delivery Trigger

USB PD Trigger.png

Requesting USB-PD power settings from a USB host requires a USB peripheral to include a PD "trigger" capable of communicating the Power Delivery request.

The P30 Power Delivery Trigger features both a male and female USB-C port (only use one of them at a time). Over the USB-C channel, the P30 can request a voltage of 5V, 9V, 12V, 15V, or 20V. The push buttons on the P30 can be used to select the voltage level up and down. Double pressing (or long pressing) either button will force the trigger to autocycle through the available voltage levels.

The P30 will retain its voltage settings even when the power is turned off.

The LED labeled "OK!" is illuminated to indicate that the PD protocol is operating and the host handshake is successful.

The numeric display alternates between voltage and current when a load is connected. When no load is present, only the voltage is displayed.

The triggered power output is provided at the female USB-A socket. The USB Alligator Clip Breakout Cable is a very useful means for coupling the triggered voltage from the female USB-A socket into your circuits or projects as desired.

WARNING: The triggered power output is provided at a female USB-A socket, which is very nonstandard and potentially quite dangerous. Obviously, we cannot plug regular USB devices into this socket and then trigger a voltage higher than 5V since regular USB devices are only expecting to ever see 5V on the USB power pins. Be careful!

Where can the trigger be used?

Many newer PCs have USB-PD ports as do chargers for mobile devices - especially those capable of quick charging.

One example of a USB-C power supply that can provide 5V, 9V, 12V, 15V, and 20V options upon request is the ZMI zPower Turbo 65W USB-C PD Power Adapter. Another is its slightly less expensive cousin, the ZMI zPower 45W USB-C PD and 18W USB-A Power Adapter.

USB Safe Charge - Data Blocker

USB Blocker.png

If you find yourself in need of USB power and want to avoid putting your device or data at risk, this blocker will come in handy. Enjoy a detailed writeup from MG.

HackerBox BYTE SIZE

Byte Size.png

HackerBox is now also available in BYTE SIZE.

The perfect light snack of self-contained, focused experiences sure to inspire curious minds aged 10-110.

BYTE SIZE HackerBoxes do not require additional tools (aside from your computer). Each monthly box includes a printed instructional booklet packed with electronics, cybersecurity, ethical hacking, and computer technology.

HACK LIFE

outro.png

We hope you are enjoying this month's HackerBox adventure into electronics, computer technology, and hacker culture. Reach out and share your success in the comments below or other social media. Also, remember that you can email support@hackerboxes.com anytime if you have a question or need some help.

What's Next? Join the party and live the HackLife! Get a cool box of hackable gear delivered right to your mailbox each month and enjoy a generous member discount. Surf over to HackerBoxes.com right now and sign up for your monthly HackerBox subscription.