Investigating A Defective USB Power Bank Module

Call us old fashioned, but we feel like when you buy a piece of hardware, the thing should actually function. Now don’t get us wrong, like most of you, we’re willing to put up with the occasional dud so long as the price is right. But when something you just bought is so screwed up internally that there’s no chance it ever could have ever worked in the first place, that’s a very different story.

Unfortunately, that’s exactly what [Majenko] discovered when he tried out one of the USB-C power bank modules he recently ordered. The seemed to charge the battery well enough, but when he plugged a device into the USB output, he got nothing. We don’t mean just a low voltage either, probing with his meter, he became increasingly convinced that the 5 V pin on the module’s IP5306 chip literally wasn’t connected to anything.

So close, yet so far away.

Curious to know what had gone wrong, he removed all the components from the board and started sanding off the solder mask. With the copper exposed, his suspicions were confirmed. While they did route a trace from the chip to the via that would take the 5 V output the other side of the board, it wasn’t actually connected.

This is a pretty blatant bug to get left in the board, but to be fair, something similar has happened at least once or twice to pretty much everyone who’s ever designed their own PCB. Then again, those people didn’t leave said flaw in a commercially released module…

Continue reading “Investigating A Defective USB Power Bank Module”

The Bright Side Of The Moon Lamp: It’s Any Colour You Like

One of the easiest ways to get into hardware hacking is by piecing together a few modules and shoehorning them into a really cool home. For example, why buy a commercial moon lamp when you can spend 30+ hours printing your own, and a few more hours hacking the guts together?

[Amit_Jain] was inspired by a project that combined a color map and bump map of the moon into a highly-detailed printable model. Displeased with the lack of features like portability and pretty colors, [Amit] took it to the next level by designing a threaded cap that unscrews to show the streamlined guts of an off-the-shelf RGB LED controller.

[Amit] freed the controller board from its plastic box and soldered the LED strip’s wires directly to it. For power, [Amit] taped the board to the battery from an old cell phone and stepped it up to 12 V with a boost converter. We think this looks quite nice and professional, especially with the stand. A brief demo is on the rise after the break.

If you’ve got the room for a much, much larger light-up moon, you should go for it.

Continue reading “The Bright Side Of The Moon Lamp: It’s Any Colour You Like”

AVR Microcontroller Doubles Up As A Switching Regulator

[SM6VFZ] designed, built and tested a switched-mode DC-DC boost regulator using the core independent peripherals (CIP) of an ATtiny214 micro-controller as a proof of concept, and it looks pretty promising!

A Buck, Boost, or Buck-Boost switching regulator topology usually consists of a diode, a switching element (MOSFET) and an energy storage device (inductor/capacitor) in the power path, and a controller that can measure the output voltage, control the switching element and add safety features such as current limiting and temperature shutdown. A search for switching regulators or controllers throws up thousands of parts, and it’s possible to select one specifically well suited for any desired application. Even so, the ability to use the micro-controller itself as the regulator can have several use cases. Such an implementation allows for a software configurable switch-mode regulator and easy topology changes (boost, buck, fly back etc.).

The “Getting Started with Core Independent Peripherals on AVR®” application note is a good place to get an overview of how the CIP functionality works. Configurable Custom Logic (CCL) is among one of the powerful CIP peripherals. Think of CCL as a rudimentary CPLD — a programmable logic peripheral, which can be connected to a wide range of internal and external inputs such as device pins, events, or other internal peripherals. The CCL can serve as “glue logic” between the device peripherals and external devices. The CCL peripheral offers two LookUp Tables (LUT). Each LUT consists of three inputs, a truth table, a synchronizer, a filter, and an edge detector. Each LUT can generate an output as a user programmable logic expression with three inputs and any device that have CCL peripherals will have a minimum of two LUTs available.

