APPLE2IDIOT Expansion Card Lets Your Apple II (Sort Of) Access The Internet

[Nathanial Hendler]’s Apple2Idiot expansion card for the Apple II family of computers is a nifty mix of modern and vintage, and provides a clever means of allowing the host computer to (indirectly) access the internet over WiFi while keeping things simple from the host computer’s perspective.

The PCB has plenty of space on which to silkscreen reference data. Click to enlarge.

It does this by embedding an ESP32 module and a dual-port RAM chip onto an expansion card. The Apple2Idiot, when installed into a host machine, presents as a memory location which the host machine can access. The ESP32 then takes care of all the WiFi communications and tasks requiring internet access, and the host computer directs these tasks (and reads their output) via PEEK and POKE commands.

This means that there are two pieces of software for any given task: one running on the ESP32 doing the actual work, and one running on the Apple II that communicates with the ESP32 on the card by reading and writing to memory. It’s a simple system, and one that [Nathanial] thinks works quite well for specific tasks.

Example programs include things like scanning and selecting a WiFi network, fetching weather data, and sending a message to Slack. Making new applications does mean having to write software on two ends, but the simplicity of the system also means flexibility, because anything the ESP32 does can have its complexity abstracted away by the time its data is presented to the host machine. Not that the Apple II is incapable of dealing with the modern internet more directly; we’ve seen a basic Apple II web server written in BASIC.

Four jumper wires with white heatshrink on them, labelled VCC, SCL, SDA and GND

The Connector Zoo: I2C Ecosystems

I2C is a wonderful interface. With four wires and only two GPIOs, you can connect a whole lot of sensors and devices – in parallel, at that! You will see I2C used basically everywhere, in every phone, laptop, desktop, and any device with more than a few ICs inside of it – and most microcontrollers have I2C support baked into their hardware. As a result, there’s a myriad of interesting and useful devices you can use I2C with. Occasionally, maker-facing companies create plug-and-play interfaces for the I2C device breakouts they produce, with standardized pinouts and connectors.

Following a standard pinout is way better than inventing your own, and your experience with inconsistent pin header pinouts on generic I2C modules from China will surely reflect that. Wouldn’t it be wonderful if you could just plug a single I2C-carrying connector into an MPU9050, MLX90614 or HMC5883L breakout you bought for a few dollars, as opposed to the usual hurdle of looking at the module’s silkscreen, soldering pin headers onto it and carefully arranging female headers onto the correct pins?

As with any standard, when it comes to I2C-on-a-connector conventions, you would correctly guess that there’s more than one, and they all have their pros and cons. There aren’t quite fifteen, but there’s definitely six-and-a-half! They’re mostly inter-compatible, and making use of them means that you can access some pretty powerful peripherals easily. Let’s start with the two ecosystems that only have minor differences, and that you’ll encounter the most! Continue reading “The Connector Zoo: I2C Ecosystems”

The microcontroller described in the article, on the PCB taken out of the kettle

Dumping Encrypted-At-Rest Firmware Of Xiaomi Smart Kettle

[aleaksah] got himself a Mi Smart Kettle Pro, a kettle with Bluetooth connectivity, and a smartphone app to go with it. Despite all the smarts, it couldn’t be turned on remotely. Energized with his vision of an ideal smart home where he can turn the kettle on in the morning right as he wakes up, he set out to right this injustice. (Russian, translated) First, he tore the kettle down, intending to dump the firmware, modify it, and flash it back. Sounds simple enough — where’s the catch?

This kettle is built around the QN9022 controller, from the fairly open QN902X family of chips. QN9022 requires an external SPI flash chip for code, as opposed to its siblings QN9020 and QN9021 which have internal flash akin to ESP8285. You’d think dumping the firmware would just be a matter of reading that flash, but the firmware is encrypted at rest, with a key unique to each MCU and stored internally. As microcontroller reads the flash chip contents, they’re decrypted transparently before being executed. So, some other way had to be found, involving the MCU itself as the only entity with access to the decryption key.

Continue reading “Dumping Encrypted-At-Rest Firmware Of Xiaomi Smart Kettle”

Screenshot of a logic analyzer software, showing the SDA channel being split into three separate traces

I2C Tap Helps Assign Blame For SDA Conflicts

If you’ve ever debugged a misbehaving I2C circuit, you probably know how frustrating it can be. Thankfully [Jim] over at Hackaday.io, has a proto-boardable circuit that can help!

