“Never trust a computer you can’t throw out the window” - Steve Wozniak
So my truck is old enough to not have any computers, except for the headdeck.
It is also the 2nd most stolen vehicle in the country, with 2 thieves that specialize in stealing this vehicle in the next province over, one reportedly with a master key from Nissan to make stealing easier.
I thought of having killswitches for the starter and fuel solenoids, but that’s quite easy to defeat if you know what you’re doing (e.g. use a hammer across the starter actuator terminals).
I also don’t want to put my aftermarket gauges back in as they’re a little bit unsightly, I don’t know where to put them that is nice, and they could also make the truck more interesting to thieves.
So I figured I’d use a collection of Pis and arduinos to both alert me of the trucks location via telegram via an LTE modem, and display various readings on a single 3.5" screen mounted on the steering wheel mast.
Here’s my basic architecture diagram:
Basic Plan
And how I figure I would accomplish each step:
Start detection
- the startup will cause large voltage spikes that may not even be quelled by caps causing damage to the equipment
- we don’t know if the engine is actually running except by:
- checking for voltage spikes from the alternator
- spying on the RPM signal
Boot up rules
- use arduino responsible for starting the pi(s)
- power provided from ACC line
- lots of/big caps and a diode to try keep it alive
- listen for voltage spikes on alternator/battery line
- use voltage divider to level the voltage
- look for 13v equiv to indicate engine start
- this will use A0
- this probably require pushing the throttle as charging voltage not produced on idle?
- listen to pulse on RPM sender
- jump the terminals on the back of the tacho
- plug one end into D2
- plug one end to GND
- detect the frequency of pulse to and trigger on >500rpm
- other options:
- listen for audio of engine (too early detect?)
- detect vibration (too early detect?)
- detect heat (too slow?)
Boot up trigger
- NC relay powered from ON, arduino trigger relay to open then back to closed
- Pis auto boot when power is re-applied
Shutdown trigger
- Use a voltage divider and feed stepped down ACC signal to a spare GPIO
- read the GPIO and when the signal goes away, trigger a shutdown
- OR use a read-only rootfs
Peripherals
- USB GPS logger attached to piZ (via powered USB hub)
- USB LTE modem attached to piZ (https://www.gowifi.co.nz/teltonika/trm240.html) (via powered USB hub)
- USB FTDI attached to pi2
- Serial bus attached to FTDI via UTP
Sensors
Implement in order of A, B and C
- A - Exhaust Gas Temp (easy)
- A - Battery voltage level (easy)
- C - Water temp DS18B20 probe (easy)
- B - Outside temp DHT22 (easy)
- C - Alternator voltage output (medium)
- B - Oil Pressure(medium)
- C - RPM (medium)
- C - Boost (hard)
Application
So then there’s 2 applications I need to develop.
Readings Display GUI: RPi2/3
- any OS, but probably Arch
- Golang + Qt/QML
- GTK preferred but previous experiments failed
- boot speed optimized
- Simple grid showing the readings
- Later try to add a multi-axis chart view of readouts
Security bot: RPi Zero W
- boot speed optimized
- PiCore or Arch?
- Telegram bot runs on the RPiZ
- Sends message when truck is started
- Uses slash commands in a bot menu at the bottom of the chat
- Command “track” will send the GPS coords every sec, disable the auto shutdown
- Command “kill” will hold a normally closed relay open on the fuel solenoid and starter solenoid (FUTURE)
I’ve done so pre-work over the years. Like I have done proof of concept for the EGT and oil pressure in the past so I know I can read them, and I have the circuit diagrams for them, it would just require calibration against the actual gauges. The DHT22 and the DS18B20 are easy to read. I also have the USB GPS logger premade and ready to go as well as the voltage divider for the battery voltage checker.
I’ve already got most of the kit, so will try get started over Xmas, but it will be a long slog so I may be a while between updates, since I have a wife fresh out of surgery to look after, a 110yo house to maintain, and I also need to do other work on the truck to finalize it for certification.
In the meantime I’d be keen to hear suggestions or recommendations.