Capturing Data from 7-Segment Display
August 30, 2014
Something I've wanted to do for a while is to be able to digitize the data from cheap sensors with a 7-segment display.
I decided to give it a try with some USB charge meters.
I purchased four of these meters.
I opened up one of the blue ones and probed the pins to see how the 7-segments were wired.
The display was controlled with anodes for each of the 8 (includind decimal point) segments and each digit was controlled with a single cathode. There were 12 pins cotrolling the LEDs but I didn't want to use 12 I/O pins to monitor the display so I used a couple 74HC165 parallel to serial shift registers.
I initially wrote a driver in Spin but It was clear the segments were on for a very short amount of time so I switched over to assembly.
The code still never "sees" a "v" so I'm not sure if I have a bad connection somewhere or if the voltage levels from the display don't trigger the '165 chips.
I added some pull-up resistors to the pins in hopes of getting better logic states to capture. I think the pull-up helped.
I had some resistor networks which made the job of attaching a bunch of pull-ups a lot easier.
Since I now had access to both the current and the voltage, I could compute the Watts. I could also use a microcontroller to keep track of time and add time dependent parameters to my new meter.
I took Ladvien's advice and used an OLED from ITead Studio. Since the OLED uses 3.3V and draws less then 20mA when displaying a bit of text, I plugged the OLED display directly in the QuickStart's header and powered the display from an I/O pin.
I'm using the display in SPI mode since the object I found for the display used SPI. (I had tried adapting the object to I2C but my I2C version didn't work as well as the SPI code.)
I was powering the above meter and QuickStart from four AA NiMH in the black battery box. The OLED is displaying the data from the meter (top left) and the time dependent parameters.
I'm not sure if this is a practical way of reading current and voltage but it was something I'd been wanting to try.