A ZX Spectrum Raytracer, In BASIC

[Gabriel Gambetta] knows a few things about ray tracers, being the author of Tiny Raytracer, a raytracer written in just 912 bytes of JavaScript. As a long-time fellow sufferer of the UK-designed ZX Spectrum, could these two love affairs be merged? Could the Tiny Raytracer fit on the ZX Spectrum? In BASIC? The answer is an affirmative, albeit with our beloved speccy’s many limitations.

Ray tracing with only 15 primary colours

The story starts with [Gabriel]’s Computer Graphics From Scratch (CGFS) raytracer algorithms and an existing code base that was ported to the ZX Spectrum’s very limited BASIC dialect, using VSCode for editing, BAS2TAP to generate a tape image file (essentially an audio track) and executed with FUSE. With the toolchain sorted, [Gabriel] adds just enough code to deal with the ray intersection equations of a sphere, and renders a three-sphere scene to a 32×22 pixel colour image, taking a mere 15 minutes of runtime. Fellow sufferers will remember the spectrum had a 32×22 block attribute array (or colour array) with two colour values for foreground and background pixels. Each attribute block contains 8×8 pixels, each of which could be foreground (on) or background (off.) The next stage was then to expand the code to handle pixels as well as blocks, by simply expanding the raytracing to the full 256×176 resolution, and for each block simply determine the two most common colours, and run with those for the whole block. It sort of works, in a very spectrum-esq ‘attribute clash’ kind of fashion.

Continue reading “A ZX Spectrum Raytracer, In BASIC

A DIY E-Ink Tank Watch

[Augusto Marinucci] liked the classic Cartier Tank series of dress watches aesthetic, but wanted something a bit more techy, with a decent runtime on a single battery. E-Ink displays are often used in such applications, but finding one to fit a custom case design, is a tall order. When ordering one off the shelf is not easy, the solution is to make one from scratch.

Building a programming jig is a great idea for small-scale production

The article doesn’t have much information on the E-Ink side of things, which is a bit of a shame. But from what we can glean, the segment shapes — in this case, based on the famous Apollo DSKY — are formed in the top copper of a four-layer PCB, using filled and capped vias to connect invisibly from below.

A donor E-Ink display is cut to size with scissors (we don’t know much more than this!) and glued in place around the edge to make the common electrode connection. The display PCB attaches to the control PCB, at the rear using low-profile board-to-board connectors. This board hosts a PIC16 micro, as well as an RV-3028-C7 RTC which keeps time whilst consuming a paltry 45 nA.

Five volts are provided via a MAX1722 low-power boost converter which is fed power from the CR1616 cell via a couple of logic-controllable load switches. With a low-power design such as this, it’s critical to get this correct. Any mistakes here can easily result in a very low runtime. It is easy to over-stress small button cells and kill them prematurely.

The case looks like it’s printed in a translucent resin, with the PCB stack sealed inside with a UV-cured resin pour. It’s not immediately obvious if the rear panel can be removed to access the battery and programming port. There are what appear to be screw holes, so maybe that’s possible, or maybe they’re the rear side of the PCB mounting posts. Who can tell?

If DIY hardware is but too much effort for you, then there’s the option of hacking new firmware onto an existing watch, or perhaps meeting in the middle and making something out of all those junk E-ink tags you can get from time to time?

Thanks to [JohnU] for the tip!

What Can You Do With Thousands Of Vintage Telephones?

Telephones. We’ve got a few around the place, and some may remember all the weird and wonderful varieties produced over the years. But, vintage phone dealers [Ron and Mary Knappen] may have a few too many. With a large 41,000 sqft property, at least three farm buildings, and no fewer than 33 semi-trailers loaded to busting with racks of phones, the retiring couple have a job sorting it all out and finding someone passionate enough to take over this once-strong business.

Technology has moved on somewhat since 1971 when they got into the retro business, and there are only so many period dramas being produced that could make a dent in a collection of a thousand steel desk phones. Nobody seems interested in taking on their business, so they are concentrating on emptying that large property in order to sell it, but the fate of the crazy number of other storage locations seems uncertain. Perhaps, other than a few museums around the world purchasing a few, this collection really is likely heading to the recyclers.

So what can we do with a vintage phone in this modern era? Here’s a primer to get you started. How about going cellular? Or maybe just add them to your existing designer collection?

Thanks to [Jeremy] and Adafruit for the tip!

D-POINT: A Digital Pen With Optical-Inertial Tracking

[Jcparkyn] clearly had an interesting topic for their thesis project, and was conscientious enough to write up a chunk of it and release it to the wild. The project in question is a digital pen that uses some neat sensor fusion to combine the inputs from a pen-mounted gyro/accelerometer with data from an optical tracking system provided by an off-the-shelf webcam.

A six degrees of freedom (6DOF) tracking system is achieved as a result, with the pen-mounted hardware tracking orientation and the webcam tracking the 3D position. The pen itself is quite neat, with an ALPS/Alpine HSFPAR003A load sensor measuring the contact pressure transmitted to it from the stylus tip. A Seeed Xaio nRF52840 sense is on duty for Bluetooth and hosting the needed IMU. This handy little module deals with all the details needed for such a high-integration project and even manages the charging of a single 10440 lithium cell via a USB-C connector.

Positional tracking uses Visual Pose Estimation (VPE) assisted with ArUco markers mounted on the end of the stylus. A consumer-grade (i.e. uncalibrated) webcam is all that is required on the hardware side. The software utilizes the familiar OpenCV stack to unroll the effects of the webcam rolling shutter, followed by Perspective-n-Point (PnP) to estimate the pose from the corrected image stream. Finally, a coordinate space conversion is performed to determine the stylus tip position relative to the drawing surface.