Inter-integrated circuit bus (aka I2C) uses open collector outputs on a two wire interface. Open collector means a device connected to the I2C bus can only pull the bus down to ground. Chips never drive a logic “HIGH” on the wires. When nothing is driving the lines low, a weak resistor pulls the lines up to VCC. This is a good thing, because I2C is also a multidrop bus — meaning many devices can be connected to the bus at the time. Without open collector outputs, one chip could drive a high, while another drives a low – which would create a short circuit, possibly damaging both devices.

Even with all this protection, there can be problems. The SCL and SDA lines in the I2C communication protocol are bidirectional, which means either a controller or a peripheral can pull it low. Sometimes, when tracing I2C communications you’ll need to figure out which part is holding the line low. With many devices sharing the same bus, that can become nigh-impossible. Some folks have tricks with resistors and analog sampling, but the tried and true method of de-soldering and physically lifting chip pins off the bus often comes into play.

[Jim’s] circuit splits SDA signal into controller-side and peripheral-side, helping you make it clear who is to blame for hiccups and stray noise. To do that, he’s using 6N137 optoisolators and LMV393 comparators. [Jim] shared a NapkinCAD schematic with us, meant to be replicate-able in times of dire need. With this design, you can split your I2C bus into four separate channels – controller-side SDA, peripheral-side SDA, combined SDA and SCL. 4 Channels might be a lot for a scope, but this is no problem for today’s cheap logic analyzers.

Continue reading “I2C Tap Helps Assign Blame For SDA Conflicts”

Track Those Leftovers With This Little Timer

We’ve all at some point in our lives opened the fridge door and immediately wished we hadn’t. A miasma of stench envelops us as we discover that last Saturday’s leftovers have been forgotten, and have gone off. If only we had some way to keep track of such things, to avoid such a stench-laden moment. Step forward [ThinkLearnDo], with a little timer designed for exactly that purpose.

The operation is simple enough, press the button and place the unit on top of the container with the leftovers in it. If you haven’t eaten the leftovers within a week, the LED will start blinking. The blink is a subtle reminder to deal with the old food before it becomes a problem.

Onboard is a Holtek HT68F001 microcontroller with a coin cell for power, not much else is needed. The Holtek is an unusual choice, one of several brands of super-inexpensive Chinese microcontrollers we see less commonly than ATmegas and STM32s. This is exactly the place where such a minimal computer fits perfectly:  a way to add a little bit of smarts to a very cheap item with minimal strain on the BoM.

If these chips interest you, a while back we covered a run-down of the different families including the Holtek and the famous 3-cent Padauk chips.

All-In-One Automated Plant Care

Caring for a few plants, or even an entire farm, can be quite a rewarding experience. Watching something grow under and then (optionally) produce food is a great hobby or career, but it can end up being complicated. Thanks to modern technology we can get a considerable amount of help growing plants, even if it’s just one plant in a single pot.

Plant Bot from [YJ] takes what would normally be a wide array of sensors and controllers and combines them all into a single device. To start, there is a moisture sensor integrated into the housing so that when the entire device is placed in soil it’s instantly ready to gather moisture data. Plant Bot also has the capability to control LED lighting if the plant is indoors.  It can control the water supply to the plant, and it can also communicate information over WiFi or Bluetooth.

The entire build is based around an ESP32 which is integrated into the PCB along with all of the other sensors and components needed to monitor a single plant. Plant Bot is an excellent all-in-one solution for caring for a plant automatically. If you need to take care of more than one at a time take a look at this fully automated hydroponic mini-farm.

Automatic Turntable Makes Photogrammetry A Cinch

Photogrammetry is a great way to produce accurate 3D models of real objects. A turntable is often a common tool used in this work as it helps image an object from all angles. [Peter Lin] wanted a way to run the photogrammetry process with minimal human intervention, and set about building an automated turntable setup.

The build relies on a smartphone to take images of the physical object. The phone is triggered to take photos by an ESP8266, which fires the shutter via the phone’s audio socket. The microcontroller then turns the turntable on for a short period of time after each shot, rotating it by a set angle.

The build still requires objects to be repositioned in various orientations on the turntable now and then, in order to capture the top and bottom areas that would otherwise be obscured. However, the grunt work of taking the photos and rotating the objects is now entirely automated.

It’s a useful build for anyone that finds themselves regularly imaging objects to create 3D models. The results of [Peter]’s rig look great, and as a bonus come with life-like textures ready to go. We’ve seen some other great photogrammetry builds before, too. Video after the break.

Continue reading “Automatic Turntable Makes Photogrammetry A Cinch”