Custom Calculator: ESP32 Perfboard Arithmetic Device

Executive summary

A hardware project to design a custom, portable calculator using an ESP32 microcontroller mounted on a perfboard, enclosed in a 3D-printable case. Beyond basic arithmetic on a small integrated display, it features IoT capabilities, emitting mathematical operations via MQTT to a central server for logging.

Business strategy & value proposition

The problem

  • Lack of extensibility: Standard calculators cannot log operations or send data to external dashboards.
  • Generic hardware: Off-the-shelf calculators lack maker-friendly customization options.
  • Educational gap: Building a calculator from scratch covers fundamental electronics, input handling, and basic IoT.

The solution

  • IoT-enabled calculations: Sends operational logs silently via MQTT for remote tracking or auditing.
  • Custom fabrication: Fully 3D printed ergonomic enclosure housing a modular perfboard.
  • Programmable logic: Written in C++, allowing the user to easily update firmware or add new mathematical functions.

Product features & UX

Tactile Keypad

  • Detail: Custom mechanical or membrane keypad interfaced with the ESP32.
  • Interaction: Provides satisfying feedback while debouncing signals effectively in software or hardware.

Operational Display

  • Detail: A high-contrast OLED or LCD screen.
  • Interaction: Displays standard calculations with a subtle indicator showing MQTT connection status.

Technical architecture

High-level stack

Component Technology Role
Microcontroller ESP32 Core logic, arithmetic, and Wi-Fi connectivity.
Display I2C OLED / LCD Real-time UI for the user.
Input Matrix Keypad Handling user digit inputs.
IoT Comms MQTT Protocol Logging operations to an external server.
Enclosure 3D Printed PLA/PETG Ergonomic housing for the perfboard and battery.

Core systems logic

  1. Input Handling: The matrix keypad is scanned continuously. Hardware debouncing (or strict software delays) ensures clean digits.
  2. Computation: The C++ logic parses the string of operations and calculates the result upon hitting "Enter".
  3. Telemetry: Simultaneously, the resulting string (e.g., "5+5=10") is published to an MQTT broker over Wi-Fi.

Handling edge cases

  • Battery Drain from Wi-Fi: Constantly searching for an MQTT broker will kill the battery fast.
    • Mitigation: Implement deep sleep for the ESP32, waking on key presses, and batching MQTT logs to send periodically instead of per-operation.
  • Button debouncing glitches: Multiple key presses logged accidentally.
    • Mitigation: Implement a dedicated robust keypad library and possibly hardware RC filters on input lines.

Future roadmap

Phase 1 (MVP)

  • [ ] Prototype the circuit on a breadboard with ESP32 and keypad.
  • [ ] Implement basic arithmetic logic and screen rendering in C++.
  • [ ] Program basic MQTT logging functionality.

Phase 2

  • [ ] Optimize power consumption (deep sleep, wake-on-keypress).
  • [ ] Solder components permanently to a perfboard.
  • [ ] Design and print the V1 compact enclosure.

Phase 3

  • [ ] Add advanced mathematical functions (trig, memory).
  • [ ] Build a companion web dashboard to visualize the MQTT calculation logs.
  • [ ] Implement offline caching of logs when Wi-Fi drops.