FET: The Friendly Efficient Transistor

If you ever work with a circuit that controls a decent amount of current, you will often encounter a FET – a Field-Effect Transistor. Whether you want to control a couple of powerful LEDs, switch a USB device on and off, or drive a motor, somewhere in the picture, there’s usually a FET doing the heavy lifting. You might not be familiar with how a FET works, how to use one and what are the caveats – let’s go through the basics.

Here’s a simple FET circuit that lets you switch power to, say, a USB port, kind of like a valve that interrupts the current flow. This circuit uses a P-FET – to turn the power on, open the FET by bringing the GATE signal down to ground level, and to switch it off, close the FET by bringing the GATE back up, where the resistor holds it by default. If you want to control it from a 3.3 V MCU that can’t handle the high-side voltage on its pins, you can add a NPN transistor section as shown – this inverts the logic, making it into a more intuitive “high=on, low=off”, and, you no longer risk a GPIO!

This circuit is called a high-side switch – it enables you to toggle power to a device at will through a FET. It’s the most popular usecase for a FET, and if you’re wondering more about high-side switches, I highly recommend this brilliant article by our own [Bil Herd], where he shows you high-side switch basics in a simple and clear way. For this article, you can use this schematic as a reference of how FETs are typically used in a circuit.

Continue reading “FET: The Friendly Efficient Transistor”

Make Your ESP32 Talk Like It’s The 80s Again

80s-era electronic speech certainly has a certain retro appeal to it, but it can sometimes be a useful data output method since it can be implemented on very little hardware. [luc] demonstrates this with a talking thermometer project that requires no display and no special hardware to communicate temperatures to a user.

Back in the day, there were chips like the Votrax SC-01A that could play phonemes (distinct sounds that make up a language) on demand. These would be mixed and matched to create identifiable words, in that distinctly synthesized Speak & Spell manner that is so charming-slash-uncanny.

Software-only speech synthesis isn’t new, but it’s better now than it was in Atari’s day.

Nowadays, even hobbyist microcontrollers have more than enough processing power and memory to do a similar job entirely in software, which is exactly what [luc]’s talking thermometer project does. All this is done with the Talkie library, originally written for the Arduino and updated for the ESP32 and other microcontrollers. With it, one only needs headphones or a simple audio amplifier and speaker to output canned voice data from a project.

[luc] uses it to demonstrate how to communicate to a user in a hands-free manner without needing a display, and we also saw this output method in an electric unicycle which had a talking speedometer (judged to better allow the user to keep their eyes on the road, as well as minimizing the parts count.)

Would you like to listen to an authentic, somewhat-understandable 80s-era text-to-speech synthesizer? You’re in luck, because we can show you an authentic vintage MicroVox unit in action. Give it a listen, and compare it to a demo of the Talkie library in the video below.

Continue reading “Make Your ESP32 Talk Like It’s The 80s Again”

A Survey Of Long-Term Waterproofing Options

When it comes to placing a project underwater, the easy way out is to just stick it in some sort of waterproof container, cover it with hot glue, and call it a day. But when you need to keep water out for several years, things get significantly harder. Luckily, [Patricia Beddows] and [Edward Mallon] from the Cave Pearl Project have written up their years of experience waterproofing data loggers for long-term deployment, making the process easier for the rest of us.

Cleaning cheap eBay boards in alcohol.

It starts with the actual board itself. Many SMD boards have at least some flux left over from the assembly process, which the duo notes has a tendency to pull water in under components. So the first step is to clean them thoroughly with an ultrasonic cleaner or toothbrush, though some parts such as RTCs, MEMs, or pressure sensors need to be handled with significant care.

Actual waterproofing starts with a coating like 422-B or nail polish which each have pros and cons. [Patricia] and [Edward] often apply coatings to PCBs even if they plan to otherwise seal it as it offers a final line of defense. The cut edges of PCBs need to be protected so that water can’t seep between layers, though care needs to be made for connectors like SD cards.

Encapsulation with a variety of materials such as hot glue, heat shrink tubing, superglue and baking soda, silicone rubber, liquid epoxy, paste epoxy (like J-B Weld), or even wax are all commented on. The biggest problem is that a material can be waterproof but not water vapor proof. This means that condensation can build up inside a housing. Temperature swings also can play havoc with sealings, causing gaps to appear as it expands or contracts.

Overall, it’s an incredible guide with helpful tips and tricks for anyone logging data underwater for science or even just trying to waterproof their favorite watch.

Continue reading “A Survey Of Long-Term Waterproofing Options”

A freshly reballed BGA chip next to a clean PCB footprint

Working With BGAs: Soldering, Reballing, And Rework

