“When something is worth doing, its worth overdoing.”
Simple Task: To delay the car amp power on until carputer is booted.Prevents USB Initalization “thump” through the sound system.
Simple Solution: The computer sends a heartbeat every few second to the board to keep it alive. If no heartbeat received within the timeout, amp shuts off.
Actually Implemented:
1. Manual Switch Override (Always On, Except with Ignition Off)
2. Variable Delay (from 5s to 60s).
3. Can drive up to 40A load!
4. Visual indicator on time left (Blue LED dims as time runs out)
5. Bi-directional communication. Device alerts the host of delay change to adjust heartbeat rate
Parts:
- Teensy 2.0 (Arduino Mode)
- 2N2222 Transistor
- 12V Automotive Relay
- 1N4001 Diode (relay snubber)
- LED’s (Red, Green, Blue, Amber)
- 5x 330 ohm Resistors
- 10K Potentiometer
- 1K Resistor
- Molex Connector
- Enclosure
This is implemented as a windows service that detects any power event (Suspend, Hibernate, Reboot, Shutdown) and can send a proper response to the control circuit (Heartbeat or Kill). The trigger is also controlled via Ignition Power so that the amp will shut off when the car’s ignition is turned off regardless of the status of the carputer or the override switch. The communication between the device and computer happens via USB and emulated Serial protocol. When the delay is changed on the device, a new value is sent to the computer so that the service timer can adjust it’s heartbeat rate accordingly. By default, the service will send 2 heartbeats per delay value but that can be changed in the app.config. So far the solution has withstanded countless reboots and it always properly brings up the amp on restore.
Simple Circuit Diagram
Arduino/Teesny Code: AmpDelay
Windows Service Source Code (Visual Studio 2010 / .Net 4.0): AmpDelayService
Created a test circuit on a breadboard for development purpose. Didn’t feel like etching a one-off board so used a perfboard, especially since there’s not a lot of components involved.
Used a small enclosure to house everything. Pretty tight fit. Could have kept the wires shorter, but I wanted ability to take it apart many times since the flash button on the Teensy is not easily accessible.
Device in testing. Sorry about the blurry pic, didn’t want to use a flash and was shooting hand-held. Yeah, the 4 LED’s is really overkill, especially since I could have implemented it via multi-color ones, but meh, might as well have some fun with it.
Pingback: Teensy + Raw HID + C# = Eureka! | Altered Realms