Optimizing power consumption of a multiplexed LED display - Page 1
Forum section: electronics / projects

author: Electr0nicus
author_rank: Regular Contributor
timestamp: April 16, 2013, 12:19:45 am
content: Hi!I'm currently designing a tensile strength tester. It basically extends a probe piece until it breaks. How much the probe piece is extended in length and the used force is logged with the time onto a SD card with an AVR.The probing process should also be videotaped. The actual measurement values should be somehow embedded into this video. So we (I and my buddy, who is a mechanical engineer) came up with the simple idea, to put a big LED 7-Segment display into the capture area of the camera, so that the values are overlayed "realtime" in the video.For those who are further interested in this project:the rig should look like this:The elongation of the probe measured with a bowden cable encoder at a resolution of 25 pulses/mm.Also the distance of the weight from the mounting point of the probe on the arm is measured with such a sensor. If the distance of the weight from the mounting point of the probe is known, one can easily calculate the force on that point.Those are the sensors used:http://www.waycon.de/fileadmin/pdf/Seilzug_Sensor_SX.pdfSo finally to my questionAs written above, we will use 7-Segment displays with 20mm character height.http://at.farnell.com/jsp/search/productdetail.jsp?CMP=i-ddd7-00001003&sku=1142445andhttp://at.farnell.com/jsp/search/productdetail.jsp?CMP=i-ddd7-00001003&sku=2080022for the unit digits.The display is organized as follows.Length of probe: NNNNCCUUForce: NNNNCCUUTime: NNNCUwhere N = number digits, C= comma digits and U= unit digitsAs the unit digits are 16-segment displays, they are splitted in half to be driven via a 8bit data bus.This means the Length and Force display consist of 10 digits and the time display of 6 digits. Note 16- Segment display counts as 2 because of the 8 bit data bus.The digits are combined to multiplexed units of five digits. The second option, to multiplex all 10 Digits in one, isn't really possible, because then the max. peak current of the particular segements will be exceeded.in summary that leeds to the following specs"Force" and "Length" display:Duty cycle per digit 1/5 or 20% of the time ,display splitted in two sections a' 5 digits.current per segment: overdriven to 100mA to give the appearance as if the segments are driven with 20mA static."Time" displayDuty cycle per digit 1/6 or 16,66% of the timecurrent per segment: overdriven to 120mA to give the appearance as if the segments are driven with 20mA static.Worst case current consumption:Length display 1.6AForce display 1.6ATime display 0.96ATotal worst case current consuption all Segments on: 4.16AI've ordered those displays and got them today. I did a quick test, to see what Vf those displays have at 100mA/120mA. I measured around 3.3V at 100mA. Of course I drove the displays with 20%/16,66% duty.As the electronics have to fit a 100x160x50mm case, and should be transformer powered, I only have room for a 30VA 9V~ transformer.http://at.farnell.com/myrra/45062/transformer-30va-115-230v-2x-9v/dp/1777965I'll have to generate two voltages:1. 5V 0.25A to supply the two encoders (100mA @5V abs. max.) and the AVR2. 3.6V 5A to drive the display.What I'm asking me now is, if this 0.3V voltage difference is big enough to compensate enough for tolerances in the Vf's of the paticular segements?I use a LTC1771 to generate the display voltage, so I'm relatively flexible what voltage I drive the display with.My goal is to set the voltage as low as possible, to get minimal power dissipation across the series resistors.At 3.6V I'll use 2.7Ohm series resistors. Using 3.6V is only possible if the Vf variations aren't very big amongst segments.So I'll need your opinion/experience if a 0.3V voltage difference is great enough. Worst case would be a voltage of 4V, as at this point the transformer is nearly at full load.Example:4V @ 4.2A = 16.8W output (LTC1771)LTC1771 input power (considering 80% worst case efficency) = 20W5V regulator (linear) @ 0.25A from 12.5V = 3.125Wbridge rectifier losses (schottky max. 0.55V Vf) = 2.2Wtotal power: 25.325WRegards Gregor

