General Purpose I/O: How To Get More

The first program anyone writes for a microcontroller is the blinking LED which involves toggling a general-purpose input/output (GPIO) on and off. Consequently, the same GPIO can be used to read digital bits as well. A traditional microcontroller like the 8051 is available in DIP packages ranging from 20 pins to 40 pins. Some trade the number of GPIOs for compactness while other devices offer a larger number of GPIOs at the cost of complexity in fitting the part into your design. In this article, we take a quick look at applications that require a larger number of GPIOs and traditional solutions for the problem.

A GPIO is a generic pin on an integrated circuit or computer board whose behavior, including whether it is an input or output pin, is controllable by the user at runtime. See the internal diagram of the GPIO circuit for the ATmega328 for reference.

Simply put, each GPIO has a latch connected to a drive circuit with transistors for the output part and another latch for the input part. In the case of the ATmega328, there is a direction register as well, whereas, in the case of the 8051, the output register serves as the direction register where writing a 1 to it sets it in output mode.

The important thing to note here is that since all the circuits are on the same piece of silicon, the operations are relatively fast. Having all the latches and registers on the same bus means it takes just one instruction to write or read a byte from any GPIO register.
Continue reading “General Purpose I/O: How To Get More”

DIY Variacs Get ESP8266 Upgrades

If you’be been hacking and making long enough, you’ve probably run into a situation where you realize that a previous project could be improved with the addition of technology that simply wasn’t available when you built it. Sometimes it means starting over from scratch, but occasionally you luck out and can shoehorn in some new gear without having to go back to the drawing board.

The two isolated variacs that [nop head] built were already impressive, but with the addition of the ESP8266 he was able to add some very slick additional features which really took them to the next level. He’s done an exceptional job detailing the new modifications, including providing all the source for anyone who might be walking down a similar path.

His variacs have digital energy meters right in the front panel which give voltage, amps, and a real-time calculation of watts. After reading an article by [Thomas Scherrer] about sniffing the SPI data out of one of these meters with an Arduino, [nop head] reasoned he could do the same thing with an ESP8266. The advantage being that he could then pull that data out over the network to graph or analyze however he wishes.

For his older variac, he decided to automate the device by adding a stepper and belt to turn the knob. The stepper is controlled by a Pololu stepper driver, which in turn get’s its marching orders from another ESP8266. He even came up with a simple web interface which allows you to monitor and control the variac from your smart device.

We don’t often see many variacs around these parts, and even fewer attempts at building custom ones. It’s one of those pieces of equipment you either can’t live without, or have never even heard of.

Storm Detector Modules: Dancing In The Rain

Earlier, we had covered setting up an AS3935 lightning detector module. This detector picks up radio emissions, then analyzes them to determine if they are a lightning strike or some other radio source. After collecting some data, it outputs the estimated distance to the incoming storm front.

But that only gets you halfway there. The device detects many non-lightning events, and the bare circuit board is lacking in pizzazz. Today I fix that by digging into the detector’s datasheet, and taking a quick trip to the dollar store buy a suitable housing. The result? A plastic plant that dances when it’s going to rain!
Continue reading “Storm Detector Modules: Dancing In The Rain”

An Introduction To Storm Detector Modules

Lightning storm detectors have been around for a surprisingly long time. The early designs consisted of a pair of metal bells and a pendulum. When there was a charge applied, for example by connecting one bell to the ground and the other to a lightning rod, the bells would ring when a lightning storm was close by. In the mid 18th century, these devices were only practical for demonstration and research purposes, but very likely represent the earliest devices that convert electrostatic charge to mechanical force. A bit over a hundred years later, the first lightning detector was considered by some as the first radio receiver as well.

As soon as I found out about storm detector chips, I knew I would have to get one working. For about $25, I ordered an AMS AS3935 module from China. This chip has been featured before in a number of excellent projects such as Twittering lightning detectors, and networks of Sub-Saharan weather stations. While there’s an Arduino library for interfacing with this IC, I’m going to be connecting it up to an ESP8266 running the NodeMCU firware, which means digging into the datasheet and writing some SPI code. If any of the above tickles your fancy, read on! Continue reading “An Introduction To Storm Detector Modules”

Driver Board Makes Nixie Projects Easier Than Ever

We know, we know — yet another Nixie clock. But really, this one has a neat trick: an easy to use, feature packed driver for Nixies that makes good-looking projects a snap.

As cool as Nixies are — we’ll admit that to a certain degree, familiarity breeds contempt — they can be tricky to integrate. [dekuNukem] notes that aside from the high voltages, laying hands on vintage driver chips like the 7441 can be challenging and expensive. The problem was solved with about $3 worth of parts, including an STM32 microcontroller and some high-voltage transistors. The PCBs come in two flavors, one for the IN-12 and one for the IN-14, and connections for the SPI interface and both high- and low-voltage supplies are brought out to header pins. That makes the module easy to plug into a motherboard or riser card. The driver supports overdriving to accommodate poisoned cathodes, 127 brightness levels for smooth dimming, and a fully adjustable RBG backlight under the tube. See the boards in action in the video below, which features a nicely styled, high-accuracy clock.

From Nixie tachs to Nixie IoT clocks, [dekuNukem]’s boards should make creative Nixie projects even easier. But if you’re trying to drive a Nixie Darth Vader, you’re probably on your own.

An Old Video Game Controller On Even Older Computer

For those of us not old enough to remember, and also probably living in the States, there was a relatively obscure computer built by Microsoft in the early 80s that had the strong Commodore/Atari vibe of computers that were produced before PCs took over. It was known as the MSX and only saw limited release in the US, although was popular in Japan and elsewhere. If you happen to have one of these and you’d like to play some video games on it, though, there’s now a driver (of sorts) for SNES controllers.

While the usefulness of this hack for others may not help too many people, the simplicity of the project is elegant for such “ancient” technology. The project takes advantage of some quirks in BASIC for reading a touch-pad digitizer connected to the joystick port using the SPI protocol. This is similar enough to the protocol used by NES/SNES controllers that it’s about as plug-and-play as 80s and 90s hardware can get. From there, the old game pad can be used for anything that the MSX joystick could be used for.

We’ve seen a handful of projects involving the MSX, so while it’s not as popular as Apple or Commodore, it’s not entirely forgotten, either. In fact, this isn’t even the first time someone has retrofitted a newer gaming controller to an MSX: the Wii Nunchuck already works for these machines.

Best Product Entry: Emulating Memory

For this year’s Hackaday Prize, we’re giving everyone the opportunity to be a hardware startup. This is the Best Product portion of the Hackaday Prize, a contest that will award $30,000 and a residency in our Design Lab to the best hardware project that is also a product.

Imagine all the memory chips in all the landfills in the world. What if we could easily recover those hosed motherboards and swap out ROM files on malware-damaged chips. That’s the promise of [Blecky]’s EEPROM/Flash Emulator project on Hackaday.io. This project seeks to be the ultimate memory interface, emulating SPI-interface EEPROM or Flash memory chipsets with ease. It can also be used as a security device, checking the BIOS for untoward changes.

The EEEmu packs an Atmel SAM4S Cortex-M4 processor-based microcontroller, an SD card reader, a micro USB for reprogramming, boost converter, voltage regulator, and includes additional 3.3V GPIO/I2C ports, all on a wee 51.5x20mm circuit board. Version 2 is slated to include more features to facilitate use as a normal micro controller: more GPIO pins, USB voltage monitoring, and high-Z control for SPI output.

EEEmu is completely open source, with [Blecky] sharing his code on GitHub and even has created an EEEmu Fritzing part, also found in his repository.