The sensor fusion is taken care of with a Kalman filter, smoothed with the typical Rauch-Tung-Striebel (RTS) algorithm before being passed onto the final application. This process is running in Python using the NumPy module, as you would expect, but accelerated using the Numba JIT compiler.

Motion tracking is not news to us, we’ve seen many an implementation over the years, such as this one. But digital input pens? Why aren’t they more of a thing?

Thanks to [Oliver] for the tip!

Hackaday Prize 2023: Gen5X A Generatively Designed 5-Axis 3D Printer

[Ric Real] is entering the 2023 Hackaday Prize with the Gen5X, a generatively designed 3D printed five-axis 3D printer. The concept is not a new one, with the type of construction being seen a few times here and there. In addition to the usual three directions of motion, we’re familiar with, with the cartesian bot design, these types of machines add an additional two rotation axes, one which can swing the build platform front and back around the X-axis, and a second that provides rotation around the Z-axis. These combined motions give rise to some very interesting capabilities, outside of our familiar 3D printing design constraints.

As for the generative side of things, this is a largely theoretical idea. Essentially the concept is that the machine’s design can be iteratively updated and optimised for performance to fit into the constraints of available hardware such as motors and other ‘vitamins’ needed to create the next generation of machines. The design files should be parameterised enough such that this optimisation process can be automated, potentially via input from AI, but we suspect we’re a way off from that yet. Whether this project as yet satisfies any of these lofty goals remains to be seen, but do keep an eye on it if you’re so inclined. There is a Fusion 360 project here to dig into, but if you’re not interested in the research side of the project, but just want to build a 5-axis machine to play with, then you can find the project source on the GitHub Page.

If this feels familiar, you’d be on the right track, as we covered at least one other 5D printer recently. We have also touched upon generative design at least once. We’re sure we will see more on this topic in the future.

Continue reading “Hackaday Prize 2023: Gen5X A Generatively Designed 5-Axis 3D Printer”

Hackaday Prize 2023: 10 KW Electronic Load

[tinfever] needed a high-power benchtop electronic load for an upcoming project, and by their own admission decided foolishly to build their own. And we’re glad they did. The thing is, whilst this isn’t exactly a super-cheap project to build, buying a commercial offering with a capability of 10 kW and up to 30 kW pulsed, is going to cost an absolute fortune.

A selection of small resistors

Built inside a cubic frame using what appears to be standard 2020 aluminum rails and fixturing, the modular construction is nice and clean, with plenty of space around the load boards to allow the cooling air to circulate.

The operating principle is very simple; custom PCBs act in parallel to provide any load needed, by switching in the on-board load resistor. Each load board handles all the details of switching and dumping the power due to the inductance in the system wiring and the wire-wound resistors themselves.

Whilst we know that wire-wound resistors are reverse-wound to minimize inductance, there will still be some, and each load board will contribute a little more when the whole system is scaled up. Also, each load PCB handles its own temperature sensing, and current measurement passing these data off to the control PCB. A front-end connector PCB provides a variety of connection options to interface to the DUT (Device Under Test.) The system controller is based around an STM32 processor which deals with quite a lot more than you might think is needed on a first look.

The sense currents from each load need to be sensed, scaled, and summed to keep the overall load accuracy within the 1% spec. Also, it is on duty for PWM control of the cooling fans, handling the user interface, and any other remote connectivity. There are a lot of details on the project page, as we’re only skimming the surface here. If you’re interested in building an active load, this is a project you really should be digging into.

We shall watch with interest for when [tinfever] scales up this eight-slot prototype to the full specification of 52 stages! When working with power applications, there comes a point when you really need an electronic load, and to that end, here’s one with a very specific use case to get you started.

There is also the option of buying something cheap from the usual sources and hacking on some custom firmware to adapt it a little to your needs.

 

Bypassing Bitlocker With A Logic Analzyer

Security Engineer [Guillaume Quéré] spends the day penetration testing systems for their employer and has pointed out and successfully exploited a rather obvious weakness in the BitLocker full volume encryption system, which as the linked article says, allows one to simply sniff the traffic between the discrete TPM chip and CPU via an SPI bus. The way Bitlocker works is to use a private key stored in the TPM chip to encrypt the full volume key that in turn was used to encrypt the volume data. This is all done by low-level device drivers in the Windows kernel and is transparent to the user.

TPM chip pins too small? Just find something else on the bus!

The whole point of BitLocker was to prevent access to data on the secured volume in the event of a physical device theft or loss. Simply pulling the drive and dropping it into a non-secured machine or some other adaptor would not provide any data without the key stored by the TPM. However, since that key must pass as plaintext from the TPM to the CPU during the boot sequence, [Guillaume] shows that it is quite straightforward — with very low-cost tools and free software — to simply locate and sniff out this TPM-to-CPU transaction and decode the datastream and locate the key. Using little more than a cheapo logic analyser hooked up to some conveniently large pins on a nearby flash chip (because the SCK, MISO, and MOSI pins are shared with the TPM) the simple TIS was decoded enough to lock onto the bytes of the TPM frame. This could then be decoded with a TPM stream decoder web app, courtesy of the TPM2-software community group. The command to look for is the TPM_CC.Unseal which is the request from the CPU to the TPM to send over that key we’re interested in. After that just grabbing and decoding the TPM response frame will immediately reveal the goods.

Continue reading “Bypassing Bitlocker With A Logic Analzyer”