Hacker News new | ask | show | jobs
by ewzimm 453 days ago
Civilization doesn't even have to collapse for a project like this to be useful. Like you said, there's lots of e-waste. If you happened to live in a place that ended up with a lot of this stuff but didn't have a lot of infrastructure, you could possibly build up some convenient services with something like this. I like the idea of building software to make hardware less reliant on external resources in general. Over time, it could be useful to have more resilient electronics, because we seem to be designing machines to be more reliant on specific networked infrastructure every year.
1 comments

What services? For most modern services the big cost inputs are things like human labor, utilities, and real estate. Reusing obsolete hardware doesn't gain anything. It's likely to be a net negative if it takes up more space, uses more electricity, and requires more maintenance.
A lot of functions of electronics don't require tons of processing power or efficiency. Microcontrollers can be used for just about anything. General purpose computing can be put to whatever purpose you can image.

Things supported by this OS like the Z80, 8086, 6502 etc. use around 5-10W. Using simple parts to control complicated machines is a standard operation, and even advanced electronics tend to use a lot of parts using older manufacturing techniques because it's more efficient to keep the old processes running.

Here's a fun article with some context about old processors like this still in production: https://hackaday.com/2022/12/01/ask-hackaday-when-it-comes-t...

If you're running a tractor, sure, 5 watts is not a big deal. But there are a lot of hypothetical post-collapse circumstances where such a high power usage would be prohibitive. Consider, for example, the kinds of radio stations you'd need for the kinds of weather and telecommunications uses I discussed in https://news.ycombinator.com/item?id=43484415, which benefit from being placed on inaccessible mountaintops and running unattended for years on end.

5 watts will drain a 100-amp-hour car battery in 10 days and is basically infeasible to get from improvised batteries made with common solid metals. Current mainstream microcontrollers like an ATSAMD20 are not only much nicer to program but can use under 20 μW, twenty thousand times less. A CR2032 coin cell (220mAh, 3V) can provide 20 μW for about 4 years. But the most the coin cell can provide at all is about 500 μW, so to run a 5-watt computer you'd need 10,000 coin cells. Totally impractical.

And batteries are a huge source of unreliability. What if you make your computing device more reliable by eliminating the battery? Then you need a way to power it, perhaps winding a watchspring or charging a supercapacitor. Consider winding up such a device by pulling a cord like the one you'd use to start a chainsaw. That's about 100 newtons over about a meter, so 100 joules. That energy will run a 5W Z80 machine for 20 seconds, so you have to yank the cord three times a minute, or more because of friction. That yank will run a 20 μW microcontroller for two months.

I agree with your point! Old electronics aren't going to be appropriate for every situation, and modern alternatives are superior for lots of situations. But that doesn't mean that it isn't worth maintaining projects to keep the old ones useful. Plenty of people are still using technology developed thousands of years ago even when there are modern alternatives that are thousands of times more efficient. It just suits their situation better. Putting one of these things in something like a tractor or a dam or anything that has enough energy to spare is exactly the use case. And the relative simplicity of old technology can be a benefit if someone is trying to apply it to a new situation with limited resources or knowledge.
Well, I disagree with yours!

What cases are you thinking of when you say "Plenty of people are still using technology developed thousands of years ago even when there are modern alternatives that are thousands of times more efficient"? I considered hand sewing, cultivation with digging sticks instead of tractors, cooking over wood fires, walking, execution by stoning, handwriting, and several other possibilities, but none of them fit your description. In most cases the modern alternatives are less efficient but easier to use, but in every case I can think of where the efficiency ratio reaches a thousand or more in favor of the new technology, the thousands-of-years-old technology is abandoned, except by tiny minorities who are either impoverished or deliberately engaging in creative anachronisms.

I don't think "the relative simplicity of old technology" is a good argument for attempting to control your tractor with a Z80 instead of an ATSAMD20. You have to hook up the Z80 to external memory chips (both RAM and ROM) and an external clock crystal, supply it with 5 volts (regulated with, I think, ±2% precision), provide it with much more current (which means bypassing it with bigger capacitors, which pushes you towards scarcer, shorter-lived, less-reliable electrolytics), and program it in assembly language or Forth. The ATSAMD20 has RAM, ROM, and clock on chip and can run on anywhere from 1.62 to 3.63 volts, and you can program it in C or MicroPython. (C compilers for the Z80 do exist but for most tasks performance is prohibitively poor.) You can regulate the ATSAMD20's voltage adequately with a couple of LEDs and a resistor, or in many cases just a resistor divider consisting of a pencil lead or a potentiometer.