author: mariush
author_rank: Super Contributor
timestamp: April 16, 2013, 01:13:32 am
content: Hmmm... not really in the mood to do math and calculate power consumptions, but I'd like to give you another suggestion.It looks like you're about to use 10 of those 16 segment led digits and at 2.5 euro a piece, that gets you to about 25 euro.For that much money, you can get graphic LCDs that are 128x64 pixels and have a relatively large area and backlight.For example, here's some suggestions :56x38mm :http://at.farnell.com/midas/mc128064b6w-fptlw/lcd-128x64-fstn-weiss-b-l/dp/2063188http://at.farnell.com/midas/mc128064b6w-sptly/lcd-128x64-stn-gelb-gruen-b-l/dp/206318066.5x33mm :http://at.farnell.com/midas/mc128064a6w-sptly/lcd-128x64-stn-gelb-gruen-b-l/dp/2063222It's easy connection to a microcontroller (sending command + a byte at a time, easy peasy, once you send the pixels the controllers on the back of display do the work for you, you just update screen)They're 5v, backlight running at about 330-400mA, since runs all the time you have less flicker that won't get caught on camera, the display itself is high contrastThe 38mm / 33 mm height allows you to make several modes if you want .. for example, double height digits or show 2 x 5 digits on screen, or rotate between the two digits every 1-2 seconds..128 pixels wide allows you to put more than 5 digits, add icons maybe, dots, "," character etc etcIf will be slightly more code to actually handle the characters and to handle the screen... these are basically 2 controllers that are 64x64 in the display so if you want to draw something right in the middle, at some point your code has to tell the display which is the active driver in the display so that what you send gets written to that driver's memory. It's easy, just some extra instructionsI think you really have to be careful in regard to the flicker the individual led segments will do to the camera and investigate if the camera's focus would be affected or not by that flicker - the camera may autofocus on that. A lcd backlight might not do that.later edit :or something like this :http://www.digikey.com/product-detail/en/NHD-16032AZ-FL-YBW/NHD-16032AZ-FL-YBW-ND/1885699160px x 32px 17mm height of pixels , easy driving etc , cheap and you can probably get it from newhaven site directly.

author: MacAttak
author_rank: Unknown
timestamp: April 16, 2013, 04:20:36 am
content: I was wondering the same thing. You could just get one of many LCD packs and be done with it. If you don't need a dot matrix screen (which you probably don't since you were already planning to use 7-segment digits), then you could just use a standard 20x4 character module like this one:http://www.digikey.com/product-detail/en/NHD-0420H1Z-FL-GBW-33V3/NHD-0420H1Z-FL-GBW-33V3-ND/2773594Pretty cheap, easy to use. There are plenty of support libraries for AVR so sending data to it should be extremely simple and painless. You can find devices with parallel, serial, or I2C interfaces. I think the one I linked has a 4 bit X 8 bit interface.

author: mariush
author_rank: Super Contributor
timestamp: April 16, 2013, 11:27:00 am
content: Yes, 4x16 or 4x20 will work just the same, I was only recommending graphical/dot matrix for the opportunity to use bigger digits (full lcd height), as those don't have empty space between rows of digits.The alphanumeric ones will be even easier to drive and have the characters built in (while giving you the opportunity to create and "upload" your own characters - to use for icons for example - ) so you only need to send a command and the code of the character you want printed (pretty much like the ascii code so it works with printf and other basic c functions)

author: Electr0nicus
author_rank: Regular Contributor
timestamp: April 16, 2013, 11:34:17 am
content: Thank you for your answers.Using Display modules isn't possible in this case. Either character or graphic. It's simply the size. The rig is approx. 3m wide and 2m high. The camera must be positioned so far away from the rig, so it capures the whole thing. So this would be at least 2m, the real distance will be strongly dependend from the camera of course. So the display has to be visible from a distance between 2-3 meters let's say (as a human may be able to read the a display module from this distance, it would be really hard to read the display from the captured video). So this is why only 7-Segment displays are usable. A scrolling display on a graphic LCD is also not optimal, because all important values should be displayed at any time. The 7-Segment displays cost approx. 1€ each. The more expensive 16 Segment displays are only used for unit display. So of these displays only 5 will be used. On the other hand, price is not as important for this project, because it should be designed for reliability,with high quality components. This is also why we use those waycon encoders, which are 350€ each, and not some cheap chinese alibaba stuff, which breaks after 10hours use.I've also built multiplexed LED displays before without problem. They are actually many times simpler to drive (codewise) than display modules (of which I have also used many in projects). So I have experience in both fields. The decision to use 7/16Segment LED- Displays here was very well-thought-out. In my former projects I used whatever voltage i had available (most of the time 5V) with appropriate series resistors, because efficency was no issue.I've done some simple calculations:If I use 3.6V and a 2.7Ohm resistor a +/-0.1V variation in Vf of each segment will result in a minimum of 66mA and a maximum of 133mA segment current.If the voltage is increased this deviation is lower of course.F.e. 4V and 6.8Ohm a +/- 0.1V variation only results in a deviation of +/- 15mA segment current. So my gut feeling says me to use 4V.

