Fixing a flickering LED display

GSRCRXsi

Super Moderator
Moderator
VIP
So I figured I'd share a little side project I've been working on. props to @awptickes for help along the way.

My car has a Wideband AFR sensor with controller and 3-digit, 7-segment LED display. The controller can output 3 different signals for use. analog 0-5V wideband, analog 0-1V narrowband, and a digital 9600 8N1 serial signal for use with the LED display or to send to a computer.

unit here: http://www.wide-band.com/product-p/apsx_d1g1.htm I bought it cause it was cheap after my 10 year old PLX M-300 died.

Problem: LED display "flickers" under some conditions. the value on the display is right, but the segments are getting wonky. usually at idle and under heavy throttle. thus was very strange since the wideband unit does not interface with the car anywhere but power hookup. the problem got noticeably worse after i hooked up the 0-5V output signal to the ECU for datalogging.

see here:

wired up like this:


First thought (me, Doug, the manufacturer) was it was a problem with the input voltage. maybe excessive AC ripple was causing problems. mfg asked me to install a large filter capacitor (3300uF!) between the power and ground to the unit. I did that with no success, did not change the symptoms at all. I checked the apparent AC ripple (~0.03-0.04V) and found it to be negligible, all grounds checked out as well.

Next me and Doug concluded that the digital signal must be getting borked up somehow. Doug thinks it is the extra strain from hooking up the 0-5V signal output. So since the analog signal appeared to be ok in my logs. I had the idea to try to regenerate the serial output from the analog signal on my own using a microcontroller.

Enter the Adafruit Pro Trinket 5V. about the size of a quarter, can run on up to 16V, and has all the power i need to do analog-digital conversion and output vial serial.

https://www.adafruit.com/product/2000

plan:


So I asked the manufacturer what the serial protocol needed to send data to their display to which they replied "It is a simple one byte protocol. 147 = 14.7 AFR" so i wired up the trinket, and started testing. I used a regular computer PSU for my bench test as it outputs both 12V and 5V. I used the 12V for power, and the 5V for my analog input. I didnt have a pot, so I threw together a simple resistor voltage divider to get myself 2.5V just to test a middle value. my first few rounds of testing didnt go so well, had to make a bunch of small syntax changes to the code but i've never used an arduino before so i was just learning as i go.





when i finally got the code to the point that i was getting actual values displayed, they values i was sending werent lining up with the display and they didnt make sense. the values output seemed to be random or junk and in no order. Doug mentioned that the display might need inverted logic (flip all the 1s and 0s). so it took me a good while to figure out how to do that via code but i got it figured out and it worked!


Code:
double c = 1/204.6;
#include <SoftwareSerial.h>
SoftwareSerial mySerial (0, 1, true);

void setup() {
   mySerial.begin(9600);
}

void loop() { 
   int V_val = analogRead(A0);  
   byte data = 10*(2*(c*V_val)+9);
   mySerial.write(data)
   delay(62);
}

installed in the car and working fine @ ~14.5v



no more flickering! all in all a fun project! i love how small this thing is. maybe i'll think up other cool shit to make. these things are much more powerful than what i'm using it for.
 

GSRCRXsi

Super Moderator
Moderator
VIP
The problem is that I do not want or need a whole round gauge for this. I prefer the small LED readout. And literally NO ONE offers that anymore (except this)

This WB unit costs like $130 (with sensor). And the Trinket was like $10.

The manufacturer even sent me a replacement unit to try, but I haven't swapped it out yet. I wanted to see if I could get this workaround working first.
 
Top