It would be pragmatically useful to use a Z80 if you have an existing Z80 codebase, or if you're familiar with the Z80 but not anything current, or if you have Z80 documentation but not documentation for anything current, or if you can get a Z80 but not anything current. (One particular case of this last is if the microcontrollers you have access to are all mask-programmed and don't have an "external access" pin like the 8048, 8051, and 80C196 family to force them to execute code from external memory. In that case the fact that the Z80 has no built-in code memory is an advantage instead of a disadvantage. But, if you can get Flash-programmed microcontrollers, you can generally reprogram their Flash.)

Incidentally, the Z80 itself "only" uses about 500 milliwatts, and there are Z80 clones that run on somewhat less power and require less extensive external supporting circuitry. (Boston Scientific's pacemakers run on a Z80 softcore in an FPGA, for example, so they don't have to take the risk of writing new firmware.) But the Z80's other drawbacks remain.

The other draw of an established "old architecture" is that it's fairly fixed and sourcable.

There are a bazillion Z80s and 8051s, and many of them are in convenient packages like DIP. You can probably scavenge some from your nearest landfill using a butane torch to desolder them from some defunct electronics.

In contrast, there are a trillion flavours of modern MCUs, not all drop-in interchangeable. If your code and tooling is designed for an ATSAMD20, great, but I only have a bag of CH32V305s. Moreover, you're moving towards finer pitches and more complex mounting-- going from DIP to TSSOP to BGA mounting, I'd expect every level represents a significant dropoff of how many devices can be successfully removed and remounted by low-skill scavengers.

I suppose the calculus is different if you're designing for "scavenge parts from old games consoles" versus proactively preparing a hermetically sealed "care package" of parts pre-selected for maximum usability.

I appreciate the thought and detail you put into these responses. That's beyond the scope of what I anticipated discussing.

The types of things I had in mind are old techniques that people use for processing materials, like running a primitive forge or extracting energy from burning plant material or manual labor. What's the energy efficiency difference between generating electricity with a hand crank vs. a nuclear reactor? Even if you take into account all the inputs it takes to build and run the reactor, the overall output to input energy ratio is much higher, but it relies on a lot of infrastructure to get to that point. The type of efficiency I'm thinking of is precisely the energy required to maintain and run something vs. the work you get out of it.

In the same way, while old computers are much less efficient, models like these that have been manufactured for decades and exist all over might end up being a better fit in some cases, even with less efficiency. I can appreciate that the integration of components in newer machines like the ATSAMD20 can reduce complexity in many ways, but projects like CollapseOS are specifically meant to create code that can handle low-level complexity and make these things easier to use and maintain.

The Z80 voltage is 5V+/-5%, so right around what you were thinking. Considering the precision required for voltage regulation required is smart, but if you were having to replace crystals, they are simple and low frequency, 2-16Mhz, and lots have been produced, and once again the fact that it uses parts that have been produced for decades and widely distributed may be an advantage.

Your point about documentation is a good one. It does require more complicated programming, but there are plenty of paper books out there (also digitally archived) that in many situations might be easier to locate because they have been so widely distributed over time. If I look at archive.org for ATSAMD20 I come up empty, but Z80 gives me tons of results like this: https://archive.org/details/Programming_the_Z-80_2nd_Edition...

Anyway, thank you again for taking so much time to respond so thoughfully. You make great points, but I'm still convinced that it's worthwhile to make old hardware useful and resilient in situations where people have limited access to resources, people who may still want to deploy some forms of automation using what's available.

Projects like this one will hopefully never be used for their intended purpose, but they may form a basis for other interesting uses of technology and finding ways to take advantage of available computing resources even as machines become more complicated.

What's your point? A lot of simple devices are still being manufactured with cheap microcontrollers. Most of them don't even have an OS as such. If society collapses it's not like people are going to scavenge the microcontroller out of their washing machine and use it to reboot civilization.
In https://news.ycombinator.com/item?id=43484415 I outlined some extremely advantageous uses for automatic computation even in unlikely deep collapse situations, for most of which the microcontroller out of your washing machine (or, as I mention in https://news.ycombinator.com/item?id=43487644, your disposable vape or USB charger) is more than sufficient if you can manage to reprogram it.

Even if your objectives are humbler than "rebooting civilization" (an objective I think Virgil opposes), you might still want to, for example, predict the weather, communicate with faraway family members, automatically irrigate plants and build other automatic control systems, do engineering and surveying calculations, encrypt communications, learn prices in markets that are more than a day's travel away, hold and transmit cryptocurrencies, search databases, record and play back music and voice conversations, tell time, set an alarm, carry around photographs and books in a compact form, and duplicate them.

Even a washing-machine microcontroller is enormously more capable of these tasks than an unaided human, though, for tasks requiring bulk data storage, it would need some kind of storage medium such as an SD card.