author: Mike Warren
author_rank: Unknown
timestamp: April 16, 2013, 11:57:11 am
content: Just throwing this out there in case you haven't thought of it: Multiplexed displays will often flicker on video. You can probably play with the scan rate to minimise it, but that will vary depending on the camera and ambient light.

author: mariush
author_rank: Super Contributor
timestamp: April 16, 2013, 01:29:18 pm
content: Here's how they seven segment displays can look:Not only they'll flicker but also the unlit segments might get light bleeding or make the segment display hard to read.And I still don't understand how you figure out that only seven segment displays are possible. Your seven segment displays are 20 mm high but they're only 11 mm wide:On that 128x64 px that I linked to which is 66 mm x 38 mm , each dot is basically 0.48x.56 mm but each pixel is 0.56mm , so if you want 20 mm tall digits, you need 35 pixels to get the same size digit in height. Going down to 31 px , you can fit 2 rows on the screen with 2 pixels empty as separator, and your digits would still be 17.36 mm tall.At 2-3m distance, 17.36mm or 20mm won't make much difference, but the contrast of the digits and the even brightness of the screen may do much more good.And you can fit 5 digits easily... original seven segment is 11mm wide, if you transpose that to pixels, it would be 22 pixels. But if you use 17mm tall digits, the width would be about 8mm or about 14pixels ... 18 pixels with spacing and place for dots and whatever... you still can fit 128 / 18 = 7.1 digitsNow if you don't want to mess around printing dots on such screen, there's nothing stopping you from getting a 4x20 alphanumeric (or two) and just use a custom font to make digits, there's plenty of examples out there:You can get 40x4 displays for about 25$ and 20x4 displays for as low as 6-7$ a piece, so they're cheap enough to use 2 or 3 if you want.

author: Electr0nicus
author_rank: Regular Contributor
timestamp: April 16, 2013, 03:13:30 pm
content: Quote from: Mike Warren on April 16, 2013, 11:57:11 amYes I know that. But you can actually tweak the multiplexing frequency so that flicker nearly vanishes or even dissappears. As far the flicker goes in the video mariush postet, this is actually no big deal and tolerable. Because the camera will only dedicated for this a tensile strength tester, I definitely think one can optimize the multiplex frequency specific for this camera.Quote from: mariush on April 16, 2013, 01:29:18 pmAs far as my knowlege goes, this phenomenon comes from people using a 74HC595 shift register on their databus. When they latch new data into the shift register, they forget disabling the outputs during that time. What you see as bleeding, is actually the new data getting shifted into the register.http://arduino.cc/forum/index.php/topic,13590.0.htmlIn the code under this link, there is actually stated: "//zero the data pin after shift to prevent bleed through"As mariush is a really advocate for a solution with graphic or character displays: Well I did some thinking about how this should work.I use a AT90USB646 at 19.6606MHz. The frequency is designed to give me a 1/100s timebase using Timer0 with 1024x prescaler and a compare-match value of 192.The AVR has to perform the following tasks:Read out the 2 Encoders. Those have a max. output frequency of 100kHz. So at worst case interrupts occur at 200kHz. As the interrupt routine is really simple there are max. 10 Clock Cycles used.Write the measured values on SD card (Values should be updated every 1/10s). That is done using a circular buffer with a size of 1024Byte. Measured values are written into that buffer and in a second step read from that buffer in 512Byte chunks and then written to SD card (with FAT16 Filesystem).As you can see, the AVR has to do multiple tasks in real time. So it wouldn't be possible to drive 3 graphic LCDs in addition to that, because there isn't enough processing time left. For a 128x64 Pixel Display that would be 1024 Bytes per refresh cycle. This x3 for 3 displays and 10 times/second leeds to 30720Bytes/s. As most graphic displays have a auto- incremental write function this will actually be possible to do in lets say 40000 Clock Cycles. The main problem is the processing of the measurement value to display data, which needs huge ammounts of processing time.So the only option will be using character displays with a custom character hack. But this looks a bit cheap-isch and slapped together, and the thing should be professional looking