{"id":878,"date":"2017-04-17T04:24:31","date_gmt":"2017-04-17T04:24:31","guid":{"rendered":"https:\/\/einhugur.com\/blog\/?page_id=878"},"modified":"2017-04-17T14:52:05","modified_gmt":"2017-04-17T14:52:05","slug":"voltage-dividers","status":"publish","type":"page","link":"https:\/\/einhugur.net\/blog\/index.php\/basic-electronics\/voltage-dividers\/","title":{"rendered":"Voltage dividers"},"content":{"rendered":"<p><strong>Voltage dividers are a good and simple way to drop voltage for things that require almost no current like for example small signal for GPIO pin or other such.<\/strong><\/p>\n<p><a href=\"https:\/\/i1.wp.com\/einhugur.com\/blog\/wp-content\/uploads\/2017\/04\/VoltageDivider.png?ssl=1\"><img data-attachment-id=\"884\" data-permalink=\"https:\/\/einhugur.net\/blog\/index.php\/basic-electronics\/voltage-dividers\/voltagedivider\/\" data-orig-file=\"https:\/\/i2.wp.com\/einhugur.net\/blog\/wp-content\/uploads\/2017\/04\/VoltageDivider.png?fit=234%2C405&amp;ssl=1\" data-orig-size=\"234,405\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"VoltageDivider\" data-image-description=\"\" data-medium-file=\"https:\/\/i2.wp.com\/einhugur.net\/blog\/wp-content\/uploads\/2017\/04\/VoltageDivider.png?fit=173%2C300&amp;ssl=1\" data-large-file=\"https:\/\/i2.wp.com\/einhugur.net\/blog\/wp-content\/uploads\/2017\/04\/VoltageDivider.png?fit=234%2C405&amp;ssl=1\" loading=\"lazy\" class=\"alignnone size-full wp-image-884\" src=\"https:\/\/i1.wp.com\/einhugur.com\/blog\/wp-content\/uploads\/2017\/04\/VoltageDivider.png?resize=234%2C405&#038;ssl=1\" alt=\"\" width=\"234\" height=\"405\" srcset=\"https:\/\/i2.wp.com\/einhugur.net\/blog\/wp-content\/uploads\/2017\/04\/VoltageDivider.png?w=234&amp;ssl=1 234w, https:\/\/i2.wp.com\/einhugur.net\/blog\/wp-content\/uploads\/2017\/04\/VoltageDivider.png?resize=173%2C300&amp;ssl=1 173w\" sizes=\"(max-width: 234px) 100vw, 234px\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<hr \/>\n<p>Many\u00a0will just take the circuit, decide total sum of R1 and R2 and then find the proportion between them to get correct voltage drop, like for example:<\/p>\n<p>3.3 \/ 5\u00a0= 0,66 for R2, making R1 get portion of 0.34<\/p>\n<p>And then decide total value of the resistors should be 300 Ohm <em><span style=\"color: #808080;\">(See bellow why making random choice of the total might not be good idea)<\/span><\/em> making R1 = 0.34 * 300 = 100 Ohm and R2 = 0.66 *\u00a0 300 = 200 Ohm.<\/p>\n<p>This is all good and well if and only if your sure the current is small enough to not distort the equation much since this equation fails to take into account the current used by the resistors and the current used by the output that connects to the 3.3V<\/p>\n<hr \/>\n<p><strong>Taking into account the current:<\/strong><\/p>\n<p>We use Ohms law to calculate:<\/p>\n<p><strong><em>I = V \/ R<\/em><\/strong><\/p>\n<p>I=V\/R = 5 \/ (100000 + 200000) = 16.6667\u00b5A <span style=\"color: #808080;\"><em>(Total current used by R1 and R2)<\/em><\/span><\/p>\n<p>By turning I=V\/R around to V=R\u00d7I then we can calculate the Voltage drop over R1<\/p>\n<p>100000 \u00d7\u00a00.000016667 = 1.6667V<\/p>\n<p>Therefore voltage in the middle is 5V &#8211; 1.6667V = 3.333 V<\/p>\n<p>If the current drawn in the middle is close to nothing like in small signals then this will work well. But if you put any kind of load in the middle then this will not work.<\/p>\n<hr \/>\n<p><strong>Lets look at why this cannot work with any kind of load in the middle:<\/strong><\/p>\n<p>We put a device at the middle that needs 150 mA, and we recalculate the voltage drop<\/p>\n<p>100000 \u00d7\u00a0(0.000016667 + 0.15A) = 15001.6667 V<\/p>\n<p>Given the voltage drop is much higher than the 5V that we started with then you would get zero in the middle at this current.<\/p>\n<hr \/>\n<p><strong>Choice of resistors in the voltage dividers matters<\/strong><\/p>\n<p>If you use resistors with high values in the voltage divider then you will waste less current. But bigger resistors will make your circuit more senstive to the current usage in the middle.<\/p>\n<p>If we recalculate the example from above using smaller resistors:<\/p>\n<p>I=V\/R = 5 \/ (100 + 200) = 0.01667 A<span style=\"color: #808080;\"><em> (This is the amount of current that will be wasted over the resistors)<\/em><\/span><\/p>\n<p>If we put the same 150 mA device in the middle then the equation will look like this:<\/p>\n<p>100 \u00d7\u00a0(0.01667 + 0.15A) = 16,667 V (voltage drop)<\/p>\n<p>The voltage drop is far less than before but would still lead to zero voltage in the middle if applying big load such as the 150 mA in this example.<\/p>\n<hr \/>\n<p><strong>Conclusion is you should only use voltage dividers where current is close to nothing, and size of the resistors may need to reflect the current that you will draw.<\/strong><\/p>\n<hr \/>\n<p><strong>If needing to drop voltage for example from 5V to 3.3V to run a device then better option would be to use Voltage regulator.<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Voltage dividers are a good and simple way to drop voltage for things that require almost no current like for example small signal for GPIO pin or other such. Many\u00a0will just take the circuit, decide total sum of R1 and R2 and then find the proportion between them to get correct voltage drop, like for &hellip; <a href=\"https:\/\/einhugur.net\/blog\/index.php\/basic-electronics\/voltage-dividers\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Voltage dividers<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":473,"menu_order":1000,"comment_status":"closed","ping_status":"closed","template":"","meta":{"spay_email":""},"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/Pd75nk-ea","jetpack-related-posts":[{"id":165,"url":"https:\/\/einhugur.net\/blog\/index.php\/xojo-gpio\/hc-sr04-ultrasonic-sensor\/","url_meta":{"origin":878,"position":0},"title":"HC-SR04 and US-015 - Ultrasonic sensors","date":"September 22, 2015","format":false,"excerpt":"In this example we are going to connect to HC-SR04 and or US-015\u00a0ultrasonic sensor. (Updated 18. Oct 2015, adding US-015 sensor and sensor specs) (Updated 18. Apr 2016, adding more info for accuracy for the HC-SR04 sensor) A ultrasonic sensor will send ultrasonic sound out which will echo on objects\u2026","rel":"","context":"Similar post","img":{"alt_text":"Ultrasonic wiring","src":"https:\/\/i1.wp.com\/einhugur.com\/blog\/wp-content\/uploads\/2015\/09\/Screen-Shot-2015-09-22-at-00.01.38.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":473,"url":"https:\/\/einhugur.net\/blog\/index.php\/basic-electronics\/","url_meta":{"origin":878,"position":1},"title":"Basic electronics","date":"April 22, 2016","format":false,"excerpt":"LED orientation Resistor color codings Understanding transistor specification sheets Understanding your breadboard and placement of Raspberry cobbler Coding of small bodied capacitors Voltage dividers","rel":"","context":"Similar post","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":345,"url":"https:\/\/einhugur.net\/blog\/index.php\/xojo-gpio\/using-logic-gates\/","url_meta":{"origin":878,"position":2},"title":"Using logic gates","date":"November 8, 2015","format":false,"excerpt":"In this guide we are going to learn how to use logic gates. \u00a0Even if you can usually do things by just taking more GPIO pins and do the logic in a code then there will be times you may want to do things in hardware. For example you might\u2026","rel":"","context":"Similar post","img":{"alt_text":"LogicCircuits","src":"https:\/\/i2.wp.com\/einhugur.com\/blog\/wp-content\/uploads\/2015\/11\/LogicCircuits.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":311,"url":"https:\/\/einhugur.net\/blog\/index.php\/xojo-gpio\/putting-the-gpio-pin-behind-transistor-to-get-more-current\/","url_meta":{"origin":878,"position":3},"title":"Putting the GPIO pin behind transistor to get more current","date":"October 23, 2015","format":false,"excerpt":"In this example we are going to let the GPIO pin control a transistor so that we can draw more power when controlling a LED than what the GPIO pin can supply. We will be using a simple LED in this example where we aim to draw 16 mA power\u2026","rel":"","context":"Similar post","img":{"alt_text":"TransistorExperimentbb","src":"https:\/\/i0.wp.com\/einhugur.com\/blog\/wp-content\/uploads\/2015\/10\/TransistorExperimentbb.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":421,"url":"https:\/\/einhugur.net\/blog\/index.php\/xojo-gpio\/optocouplers\/","url_meta":{"origin":878,"position":4},"title":"Optocouplers","date":"April 18, 2016","format":false,"excerpt":"In this example we are going to take a look at Optocouplers. Disclaimer: We do not take any responsibility for possible errors in the guide or errors that you might do wiring it up. Incorrect wiring can result in damaged sensor or damaged Raspberry PI. Prerequisites: We hight recommend that\u2026","rel":"","context":"Similar post","img":{"alt_text":"Optocoupler","src":"https:\/\/i0.wp.com\/einhugur.com\/blog\/wp-content\/uploads\/2016\/04\/Optocoupler.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":450,"url":"https:\/\/einhugur.net\/blog\/index.php\/basic-electronics\/understanding-transistor-specification-sheets\/","url_meta":{"origin":878,"position":5},"title":"Understanding transistor specification sheets","date":"April 21, 2016","format":false,"excerpt":"It is good to know what to look for when reading transistor specification sheets. Some important things are: NPN vs PNP transistor. -\u00a0The NPN ones switch on the low side (-) while PNP transistors switch on the high side (+). This is important difference and for example this difference Material\u2026","rel":"","context":"Similar post","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/einhugur.net\/blog\/index.php\/wp-json\/wp\/v2\/pages\/878"}],"collection":[{"href":"https:\/\/einhugur.net\/blog\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/einhugur.net\/blog\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/einhugur.net\/blog\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/einhugur.net\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=878"}],"version-history":[{"count":0,"href":"https:\/\/einhugur.net\/blog\/index.php\/wp-json\/wp\/v2\/pages\/878\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/einhugur.net\/blog\/index.php\/wp-json\/wp\/v2\/pages\/473"}],"wp:attachment":[{"href":"https:\/\/einhugur.net\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=878"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}