Project Overview
"Tesla-Guard" is a specialized study in Infrastructure Monitoring Forensics and EV Battery Management Harmonics. One of the critical challenges in Electric Vehicle (EV) ownership is the "Vampire Drain"—the gradual loss of energy when the vehicle remains unplugged. This project provides an automated safety net, utilizing an ATtiny85 microcontroller to monitor the garage environment. By sensing the simultaneous presence of a Tesla and the absence of a connected charger, Tesla-Guard triggers an acoustic reminder, ensuring the vehicle's battery integrity is maintained through consistent charging.
Technical Deep-Dive
- Dual-Sensor Logic Fusion:
- Presence Diagnostics: The system employs an HC-SR04 sonar node to detect the vehicle's physical presence. By measuring the Time-of-Flight (ToF) of ultrasonic pulses, the firmware distinguishes between an empty garage (long-range reflection) and a parked Tesla (short-range reflection). A "Two-Consecutive-Reading" filter is implemented to eliminate noise-induced false negatives.
- Mechanical Hook Forensics: A tactile pushbutton is integrated into the wall-mounted charging hook. If the cable is resting on the hook, the switch is depressed $(\text{Logic High})$; if the cable is deployed to the vehicle, the switch is released. The forensics requires both the "Presence" and "Hook" signals to be active to increment the 30-minute alarm timer.
- ATtiny85 Micro-Compute Forensics:
- Resource Optimization: While prototyped on an Arduino Nano, the final deployment utilizes the ATtiny85—an ultra-compact 8-pin microcontroller. This transition demonstrates Logic Consolidation, where the entire firmware, including debounce loops and duty-cycle LED blinks, is flashed onto the AVR core using a Tiny AVR programmer, reducing the hardware footprint and power consumption to under 100mA.
- Acoustic Notification Harmonics:
- Transistor-Driven Buzzer: To drive the active buzzer without stressing the ATtiny85's GPIO pins, an S8050 NPN transistor is utilized as a low-side switch. This forensics ensures the buzzer receives full rail-voltage $(\text{5V})$ for maximum audibility throughout the household.
Engineering & Implementation
- Relational Timing Diagnostics:
- The 30-Minute Counter: The main loop executes on a 10-second polling interval. A software counter tracks time; if the vehicle remains detected but unplugged for 180 consecutive cycles $(\approx 30\text{ minutes})$, the alarm is latched. This delay provides ample time for cargo unloading while preventing long-term charging neglect.
- HMI Telemetry: A status LED provides visual forensics by "Blinking Out" the distance detected by the sonar node. This allows the user to verify the sensor's calibration without needing a serial monitor or external display.
- Structural & Rail Stability:
- Decoupling Diagnostics: 0.1uF and 10uF capacitors are strategically placed across the power rails to suppress high-frequency noise from the DC wall-wart, ensuring the ATtiny85's clock remains stable in a noisy garage environment.
Conclusion
Tesla-Guard effectively bridges the gap between Home Automation and Automotive Asset Protection. By mastering Dual-Sensor Fusion Forensics and Compact AVR Implementation, thedalles77 has created a robust, low-cost solution for a common EV ownership hurdle, proving that intelligent reminders are often the best defense against battery degradation.