{"id":191,"date":"2023-08-28T18:26:09","date_gmt":"2023-08-28T18:26:09","guid":{"rendered":"https:\/\/pii.icu\/blog\/?p=191"},"modified":"2023-08-29T05:56:03","modified_gmt":"2023-08-29T05:56:03","slug":"negative-bias-voltage","status":"publish","type":"post","link":"https:\/\/pii.icu\/blog\/2023\/08\/negative-bias-voltage\/","title":{"rendered":"Generating negative bias voltage for LCDs"},"content":{"rendered":"\n<p>It&#8217;s been quite a while from the last post. I&#8217;ve had many projects and several ideas that would have made for a nice blog post but I never quite got around to writing, but now I finally decided to write a small memo.<\/p>\n\n\n\n<p>When you are using a <a href=\"https:\/\/en.wikipedia.org\/wiki\/Liquid-crystal_display\">LCD<\/a> the driver needs to generate bias voltages for the voltage forms that the segments are driven with. For example the <a href=\"https:\/\/pii.icu\/blog\/2022\/11\/driving-an-old-brother-lcd-display\/\" data-type=\"post\" data-id=\"124\">Brother display<\/a> uses has generates the bias voltages from a single voltage. This is then turned into multiple voltages with a resistor string and a quad opamp that buffers the voltages.  In this blog post I showed a charge pump that is used to generate the negative voltage that the display requires. The bias voltage then sets the contrast of the display, so a proper bias voltage is needed so that the on the screen screen is readable, and there is a contrast potentiometer on the front of the Brother display that sets the maximum bias voltage.<\/p>\n\n\n\n<p>The Brother display required a negative rail of almost <code>-20V<\/code>, but this is not that common in my experience nowadays. A common type of relatively cheap LCDs for simple (hobby) projects are the <code>HD44780<\/code> compatible alphanumeric screens. This can be found in many colors and sizes. The bias voltages for these controllers work in a similar fashion, and you can find a resistor string in the display modules that generates the required voltages from the pins.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/pii.icu\/blog\/wp-content\/uploads\/2023\/08\/hd44780_drive.png\" alt=\"\" class=\"wp-image-195\" style=\"width:559px;height:314px\" width=\"559\" height=\"314\" srcset=\"https:\/\/pii.icu\/blog\/wp-content\/uploads\/2023\/08\/hd44780_drive.png 981w, https:\/\/pii.icu\/blog\/wp-content\/uploads\/2023\/08\/hd44780_drive-300x169.png 300w, https:\/\/pii.icu\/blog\/wp-content\/uploads\/2023\/08\/hd44780_drive-768x432.png 768w\" sizes=\"auto, (max-width: 559px) 100vw, 559px\" \/><figcaption class=\"wp-element-caption\">From Hitachi <code>HD44780U<\/code> datasheet<\/figcaption><\/figure>\n\n\n\n<p>In most <code>5V<\/code> applications the bottom voltage is actually derived from potentiometer dividing voltage between <code>5V<\/code> and <code>0V<\/code>, and we require no negative voltage at all.<\/p>\n\n\n\n<p>But now there arises a problem: if we use a <code>3.3V<\/code> digital supply (or even lower, <code>HD44780<\/code> datasheet specifies that <code>VCC<\/code> should be in the range <code>2.7V<\/code>&#8211;<code>5.5V<\/code>)  we&#8217;re going to be in trouble with the contrast of the screen. At the same time, we often can&#8217;t increase the supply voltage, since for example most 32-bit microcontrollers can&#8217;t be ran at a higher voltage. Of course, we can have some voltage level translation from <code>3.3V<\/code> to <code>5V<\/code> so that we can run the display at <code>5V<\/code>, but that just adds many components and we still need a separate <code>5V<\/code> supply rail.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/pii.icu\/blog\/wp-content\/uploads\/2023\/08\/hd44780_pinout.png\" alt=\"\" class=\"wp-image-196\" style=\"width:516px;height:388px\" width=\"516\" height=\"388\" srcset=\"https:\/\/pii.icu\/blog\/wp-content\/uploads\/2023\/08\/hd44780_pinout.png 974w, https:\/\/pii.icu\/blog\/wp-content\/uploads\/2023\/08\/hd44780_pinout-300x225.png 300w, https:\/\/pii.icu\/blog\/wp-content\/uploads\/2023\/08\/hd44780_pinout-768x577.png 768w\" sizes=\"auto, (max-width: 516px) 100vw, 516px\" \/><figcaption class=\"wp-element-caption\">Pinout for common <code>HD44780<\/code> display modules<\/figcaption><\/figure>\n\n\n\n<p>Now, <code>3.3V<\/code> might still make for a dimly readable contrast on the smaller 8&#215;2 and 16&#215;2 character displays, but the result isn&#8217;t that good. And with a larger 20&#215;4 display there won&#8217;t be much of anything to see even if the <code>V0<\/code> contrast pin is at zero volts.<\/p>\n\n\n\n<p>But there is a nifty way to generate a small negative voltage from a single PWM pin from a microcontroller. And it isn&#8217;t usually that hard to find a free PWM pin in any case since a microcontroller is most likely driving the display module in any case.<\/p>\n\n\n\n<p>You need just two diodes and two capacitors to make a simple charge pump that inverts the voltage (minus two diode drops). If you have for example two diodes in a single SOT23 package that&#8217;s only a total of three additional components. Then just put some squarewave in and you&#8217;re done!<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/pii.icu\/blog\/wp-content\/uploads\/2023\/08\/change_pump_small-1024x574.png\" alt=\"\" class=\"wp-image-197\" style=\"width:405px;height:227px\" width=\"405\" height=\"227\" srcset=\"https:\/\/pii.icu\/blog\/wp-content\/uploads\/2023\/08\/change_pump_small-1024x574.png 1024w, https:\/\/pii.icu\/blog\/wp-content\/uploads\/2023\/08\/change_pump_small-300x168.png 300w, https:\/\/pii.icu\/blog\/wp-content\/uploads\/2023\/08\/change_pump_small-768x430.png 768w, https:\/\/pii.icu\/blog\/wp-content\/uploads\/2023\/08\/change_pump_small.png 1276w\" sizes=\"auto, (max-width: 405px) 100vw, 405px\" \/><\/figure>\n\n\n\n<p>The charge pump can easily be driven from a microcontroller pin since the LCD bias doesn&#8217;t need much current, and likewise the frequency isn&#8217;t that critical since small variations in the voltage doesn&#8217;t really matter. And of course, using Schottky diodes will increase (or should I say decrease?) the generated voltage.<\/p>\n\n\n\n<p>This circuit can even be easily added as a quick hack after you have manufactured PCBs and realize that the you are running the display from 3.3 volts but didn&#8217;t realize that how poor contrast it results in (yeah, I&#8217;m speaking from experience.)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>It&#8217;s been quite a while from the last post. I&#8217;ve had many projects and several ideas that would have made for a nice blog post but I never quite got around to writing, but now I finally decided to write a small memo. When you are using a LCD the driver needs to generate bias &#8230; <a title=\"Generating negative bias voltage for LCDs\" class=\"read-more\" href=\"https:\/\/pii.icu\/blog\/2023\/08\/negative-bias-voltage\/\" aria-label=\"More on Generating negative bias voltage for LCDs\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[4],"tags":[],"class_list":["post-191","post","type-post","status-publish","format-standard","hentry","category-electronics"],"_links":{"self":[{"href":"https:\/\/pii.icu\/blog\/wp-json\/wp\/v2\/posts\/191","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pii.icu\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pii.icu\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pii.icu\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pii.icu\/blog\/wp-json\/wp\/v2\/comments?post=191"}],"version-history":[{"count":3,"href":"https:\/\/pii.icu\/blog\/wp-json\/wp\/v2\/posts\/191\/revisions"}],"predecessor-version":[{"id":200,"href":"https:\/\/pii.icu\/blog\/wp-json\/wp\/v2\/posts\/191\/revisions\/200"}],"wp:attachment":[{"href":"https:\/\/pii.icu\/blog\/wp-json\/wp\/v2\/media?parent=191"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pii.icu\/blog\/wp-json\/wp\/v2\/categories?post=191"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pii.icu\/blog\/wp-json\/wp\/v2\/tags?post=191"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}