Debugging Our Ambulance

By masukomi • 14 minute read •


Debugging Our Ambulance

tl; dr: two developers use standard debugging techniques to fix electrical problems in their ambulance.

Setting The Stage

We had to drop our car off at the dealership last night. In order to avoid walking home in the dark, on roads without sidewalks, in 27°F (-2.7°C) - or just the last two shortly after dawn, we needed to drive the 🚑 Ambulance. Unlike most years, I actually remembered that it had a block heater[1] and had turned it on at the beginning of winter.

Because it was so cold, I went out in the morning and double checked that that the block-heater was turned on. It was. What I didn’t check was the voltmeter[2].

The Problem

That evening - in the cold, and dark of winter - I hopped into the 🚑, turned the key, and… nothing. Literally nothing happened. I looked over to the voltmeter and understood why. Zero volts coming from the batteries. Nothing to power the ignition.

A debugging we will go

Gather the initial known truths

We don’t know where the AC in from the side of the ambulance goes. I suspect it’s in our wiring diagrams[3] but we haven’t hunted that bit down yet.

Propose Theories

  1. the batteries are “dead”. They aren’t set up as some assume. See footnote.[4]
  2. the batteries are disconnected.
  3. the ambulance isn’t getting power from the house.
    • The house plug is bad.
    • The cord is bad.
    • The ambulance plug is bad.

Choose A Theory And Test It

Summary

Practicing a considered, and well structured approach to debugging is far more efficient than flailing wildly at random ideas that flit through your brain. It’s also very useful outside of software.

At each step of the way I literally stopped and restated what we knew the known truths to be, and ask what new information we could derive from the theories we’d eliminated or confirmed.

While we didn’t do a formal “post-mortem” to the “production incident”, we did create “action items” from it.

Good debugging and Incident Management procedures help in your everyday life too.

For a good guide to debugging start with “The Pocket Guide To Debuging”, by Julia Evans.

For a good guide to creating your own incident management processes, start with Graceful Disasters, by me.

Afterward

(based on internet commentary)

The electrical systems in modern ambulances are nothing like those in cars, diesel trucks, or RVs. Unless you’ve helped manufacture these things, or have spelunked in the wiring of one first hand, your assumptions about how things work are probably wrong. Additionally, each one is a literal one-off-custom build.

I assure you that it’s very easy for a brand new starter battery to go dead in 6 weeks of cold weather if an ambulance isn’t plugged in. This makes sense if you understand the regulations these must meet to give you the best chance of survival in some extreme environmental conditions. It makes sense if you understand how they’re used by the EMTs and Paramedics.

Trust me when I tell you, that once we get beyond “Electricity 101” and Ohm’s Law, you should throw your assumptions about how this is wired or constructed out the window. We aren’t guessing about how it’s wired. We have ridiculously detailed wiring diagrams for this specific vehicle. Every wire’s insulation says what that specific wire is for. We know how things are connected. We just don’t know where everything is connected. To put it another way. We know that two wires meet at a junction, we just don’t know which part of the wall each junction is hidden behind.


a picture of our ambulance dashboard. There are 14 toggle switches, a radial-dial voltmeter, indicator lights, a ham radio, and a ham radio handset
our ambulance dashboard
  1. A block heater is basically an electric blanket for your engine. This is especially notable for large diesel engines for three reasons: ↩

    1. diesel stops being liquid and turns to a gel when it gets cold enough. They actually change the formula in the pumps just before winter temperatures kick in. A diesel engine uses “glow plugs” to heat the fuel. I don’t know what they look like, but they’re essentially just little electric heaters in the fuel system. They take a lot of power, and a many minutes to make the diesel ignitable on cold days.
    2. our engine is so large that even if you do manage to get it started in the cold it takes a long time to heat up all the metal.
    3. diesel engines don’t have spark plugs. They combust the fuel by compressing it, which is harder to do when it’s a gel.
  2. Ambulances have dashboards with a lot of switches (see below). There’s also a voltmeter (the radial-dial). Unsurprisingly an 🚑 has a lot of electrical stuff going on. Unlike most vehicles there’s a non-trivial phantom draw. It will drain its two AGM batteries if it just sits around for a while. This is acceptable, because it was designed to be used literally every day. It’s also got a 120v AC input on the side (with a weird plug). We don’t drive ours much, but we do keep it plugged in.

    The voltmeter is important because if yours is low, the EMTs and Paramedics in the back are going to have trouble using things like IV bag warmers and having lights to see what they’re doing. You want to know early if there’s a problem. ↩

  3. Unlike most vehicles every 🚑 has complicated custom wiring. Every ambulance is custom built. What features you get depends mostly on how much your town is willing to spend[6]. Manufacturers need to keep track of what they put into each one so that they know how to fix it if it comes back for repairs. When we got ours, we called up the manufacturer, gave them our Vehicle Identification Number, and asked them to send us a PDF of the wiring diagram for our vehicle. ↩ ↩2

  4. The ambulance has 2 AGM batteries wired in parallel. There is not a separate “house” battery and “starter” battery. Within the US there are strict regulations about being able to maintain temperature in the patient area of an ambulance. Basically you need to be able to keep it cool in the middle of Death Valley in the summer, and you need to be able to keep it warm in the northernmost part of Alaska in the winter. You’d need a massive battery to be able to power the heating and cooling systems to achieve this for hours on end. Ambulance manufacturer’s don’t bother. Instead they just guarantee that that will work while the engine is running. In my case they accomplished it by using two beefy alternators. ↩

  5. Of course we have spare fuses on hand. A) it’s an ambulance with a billion cabinets. B) It would really really suck to be stuck on the side of the road just because you didn’t have a fuse. Especially in a long distance (thousands of miles) trip like the ones we take. B) of course the fuses are right next to the electrical cabinet. Why would you keep them anywhere else? ↩

  6. A new Type III ambulance - the big boxy ones with a van shaped front - starts around $150,000. Most towns sell them after they hit 100,000 miles. That’s how we got ours significantly cheaper. ↩