This napkinCAD sketch shows how [SM6VFZ] implemented the boost regulator in the ATtiny214. The AND gate is formed using one of the CCL LUT’s. The first “timer 1” on the left, connected to one input of the AND gate, is free running and set at 33 kHz. The analog comparator compares the boosted output voltage against an internally generated reference voltage derived from the DAC. The output of the comparator then “gates” timer 1 signal to trigger the second “timer 2” — which is a mono-shot timer set to max out at 15 us. This makes sure there is enough time left for the inductor to completely release its energy before the next cycle starts. You can check out the code that [SM6VFZ] used to built this prototype, and his generous amounts of commenting makes it easy to figure out how it works.

Based on this design, the prototype that he built delivers 12 V at about 200 mA with an 85% efficiency, which compares pretty well against regular switching regulators. Keep in mind that this is more of a proof-of-concept (that actually works), and there is a lot of scope for improvement in terms of noise, efficiency and other parameters, so everyone’s comments are welcome.

In an earlier blog post, we looked at how ATmegas with Programmable Logic came about with this feature that is usually found in PIC micro-controllers, thanks to Microchip’s acquisition of Atmel a few years back. But we haven’t seen any practical example of the CCL peripheral in an Atmel chip up until now.

DIY Magsafe Charger Feeds Off 12 V Solar Battery

[Steve Chamberlin] has a spiffy solar-charged 12 V battery that he was eager to use to power his laptop, but ran into a glitch. His MacBook Pro uses Apple’s MagSafe 2 connector for power, but plugging the AC adapter into the battery via a 110 VAC inverter seemed awfully inefficient. It would be much better to plug it into the battery directly, but that also was a problem. While Apple has a number of DC power adapters intended for automotive use, none exist for the MagSafe 2 connector [Steve]’s mid-2014 MacBook Pro uses. His solution was to roll his own MagSafe charger with 12 VDC input.

Since MagSafe connectors are proprietary, his first duty was to salvage one from a broken wall charger. After cleaning up the wires and repairing any frayed bits, it was time to choose a DC-DC converter to go between the MagSafe connector and the battery. The battery is nominally 12 volts, so the input of the DC-DC converter was easy to choose, but the output was a bit uncertain. Figuring out what the MagSafe connector expects took a little educated guesswork.

The original AC adapter attached to the charger claimed an output of 20 volts, another Apple adapter claimed a 14.85 V output, and a third-party adapter said 16.5 volts. [Steve] figured that the MagSafe connectors seemed fine with anything in the 15 to 20 V range, so it would be acceptable to use a 12 V to 19 V DC-DC boost converter which he had available. The result worked just fine, and [Steve] took measurements to verify that it is in fact much more efficient than had he took the easy way out with the inverter.

MagSafe has been displaced by USB-C nowadays, but there are plenty of MagSafe devices still kicking around. In a pinch, keep in mind that a little bit of filing or grinding is all that’s needed to turn MagSafe 1 into MagSafe 2.

Tiny Cube Hosts A Hearty Tube

Tiny PCBAs and glowy VFD tubes are like catnip to a Hackaday writer, so when we saw [hamster]’s TubeCube tube segment driver we had to dig in to learn more. We won’t bury the lede here; let’s enjoy a video of glowing tubes before we go further:

The TubeCube is built to fit the MiniBadge badge addon standard, which is primarily used to host modules on the SAINTCON conference badge. A single TubeCube hosts a VFD tube, hardware to provide a 70 V supply, and a microcontroller for communication and control. Each TubeCube is designed to accept ASCII characters via UART to display on it’s display, but they can also be chained together for even more excitement. We’re not sure how [hamster] would be able to physically wear the beast in the video above, but if he can find a way, they all work together. If you’re interested in seeing the dead simple UART communication scheme take a look at this file.

