Skip to content

Repository files navigation

ResistorLens

Precision Manual Resistor Color Recognition for Android

Status Platform Language UI License


📸 Overview

ResistorLens is a specialized Android application designed to calculate resistor values from high-resolution photos. Unlike fully automated AI solutions that often fail under different lighting conditions, ResistorLens employs a manual color sampling system enhanced by a magnifier and crosshair for 100% deterministic results.

Designed with a sleek Mocha-inspired dark theme, it provides an intuitive and accessible UX for engineers, hobbyists, and students.

🧠 The Story Behind

This project was born out of a personal challenge: as a color-blind (daltonic) individual, identifying resistor bands can be extremely difficult and error-prone. ResistorLens was created to bridge this gap, using mathematical color-matching to provide a reliable way to "see" and confirm the colors of electronics components.

✨ Key Features

  • 🔍 Precision Sampling: Interactive magnifier window and fixed central crosshair for pixel-perfect color picking.
  • 🎨 Smart Color Recognition: Euclidean distance matching enhanced by heuristics that weight color candidates based on their probability of appearing in specific resistor bands, significantly improving accuracy under real-world conditions.
  • 📏 4 & 5 Band Support: Toggle between standard and high-precision resistors with a single tap.
  • 📱 Adaptive Visual Resistor: A real-time visual representation of the resistor that updates as you pick colors.
  • 🌐 Full English Localization: Professional UI strings and smart ordinal band labels (1st, 2nd, 3rd Digit).
  • 🌓 Mocha Palette: High-contrast interface designed for laboratory and workshop environments.

⚠️ Known Limitations

While ResistorLens uses advanced neighborhood sampling to reduce noise, color detection accuracy depends heavily on external factors:

  • Lighting Conditions: Extremely warm (yellow) or cool (blue) lighting can shift detected colors. Neutral, bright light is recommended.
  • Image Quality: Low-resolution photos or blurry focus can lead to incorrect sampling.
  • Surface Reflections: High-gloss resistors may catch light highlights (specular reflections) that "wash out" the actual band color under the crosshair.

🚀 Getting Started

Prerequisites

  • Android 7.0 (API level 24) or higher.

Installation

  1. Go to the Releases section.
  2. Download the latest app-release.apk.
  3. Install it on your Android device (ensure "Install from Unknown Sources" is enabled).

🛠 Technical Architecture

  • Core Logic: Pure Java 17 for deterministic resistor calculations.
  • UI/UX: Android SDK with Material Components and Custom View handling for the visual resistor.
  • Color Engine: 3x3 pixel neighborhood sampling to mitigate sensor noise and chromatic aberration.
  • CI/CD: Fully automated pipeline via GitHub Actions for testing and signed production releases.
  • Testing: Robust test suite using Robolectric with a dataset of real-world calibrated scenarios.

📂 Project Structure

/resistorlens
├── .github/workflows/   # CI/CD (GitHub Actions)
├── app/
│   ├── src/
│   │   ├── main/
│   │   │   ├── java/... # MainActivity & UI Logic
│   │   │   └── res/...  # Layouts, Colors (Mocha), Drawables
│   │   └── test/        # Robolectric & Dataset Tests
│   └── build.gradle     # Module Signing & Dependencies
├── gradle/wrapper/      # Gradle Wrapper Files
├── build.gradle         # Root Project Configuration
├── settings.gradle      # Module Definitions
├── gradle.properties    # Build & Heap Config
├── LICENSE              # MIT License
└── README.md

🤝 Contributing

Contributions are welcome! Whether it's reporting a bug, suggesting a feature, or submitting a Pull Request, feel free to check the Issues page.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'feat: some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

📄 License

Distributed under the MIT License. See LICENSE for more information.


Built with ❤️ for the Electronics Community.

About

Precision manual resistor color recognition for Android. Features a magnifier and crosshair for deterministic results. Built for color-blind users with smart heuristics and a sleek Mocha theme. Supports 4 and 5-band resistors.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages