Digital muffler for electric and hybrid vehicles
Hardware Required:
- Hardware Dongle from CANOPi TesCustoms P/N 100-0001-A
- Raspberry Pi Compute Module 4 Pi Foundation P/N CM4
- SeeddStudio Dual Gigabit Carrier Board CM4 Carrier Board SeedStudio SKU 102110497
- OHP OBD2 Adapter Harness Manufacture P/N 10246
- Custom 3D CAD file TesMufflerCADv1.stl 3D printed muffler with magnets
Python APIs project is exploring:
- Tesla API is a community of developers who are reverse engineering Tesla’s API: https://teslaapi.dev/
- Smartcar API lets you read vehicle data (location, odometer) and send commands to vehicles (lock, unlock) to connected vehicles using HTTP requests: https://github.com/smartcar/python-sdk
- The Comma Pedal is a gas pedal interceptor. It is a device that is inserted between a car’s electronic gas pedal and the ECU (Engine Control Unit): https://github.com/commaai/openpilot/wiki/comma-pedal
- All Comma Software: https://github.com/commaai/panda/tree/ad12330d506ca31fe16f99a5b5aca76aab8a1ec9
- TODO https://teslascope.com/
The connect_with_retry
function can be used to establish a connection to a device with retry mechanism. Here is an example usage:
import time
# Attempt to connect to the device with a maximum of 5 retries and a 1-second delay between retries
device = connect_with_retry(max_retries=5, delay=1)
if device:
print("Connected to the device successfully")
else:
print("Failed to connect to the device after 5 retries")
The example_pitch_shift
function can be used to shift the pitch of an audio signal. Here is an example usage:
import numpy as np
# Generate a sample audio signal
sample_rate = 44100
frequency = 440 # Hz
duration = 1 # second
t = np.linspace(0, duration, int(sample_rate * duration), False)
note = np.sin(frequency * t * 2 * np.pi)
# Shift the pitch of the audio signal by 2 semitones
shifted_note = example_pitch_shift(note, sample_rate, 2)
# Play the shifted audio signal
import sounddevice as sd
sd.play(shifted_note, sample_rate)
sd.wait()
Next steps:
Download the following sounds using “youtube-dl —extract-audio —audio-format mp3 http://videoURL” linux command
- McLaren F1
- Ferrari LaFerrari
- Porcshe 911
- BWM M4
- Jaguar E Type Series 1
- Ford Model T
- Subaru WRX STI
- Motor whine directly from your Tesla
- Star Wars Pod Racer
- OTHER SUGGESTIONS? Tweet me @BlazeDSanders or submit GitHub issue
Why?:
- https://www.nhtsa.gov/sites/nhtsa.gov/files/documents/812347-minimumsoundrequirements.pdf
- https://www.cnbc.com/2017/10/12/tesla-ceo-elon-musk-reveals-he-owns-two-gasoline-cars.html
TODO: Display for PiPico https://www.hackster.io/news/miroslav-nemecek-s-picovga-brings-high-res-video-to-the-raspberry-pi-pico-just-add-resistors-88dd144e7d1c FIND URLS I DELETED FROM TOP OF EngineSoundGenerator.py FILE https://whimsical.com/tesmuffler-64NBDWF5cd3stpZDvkubzw AM Radio IC Manufacture P/N TODO