We think it’s also worth pointing about the high voltage supply. To the software or mechanically minded among us it’s easy to get trapped thinking about switching power supplies as a magical construct which can only be built using all-in-one control ICs. But [hamster]’s supply is a great reminder that a switching supply, even a high voltage one, isn’t as complex as all that. His design (which he says was cribbed from Adafruit’s lovely Ice Tube Clock) is essentially composed of the standard primitives. A big low voltage capacitor C1 to source the burst of energy which will be boosted, the necessary inductor/high voltage cap C2 which ends up at the target voltage, and a smoothing cap C3 to make the output a little nicer. It’s controlled by the microcontroller toggling Q1 to control the current flow through L1. The side effect is that by controlling the PWM frequency [hamster] can vary the brightness of the tubes.

Right now it looks like the repository has a schematic and sources, which should be enough to build a small tube driver of your own. If you can’t get enough TubeCubes, there’s one more video (of a single module) after the break.

Continue reading “Tiny Cube Hosts A Hearty Tube”

Give Your Solar Garden Lights A Color Changing LED Upgrade

White LEDs were the technological breakthrough that changed the world of lighting, now they are everywhere. There’s no better sign of their cost-effective ubiquity than the dollar store solar garden light: a complete unit integrating a white LED with its solar cell and battery storage. Not content with boring white lights on the ground, [Emily] decided to switch up their colors with a mix of single-color LEDs and dynamic color-changing LEDs, then hung them up high as colorful solar ornaments.

The heart of these solar devices is a YX8018 chip (or one of its competitors.) While the sun is shining, solar power is directed to charge up the battery. Once the solar cell stops producing power, presumably because the sun has gone down, the chip starts acting as a boost converter (“Joule thief”) pushing a single cell battery voltage up high enough to drive its white LED. Changing that LED over to a single color LED is pretty straightforward, but a color changing LED adds a bit of challenge. The boost converter deliver power in pulses that are too fast for human eyes to pick up but the time between power pulses is long enough to cause a color-changing circuit to reset itself and never get beyond its boot-up color.

The hack to keep a color-changing LED’s cycle going is to add a capacitor to retain some charge between pulses, and a diode to prevent that charge from draining back into the rest of the circuit. A ping-pong ball serves as light diffuser, and the whole thing is hung up using a 3D-printed sheath which adds its own splash of color.

Solar garden lights are great basis for a cheap and easy introduction to electronics hacking. We’ve seen them turn into LED throwies, into a usable flashlight, or even to power an ATTiny microcontroller.

Continue reading “Give Your Solar Garden Lights A Color Changing LED Upgrade”

Simple Ultrasound Machine Shows The Skeleton Lurking Inside Us All

That first glimpse of a child in the womb as a black and white image on a screen is a thrilling moment for any parent-to-be, made possible by several hundred thousand dollars worth of precision medical instrumentation. This ultrasound machine cobbled together from eBay parts and modules is not that machine by a long shot, but it’s still a very cool project that actually gives a peek inside the skin.

The ultrasound transducer used by [stoppi71] in this build has an unusual source: a commercial paint-thickness meter. Cue the jokes about watching paint dry, but coatings measurement is serious stuff. Even so, the meter in question only ran about $40 on eBay, and provided the perfect transducer for the build. The sender needs a 100V pulse at about 5 MHz, so [stoppi71] had some fun with a boost converter and a 74121 Schmitt-trigger one-shot driving a MOSFET to switch the high voltage. On the receive side, the faint echo is sent through a three-stage amp using AD811 op amps before going through an LM7171 op amp acting as a rectifier and peak detector. Echos are sent to an Arduino Due for display on a 320×480 LCD. The resolution isn’t great, but the video below shows that it’s enough to see reflections from the skin of [stoppi71]’s forearm and from the bones within.

[stoppi71] says that he was inspired to tackle this build by Murgen, an open-source ultrasound project. That project got further refined and entered into the “Best Product” category in the 2018 Hackaday Prize. We like that because focusing on turning projects into products is what this year’s Hackaday Prize is all about.

Continue reading “Simple Ultrasound Machine Shows The Skeleton Lurking Inside Us All”