{"id":215,"date":"2015-05-17T19:32:11","date_gmt":"2015-05-17T17:32:11","guid":{"rendered":"http:\/\/tronche.com\/blog\/?p=215"},"modified":"2019-01-23T10:37:10","modified_gmt":"2019-01-23T09:37:10","slug":"power-level-sensor","status":"publish","type":"post","link":"https:\/\/tronche.com\/blog\/2015\/05\/power-level-sensor\/","title":{"rendered":"Power level sensor"},"content":{"rendered":"\n<p>The stuff is supposed to be powered by a 9V battery, and I&#8217;m gonna \nuse an ADC port on the Teensy to sense the available voltage. The Recom \nR78 converter can accomodate 6.5-18V thus I can&#8217;t use the AREF pin of \nthe Teensy, because\n<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>I believe the ADC can&#8217;t sample beyond the Vin, 5V in my case (I&#8217;m not even sure you can go beyond the internal 3.3V)<\/li><li>the AREF pin is on the backside, not connected, and would short circuit to pin 23 of the Teensy on the breadboard anyway.<\/li><\/ol>\n\n\n\n<p>So I go for a voltage divider made with two resistors of roughly \n1\/3 vs 2\/3 (to lower from 9V to ~3V). I started with M\u03a9, but was \nsurprised by the voltage going into the loads. After some trial and \nerrors, I set for 2.2k\u03a9 and 4.7k\u03a9, compensating the ratio in software. \nWith such quite low resistance, it will consume 1,5mA at worst with 9V, \nbut hell, the whole system is consuming 78mA already under 7.5V (with \nthe USB debug connection to the PC, which seems to eat a lot), and \nclimbs to 450mA when the modem supercapacitor is charging. Also with \nsuch a low resistance, I shouldn&#8217;t have to recalibrate when adding more \nloads, but I&#8217;ll have to check.\n<\/p>\n\n\n\n<p>After calibrating using my PSU, I got a reading of about 630 for \n6.5V and 880 for 9V, a 10mV precision, more than enough just to know at \nwhat speed the battery discharges&nbsp;!<\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"mh-excerpt\"><p>The stuff is supposed to be powered by a 9V battery, and I&#8217;m gonna use an ADC port on the Teensy to sense the available <a class=\"mh-excerpt-more\" href=\"https:\/\/tronche.com\/blog\/2015\/05\/power-level-sensor\/\" title=\"Power level sensor\">[&#8230;]<\/a><\/p>\n<\/div>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[95],"tags":[],"class_list":["post-215","post","type-post","status-publish","format-standard","hentry","category-95"],"_links":{"self":[{"href":"https:\/\/tronche.com\/blog\/wp-json\/wp\/v2\/posts\/215","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tronche.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tronche.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tronche.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tronche.com\/blog\/wp-json\/wp\/v2\/comments?post=215"}],"version-history":[{"count":1,"href":"https:\/\/tronche.com\/blog\/wp-json\/wp\/v2\/posts\/215\/revisions"}],"predecessor-version":[{"id":216,"href":"https:\/\/tronche.com\/blog\/wp-json\/wp\/v2\/posts\/215\/revisions\/216"}],"wp:attachment":[{"href":"https:\/\/tronche.com\/blog\/wp-json\/wp\/v2\/media?parent=215"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tronche.com\/blog\/wp-json\/wp\/v2\/categories?post=215"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tronche.com\/blog\/wp-json\/wp\/v2\/tags?post=215"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}