In engineering, the devil is in the details. Chapter 3 peels back the layers of our detailed design, from RF circuitry to software algorithms. By iterating on prototypes and refining each subsystem, we crafted a coherent, high-performance tool ready for clinical exploration.
RF Link and Circuitry
Our transmitter uses a PAM8302 audio amp driving a hand-wound inductor to emit 8 kHz bursts. Receiver coils, op-amp amplification (gain ≈ 340), envelope detection (τ = 1 ms), and comparator digitization extract clean PWM signals. Coil inductance tuning (up to 1.35 mH) maximized range to 6 cm under test conditions.
Sensor and Peripheral Design
HC-SR04 ultrasonics measure 2–60 cm, feeding Timer2-based echo timing into distance computations. LEDs signal proximity thresholds (±2 cm green, 2–5 cm yellow, > 5 cm red). A servo arrow mirrors LED states for intuitive visual guidance. Strategic PCB mounting and standoffs secure components within 3D-printed enclosures.
Software Architecture
A 256-entry sine lookup table drives OCR1A for pitch and volume modulation. ISR-based RF decoding and ultrasonic triggers run alongside a moving-average filter and goal-distance logic. Separate code sections for main theremin functions, RF prototype, and servo control were merged, revealing and resolving interrupt mask conflicts along the way.
Prototyping and Iteration
Parallel breadboarding of RF, audio, and sensor subsystems allowed targeted troubleshooting with oscilloscopes. Once validated, each module was integrated step by step, ensuring minimal interference and robust performance. Final enclosure tweaks—angling the remote ultrasonic by 40°—eliminated cross-talk between sensors.
Conclusion
Chapter 3 showcases the meticulous engineering behind our device. Through methodical testing, component optimization, and coordinated coding, we delivered a solution that balances complexity with reliability—ready for the next phase of validation.