Fitting A Spell Checker Into 64 KB

By some estimates, the English language contains over a million unique words. This is perhaps overly generous, but even conservative estimates generally put the number at over a hundred thousand. Regardless of where the exact number falls between those two extremes, it’s certainly many more words than could fit in the 64 kB of memory allocated to the spell checking program on some of the first Unix machines. This article by [Abhinav Upadhyay] takes a deep dive on how the early Unix engineers accomplished the feat despite the extreme limitations of the computers they were working with.

Perhaps the most obvious way to build a spell checker is by simply looking up each word in a dictionary. With modern hardware this wouldn’t be too hard, but disks in the ’70s were extremely slow and expensive. To move the dictionary into memory it was first whittled down to around 25,000 words by various methods, including using an algorithm to remove all affixes, and then using a Bloom filter to perform the lookups. The team found that this wasn’t a big enough dictionary size, and had to change strategies to expand the number of words the spell checker could check. Hash compression was used at first, followed by hash differences and then a special compression method which achieved an almost theoretically perfect compression.

Although most computers that run spell checkers today have much more memory as well as disks which are orders of magnitude larger and faster, a lot of the innovation made by this early Unix team is still relevant for showing how various compression algorithms can be used on data in general. Large language models, for one example, are proving to be the new frontier for text-based data compression.

Integrated BMS Makes Battery Packs Easy

[Editor’s note: The hacker requested that we remove the image for legal reasons, so it’s blurry now. We hope all’s well!]

Lithium technology has ushered in a new era of batteries with exceptionally high energy density for a reasonably low cost. This has made a lot possible that would have been unheard of even 20 years ago such as electric cars, or laptops that can run all day on a single charge. But like anything there are tradeoffs to using these batteries. They are much more complex to use than something like a lead acid battery, generally requiring a battery management system (BMS) to keep the cells in tip-top shape. Generally these are standalone systems but [CallMeC] integrated this one into the buswork for a battery pack instead.

The BMS is generally intended to make sure that slight chemical imbalances in the battery cells don’t cause the pack to wear out prematurely. They do this by maintaining an electrical connection to each cell in the battery so they can charge them individually when needed, making sure that they are all balanced with each other. This BMS has all of these connections printed onto a PCB, but also included with the PCB is the high-power bus that would normally be taken care of by bus bar or nickel strips. This reduces the complexity of assembling the battery and ensures that any time it’s hooked up to a number of cells, the BMS is instantly ready to go.

Although this specific build is meant for fairly large lithium iron phosphate batteries, this type of design could go a long way towards making quick battery packs out of cells of any type of battery chemistry that typically need a BMS system, from larger 18650 packs or perhaps even larger cells like those out of a Nissan Leaf.

Moving Software Down To Hardware

In theory, any piece of software could be built out of discrete pieces of hardware, provided there are enough transistors, passive components, and time available. In general, though, we’re much more likely to reach for a programmable computer or microcontroller for all but the simplest tasks for several reasons: cost, effort, complexity, economics, and sanity. [Igor Brichkov] was working with I2C and decided that he wanted to see just where this line between hardware and software should be by implementing this protocol itself directly with hardware.

One of the keys to “programming” a communications protocol in hardware is getting the timing right, the first part of which is initializing communications between this device and another on the bus. [Igor] is going to be building up the signal in parts and then ORing them together. The first part is a start condition, generated by one oscillator and a counter. This also creates a pause, at which point a second oscillator takes over and sends data out. The first data needed for I2C is an address, which is done with a shift register and a counter pre-set to send the correct bits out on the communications lines.

To build up the rest of the signal, including data from the rotary encoder [Igor] is using for his project, essentially sets of shift registers and counters are paired together to pass data out through the I2C communications lines in sequence. It could be thought of that the main loop of the hardware program is a counter, which steps through all the functions sequentially, sending out data from the shift registers one by one. We saw a similar project over a decade ago, but rather than automating the task of sending data on I2C it allowed the user to key in data manually instead.

Continue reading “Moving Software Down To Hardware”

A Modern Take On The Etch A Sketch

The Etch A Sketch is a classic children’s toy resembling a picture frame where artwork can be made by turning two knobs attached to a stylus inside the frame. The stylus scrapes off an aluminum powder, creating the image which can then be erased by turning the frame upside down and shaking it, adding the powder back to the display. It’s completely offline and requires no batteries, but in our modern world those two things seem to be more requirements than when the Etch A Sketch was first produced in the 1960s. Enter the Tilt-A-Sketch, a modern version of the classic toy.

