Today I had to take my old Honda for a state emissions test. The test consists of looking under your car with a mirror, and plugging in the OBDII for about 2 minutes. They may have some sensors for the exhaust gases, but it's not obvious. It's my understanding that they poll the OBDII for any error codes, and that is just about it. I passed, but had to wait in line long enough to make me think subversive thoughts.
I was reminded of the work I did years ago building an OBDII reader. But how hard would it be to make a spoofed OBDII device? It seems like it would be pretty easy to disconnect the OBDII and put a micro-controller behind the OBDII connector to read back a clean bill of health.
The usual disclaimer, I would never do such a thing and I don't advocate any one else do it. But as an intellectual exercise I thought I'd look into the feasibility. I wonder if there are protections against this sort of thing?
There are no new ideas under the sun, so a little googling found some people thinking of the same thing:
Ease Diagnostics makes an OBD-II emulator -
Looks like the OBDII has some vehicle information, rpm, etc. All which would be easy to duplicate. So the first step would be to read your present OBDII, clone the information, and write it back to the spoofer.
One of my raspberry PI's might be best, because it has lost of memory/disk for stored values and GPIO to write a bit banged serial interface, and you can connect a keyboard, display and mouse for the programming phase. An arduino might be able to pull it off, but I suspect it would require two programs. One to read and one to spoof.
This page has some info on what the emissions test is looking for
I'll put this idea on the shelf for now and see if I decide to build it later.