Switching: from Relays to Bipolar Junction Transistors

How many remote controls do you have in your home? Don’t you wish all these things were better integrated somehow, or that you could add remote control functionality to a random device? It’s a common starting point for a project, and a good learning experience for beginners.

A common solution we’ve seen applied is to connect a relay in parallel to all the buttons we want to press. When the relay is triggered, for example by your choice of microcontroller, it gets treated as a button press. While it does work, relays are not really the ideal solution for the very low current loads that we’re dealing with in these situations.

As it turns out, there are a few simple ways to solve this problem. In this article, we’re going to focus on using common bipolar junction transistors instead of relays to replace physical switches. In short, how to add transistors to existing electronics to control them in new ways.

Continue reading “Switching: from Relays to Bipolar Junction Transistors”

The ESP32… On A Chip

The new hotness in microcontrollers is the ESP32. This chip, developed by Espressif, is the follow-on to the very popular ESP8266, the cheap, low-power, very capable WiFi-enabled microcontroller that came on the scene a few years ago. The ESP32 is another beast entirely with two powerful cores, WiFi and Bluetooth, and peripherals galore. You can even put an NES emulator in there.

While the ESP32 is significantly more powerful, it has for now been contained in modules. What would really be cool is a single chip loaded up with integrated flash, filter caps, a clock, all on a 7x7mm QFN package. Meet the ESP32-Pico-D4 (PDF). It is, effectively, an ESP32 on a chip. It’s just the ticket if you’re trying to cram wireless, fast microcontroller wizardry into a small package.

At its heart, the ESP32-Pico is your normal ESP32 module with a Tensilica dual-core LX6 microcoprocessor, 448 kB of ROM, 520 kB of SRAM,  4 MB of Flash (it can support up to 16 MB), Wireless with 802.11 b/g/n and Bluetooth 4.2, and a cornucopia of peripherals that include an SD card, UART, SPI, SDIO, LED and motor PWM, I2S, I2C, cap touch sensors, and a Hall effect sensor. It’s quite literally everything you could ever want in a microcontroller.

Disregarding the just barely hand-solderable package and the need for a PCB antenna, the ESP32-Pico requires very few support components. Really, the only thing going on in the reference schematic is a bunch of bypass caps. This is, by far, the easiest and smallest method to put WiFi, Bluetooth, and a powerful microcontroller in a project. It will surely be a very, very popular chip for hobbyist electronics for years to come. Of course, it will be even more popular if Espressif also manages to put this chip in a QFP package in addition to the QFN.

Unfortunately, apart from the PDF released by Espressif, the details on the EPS32-on-a-chip are sparse. We don’t know when we’ll be able to get our grubby hands on a tray, tube, or reel of these chips. That said, there’s enough information here to start designing a breakout board. Have at it — we’d love to see what the community comes up with.

Shout out to [Dave] for the tip.

A BluePill for Arduino Dependence

Arduinos are helpful but some applications require more than what Arduinos can provide. However, it’s not always easy to make the switch from a developed ecosystem into the abyss that is hardware engineering. [Vadim] noticed this, which prompted him to write a guide to shepherd people on their quest for an Arduino-free environment, one BluePill at a time.

With an extended metaphor comparing Arduino use and physical addiction, [Vadim’s] writing is a joy to read. He chose to focus on the BluePill (aka the next Arduino Killer™) which is a $1.75 ARM board with the form factor of an Arduino Nano. After describing where to get the board and it’s an accompanying programmer, [Vadim] introduces PlatformIO, an alternative to the Arduino IDE. But wait! Before the Arduino die-hards leave, take note that PlatformIO can use all of the “Arduino Language,” so your digitalWrites and analogReads are safe (for now). Like any getting started guide, [Vadim] includes the obligatory blinking an LED program. And, in the end, [Vadim] sets his readers up to be comfortable in the middle ground between Arduino Land and the Wild West.

The debate for/against Arduino has been simmering for quite some time, but most agree that Arduino is a good place to start: it’s simpler and easier than jumping head first. However, at some point, many want to remove their “crippling Arduino dependency” (in the words of [Vadim]) and move on to bigger and better things. If you’re at this point, or still cling to your Uno, swing on over and give Vadim’s post a read. If you’re already in the trenches, head on over and read our posts about the BluePill and PlatformIO which are great complements for [Vadim’s].

Dumb STB gets smart

[Vincent Deconinck] gave a fresh lease of life to an old set top box by adding a few Euro’s worth of hardware and some software smarts. The device in question is an old VOOcorder – a Cisco set-top box provided by VOO, his cable service provider in Belgium.

The VOOcorder doesn’t have any WiFi hardware or browser / app based interfaces. It’s a simple device controlled either via an IR remote or front panel buttons. [Vincent] added an ESP8266 and hooked it up to the IR receiver on the set-top box. He also set it up as an SPI slave to the front panel VFD display controller and connected it to the debug serial interface of the VOOcorder as well. The software, on the other hand, required a lot more work consisting of code running on the ESP itself, several HTML pages and JavaScript code for the browser front end, and a few scripts running in the background.