In our previous article on Ball Grid Arrays (BGAs), we explored how to design circuit boards and how to route the signals coming out of a BGA package. But designing a board is one thing – soldering those chips onto the board is quite another. If you’ve got some experience with SMD soldering, you’ll find that any SOIC, TQFP or even QFN package can be soldered with a fine-tipped iron and a bit of practice. Not so for BGAs: we’ll need to bring out some specialized tools to solder them correctly. Today, we’ll explore how to get those chips on our board, and how to take them off again, without spending a fortune on equipment.

Tools of the Trade

For large-scale production, whether for BGA-based designs or any other kind of SMD work, reflow ovens are the tool of choice. While you can buy reflow ovens small enough to place in your workshop (or even build them yourself), they will always take up quite a bit of space. Reflow ovens are great for small-scale series production, but not so much for repairs or rework. Continue reading “Working With BGAs: Soldering, Reballing, And Rework”

A Hacker’s Introduction To DIY Light Guide Plates

Last year, I found myself compelled to make a scaled-down replica of the iconic test chamber signs from the video game Portal. If you’ve played the game, you’ll remember these signs as the illuminated monoliths that postmarked the start of every test chamber. In hyperstylized video game fashion, they were also extremely thin.

Stay tuned for cake at the end of this article.

True to the original, my replica would need to be both slimmed down and backlit with a uniform, natural white glow. As fate would have it, the crux of this project was finding a way to do just that: to diffuse light coming in from the edges so that it would emit evenly from the front.

What I thought would be quick project ended up being a dive down the rabbit hole that yielded some satisfying results. Today, I’d like to share my findings and introduce you to light guide plates, one of the key building blocks inside of much of today’s backlit screen technology. I’ll dig into the some of the working principles, introduce you to my homebrew approach, and leave you with some inspirational source code to go forth and build your own. Continue reading “A Hacker’s Introduction To DIY Light Guide Plates”

Building The Sanni Cartridge Reader To Back Up And Restore Games And Saves

Game cartridges are generally seen as a read-only medium with the contents as immutable as text chiseled into a granite slab, and with accompanying save files on the cartridge surviving for generations. The unfortunate truth is that as with any media storage, cartridges can and do fail, and save files are often just ethereal bits in battery-backed SRAM. This makes being able to copy not only the game data but also the save files off these cartridges essential. Projects like the Open Source Cartridge Reader by [sanni] make this something that everyone can do.

Intended to be a kind of Swiss Army knife of game cartridges, many game systems are supported directly, and many others via (user-created) adapters. A how-to-build tutorial is provided on the project wiki, though anyone interested in building such a system would do well to look at the expected price tag on the BOM page, which comes in at $134. A recent video by [Kytor Industries] (also included below) demonstrates how to assemble one of these systems, including some modding of the preassembled components.

The main components are the Arduino Mega 2560 Pro MCU module, a Makerbase assembly with LCD, control knob, and SD card slot, an SI5351-based clock generator, a PIC12F629 MCU (for snesCIC and handling SNES DRM) and a lot of pin headers and card edge connectors for specific cartridge types. The assembly is rounded off with a surface-mounted GBA card reader and an enclosure.

One important gotcha is that some of these cartridges run on 5V, while others use 3.3V.  N64 cartridges require the dedicated voltage switch to be set to 3.3V, lest 5V gets sent into the unsuspecting cartridge. Once everything is configured properly, the firmware is flashed onto the Mega 2560 Pro module. The Sanni reader is then ready to run. You can use it to dump ROMs onto SD cards, along with dumping and restoring save files and loading ROMs onto new cartridges.

(Thanks to [Roman] for the tip)

Continue reading “Building The Sanni Cartridge Reader To Back Up And Restore Games And Saves”

All About USB-C: Replying Low-Level PD

Last time, we configured the FUSB302 to receive USB PD messages, and successfully received a “capability advertisement” message from a USB-C PSU. Now we crack the PD specification open, parse the message, and then craft a reply that makes the PSU give us the highest voltage available.

How did the buffer contents look, again?

>>> b
b'\xe0\xa1a,\x91\x01\x08,\xd1\x02\x00\x13\xc1\x03\x00\xdc\xb0\x04\x00\xa5@\x06\x00<!\xdc\xc0H\xc6\xe7\xc6\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'

The zeroes at the end might look non-significant, and they indeed are not with 99.99% certainty – that said, don’t just discard the entire tail end; one of the bytes in the beginning encodes the length of the message. We’ll read those bytes first, and then read only exactly as much as we need, making sure we aren’t reading two messages and interpreting it as one, and that we’re not discarding zeroes that are part of the message.

Today, we will write code that parses messages right after reading them from the FIFO buffer – however, keep this message handy for reference, still; and if you don’t have the hardware, you can use it to try your hand at decoding nevertheless. If you wanna jump in, you can find today’s full code here!

Continue reading “All About USB-C: Replying Low-Level PD”