Skip to content

Star Trek Calculator Replica: Reviving the Math Gadget from 1977's Star Trek Era

Web project initiative by Michael Gardi titled Trekulator - Pioneering a Maker's Unexplored Realm. This entertaining construction well replicates the original and showcases Michael's skillful emulation.

Maker Michael Gardi's latest endeavor, Trekulator, has been unveiled on our website.io. Inspired by...
Maker Michael Gardi's latest endeavor, Trekulator, has been unveiled on our website.io. Inspired by the original, this engaging build has been expertly crafted by Gardi, transporting users on a thrilling journey.

Star Trek Calculator Replica: Reviving the Math Gadget from 1977's Star Trek Era

Revised Article:

Check out the latest DIY project over on our website.io, Trekulator - The Next Frontier for Makers, brought to you by [Michael Gardi]. This bad boy's a blast to tinker with, and [Michael] nailed the old-school feel while sprinkling some modern tech in there.

He employed our website.io's logging feature to keep a record of his progress since September 2024. The journey included crafting the case, resurrecting the original hardware, lighting up a 7-segment display, adding audio functionality, getting the keypad and TFT display working, wire wrangling, designing PCBs, adding a power socket, and upgrading the keys - a total of 7 glorious months of dedication!

Now here's the kicker: while the original device rocked with four red LEDs, [Michael] upgraded with an entire TFT display - talk about excess, according to the standards of 1977!

The software powering the ESP32 microcontroller is a bit of a beast. It's got audio, graphics, animations, keyboard support, and that quirky Trekulator logic all wrapped up in one. But beware, there are some edge cases where the calculations go awry, especially when making longer calculations.

For example, asking the device to sum two eight-digit numbers like 90,000,000 and 80,000,000 normally adds up to a nine-digit value, 170,000,000. However, due to floating-point precision issues, the TFT display might spit out a different number, such as 17,000,000 or 70,000,000 – crazy, right? Let's grab some components and see if we can figure out exactly what's happening here! Ever stumbled upon floating-point precision bugs like these in your own projects?

We appreciate [Michael] sharing his work with us and making it public via our tips line!

Floating-Point Precision Bugs in Microcontroller Projects

When dealing with floating-point arithmetic in projects like Trekulator, several challenges can arise due to its complex nature. Here's an overview of potential issues and solutions for floating-point precision bugs:

Potential Issues

  1. Floating-Point Arithmetic Challenges: Microcontrollers often lack hardware support for floating-point operations, resulting in slower computation and potential precision issues. Although the ESP32 offers software-based floating-point support, this still may create challenges.[1]
  2. Rounding Errors: Floating-point representations can lead to rounding errors, especially during precise calculations.
  3. Overflow and Underflow: Values being computed may become too large or too small, causing overflow or underflow.

Solutions

1. Use Fixed-Point Arithmetic

  • Description: Instead of using floating-point numbers, consider implementing fixed-point arithmetic. This approach involves representing numbers as a combination of an integer and fractional part, leading to more predictable and efficient results on microcontrollers.
  • Example:

2. Use Libraries with Floating-Point Support

  • Description: Use libraries or frameworks with robust floating-point support, such as CircuitPython for ESP32 projects.[1]
  • Example: CircuitPython provides floating-point support, even if the microcontroller lacks hardware support. This simplifies the use of floating-point numbers in your project.

3. Check for Overflow and Underflow

  • Description: Validate that your calculations do not exceed or fall below the valid range of floating-point numbers. Optimize your code to prevent overflow and underflow.
  • Example:

4. Use Appropriate Data Types

  • Description: Pick the suitable floating-point data type for your application. For instance, if high precision is not critical, opt for instead of to save memory and enhance performance.

5. Testing and Verification

  • Description: Thoroughly test your application to ensure that floating-point operations are accurate and do not introduce unexpected behavior. Debugging tools can help verify calculations, ensuring you have a precision-packed Trekulator.
  1. With the advent of modern technology, the Trekulator project, as shared by Michael Gardi, not only showcases the revival of old-school hardware but also integrates cutting-edge components like PCBs and gadgets.
  2. Artificial-intelligence might seem a stretch for Trekulator, but addressing the floating-point precision bugs in the software powering the ESP32 microcontroller could be a small step towards incorporating AI in future DIY projects.

Read also:

    Latest