Rather than use aluminum powder for the display, the Tilt A Sketch replaces it with an LED matrix and removes the stylus completely. There are no knobs on this device to control the path of the LED either; a inertial measurement unit is able to sense the direction that the toy is tilted while a microcontroller uses that input to light up a series of LEDs corresponding to the direction of tilt. There are a few buttons on the side of the device as well which allow the colors displayed by the LEDs to change, and similar to the original toy the display can be reset by shaking.

The Tilt-A-Sketch was built by [devitoal] as part of an art display which allows the visitors to create their own art. Housed in a laser-cut wooden enclosure the toy does a faithful job of recreating the original. Perhaps unsurprisingly, the Etch A Sketch is a popular platform for various projects that we’ve seen before including original toys modified with robotics to create the artwork and electronic recreations that use LED displays instead in a way similar to this project.

Continue reading “A Modern Take On The Etch A Sketch”

Backyard Rope Tow From Spare Parts

A few years ago, [Jeremy Makes Things] built a rope tow in his back yard so his son could ski after school. Since the lifts at the local hill closed shortly after schools let out, this was the only practical way for his son to get a few laps in during the week. It’s cobbled together from things that [Jeremy] had around the house, and since the original build it’s sat outside for a few years without much use. There’s been a lot more snow where he lives this year though, so it’s time for a rebuild.

The power source for the rope tow is an old gas-powered snowblower motor, with a set of rollers and pulleys for the rope made out of the back end of a razor scooter. Some polyurethane was poured around the old wheel hub so that the rope would have something to grip onto. The motor needed some sprucing up as well, from carburetor adjustment, fuel tank repairs, and some other pieces of maintenance before it could run again. With that out of the way it could be hoisted back up a tree at the top of the hill and connected to the long rope.

This isn’t the first time [Jeremy] has had to perform major maintenance on this machine either. Three years ago it needed plenty of work especially around the polyurethane wheel where [Jeremy] also had to machine a new wheel bearing in addition to all the other work that had to go into repairing it that time. From the looks of things though it’s a big hit with his son who zips right back up the hill after each ski run. Getting to the tops of ski runs with minimal effort has been a challenge of skiers and snowboarders alike for as long as the sport has been around, and we’ve seen all kinds of unique solutions to that problem over the years.

Laser Harp Sets The Tone

In many ways, living here in the future is quite exiting. We have access to the world’s information instantaneously and can get plenty of exciting tools and hardware delivered to our homes in ways that people in the past with only a Sears catalog could only dream of. Lasers are of course among the exciting hardware available, which can be purchased with extremely high power levels. Provided the proper safety precautions are taken, that can lead to some interesting builds like this laser harp which uses a 3W laser for its strings.

[Cybercraftics]’ musical instrument is using a single laser to generate seven harp strings, using a fast stepper motor to rotate a mirror to precise locations, generating the effect via persistence of vision. Although he originally planned to use one Arduino for this project, the precise timing needed to keep the strings in the right place was getting corrupted by adding MIDI and the other musical parts to the project, so he split those out to a second Arduino.

Although his first prototype worked, he did have to experiment with the sensors used to detect his hand position on the instrument quite a bit before getting good results. This is where the higher power laser came into play, as the lower-powered ones weren’t quite bright enough. He also uses a pair of white gloves which help illuminate a blocked laser. With most of the issues ironed out, [Cybercraftics] notes that there’s room for improvement but still has a working instrument that seems like a blast to play. If you’re still stuck in the past without easy access to lasers, though, it’s worth noting that there are plenty of other ways to build futuristic instruments as well.

Continue reading “Laser Harp Sets The Tone”

Ultra-Low Power Soil Moisture Sensor

Electricity can be a pretty handy tool when it stays within the bounds of its wiring. It’s largely responsible for our modern world and its applications are endless. When it’s not running in wires or electronics though, things can get much more complicated even for things that seem simple on the surface. For example, measuring moisture in soil seems straightforward, but corrosion presents immediate problems. To combat the problems with measuring things in the natural world with electricity, [David] built this capacitive soil moisture sensor which also has the benefit of using an extremely small amount of energy to operate.

The sensor is based on an STM32 microcontroller, in this case one specifically optimized for low-power applications. The other low-power key to this build is the small seven-segment e-ink display. The segments are oriented as horizontal lines, making this a great indicator for measuring a varying gradient of any type. The microcontroller only wakes up every 15 minutes, takes a measurement, and then updates the display before going back to sleep.

To solve the problem resistive moisture sensors have where they’re directly in contact with damp conditions and rapidly corrode, [David] is using a capacitive sensor instead which measures a changing capacitance as moisture changes. This allows the contacts to be much more isolated from the environment. The sensor has been up and running for a few months now with the coin cell driving the system still going strong and the house plants still alive and properly watered. Of course if you’re looking to take your houseplant game to the next level you could always build a hydroponics system which automates not only the watering of plants but everything else as well.