The result was bidirectional interactivity from within a browser, allowing him to send commands and receive status information as well as providing a user-friendly search interface. Further, his browser interface was integrated with information from the service providers website letting him do scheduling and recording of programs. The stuff that interested us is how he sniffed out the IR signals, figured out the SPI protocol used by the front panel controller, and implemented SPI-slave mode for the ESP8266. [Vincent] was surprised that such a cheap device could handle three distinct web servers while parsing two message streams without a hitch.

It’s a great hack showing us how to use super cheap electronics to upgrade and modernize old hardware. Check out the two videos after the break – showing a demo of the hack in action, and a walk through of the hardware modifications.

Continue reading “Dumb STB gets smart”

Repurposing Moving Coil Meters to Monitor Server Performance

Snazzy analog meters can lend a retro flair to almost any project, but these days they often seem to be retasked as indicators for completely different purposes than originally intended. That’s true for these Vu meters repurposed as gauges for a Raspberry Pi server, and we think the build log is as informative as the finished product is good-looking.

As [MrWunderbar] admits, the dancing needles of moving-coil meters lend hipster cred to a project, but getting his Vu meters to cooperate and display network utilization and disk I/O on his Raspberry Pi NAS server was no mean feat. His build log is full of nice details on how to measure the internal resistance of the meter and determine a proper series resistor. He also has a lengthy discussion of the relative merits of driving the meters using a PWM signal or using a DAC; in the end, [MrWunderbar] chose to go the DAC route, and the video below shows the desired rapid but smooth swings as disk and network usage change. He also goes into great depth on pulling usage parameters from psutil and parsing the results for display on the meters.

Looking for more analog meter goodness? We saw a similar CPU load meter a few months back, and there was this mash-up of Nixies and old meters for a solar energy CEO’s desk.

Continue reading “Repurposing Moving Coil Meters to Monitor Server Performance”

A Very Accurate Current Probe

There’s many different ways of measuring current. If it’s DC, the easiest way is to use a shunt resistor and measure the voltage across it, and for AC you could use a current transformer. But the advent of the Hall-effect sensor has provided us a much better way of measuring currents. Hall sensors offers several advantages over shunts and CT’s – accuracy, linearity, low temperature drift, wider frequency bandwidth, and low insertion loss (burden) being some of them. On the flip side, they usually require a (dual) power supply, an amplification circuit, and the ability to be “zero adjusted” to null output voltage offsets.

[Daniel Mendes] needed to measure some fairly high currents, and borrowed a clip-on style AC-DC current probe to do some initial measurements for his project. Such clip on current probes are usually lower in accuracy and require output DC offset adjustments. To overcome these limitations, he then built himself an invasive hall sensor current probe to obtain better measurement accuracy (Google Translated from Portugese). His device can measure current up to 50 A with a bandwidth stretching from DC to 200 kHz. The heart of his probe is the LAH-50P hall effect current transducer from LEM – which specialises in just such devices. The 25 mV/A signal from the transducer is buffered by an OPA188 op-amp which provides a low output impedance to allow interfacing it with an oscilloscope. The op-amp also adds a x2 gain to provide an output of 50 mV/A. The other critical part of the circuit are the high tolerance shunt resistors connected across the output of the LAH-50P transducer.

The rest of his design is what appears to be a pretty convoluted power supply section. [Daniel] wanted to power his current probe with a 5V input derived from the USB socket on his oscilloscope. This required the use of a 5 V to 24 V boost switching regulator – with two modules being used in parallel to provide the desired output power. A pair of linear regulators then drop down this voltage to +15 / -15 V required for the trasducer and op-amp. His blog post does not have the board layout, but the pictures of the PCB should be enough for someone wanting to build their own version of this current sensor.

Mouse Mis-Clicking? We Got You.

A mouse with malfunctioning buttons can be a frustrating to deal with — and usually a short leap to percussive maintenance. Standard fixes may not always last due to inferior build quality of the components, or when the microswitch won’t close at all. But, for mice that double/triple-click, will release when dragging, or mis-click on release, this Arduino-based hack may be the good medicine you’re after.

Instructables user [themoreyouknow]’s method cancels click malfunctions by latching the mouse’s controller switch trace to ‘on’ when pressed, keeping it there until the button normally closed contact closes again completely. Due to the confined spaces, you’ll want to use the smallest Arduino you can find, some insulating tape to prevent any shorts, and care to prevent damaging the wires this process adds to the mouse when you cram it all back together.

Before you take [themoreyouknow]’s guide as dogma, the are a few caveats to this hack; they are quick to point out that this won’t work on mice that share two pins between three buttons — without doing it the extra hard way, and that this might be trickier on gaming or other high-end mice, so attempt at your own peril.

Speaking of gaming mice, we recently featured a way to add some extra functionality to your mouse — cheating optional — as well as how to stash a PC inside an old Logitech model.