{"id":3016,"date":"2012-11-08T19:38:17","date_gmt":"2012-11-09T03:38:17","guid":{"rendered":"http:\/\/www.corbinstreehouse.com\/blog\/2012\/11\/electric-bug-charger-control-design\/"},"modified":"2018-11-03T13:36:27","modified_gmt":"2018-11-03T20:36:27","slug":"electric-bug-charger-control-design","status":"publish","type":"post","link":"https:\/\/www.corbinstreehouse.com\/blog\/2012\/11\/electric-bug-charger-control-design\/","title":{"rendered":"Electric Bug: Charger Control &#8211; Design"},"content":{"rendered":"<p id=\"top\" \/>\n<p>Based on my <a href=\"http:\/\/www.corbinstreehouse.com\/blog\/2012\/11\/electric-bug-charger-control-what-i-want\/\">requirements<\/a>, I made some hardware the will more intelligently control my Manzanita charger. It is powered by an Arduino, and has a little LCD to tell me what is going on and accept input settings:<\/p>\n<p>\n<a href=\"http:\/\/www.corbinstreehouse.com\/blog\/wp-content\/uploads\/2012\/11\/IMG_8909.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.corbinstreehouse.com\/blog\/wp-content\/uploads\/2012\/11\/IMG_8909-tm.jpg\" width=\"500\" height=\"375\" alt=\"IMG_8909.JPG\" \/><\/a><\/p>\n<p>First off, everything is on <a href=\"https:\/\/github.com\/corbinstreehouse\/ChargerControl\">https:\/\/github.com\/corbinstreehouse\/ChargerControl<\/a>.<\/p>\n<p>It solves the problems I previously listed, by implementing J1772 (minus respecting the amperage that the charging station provides &#8212; since I can&#8217;t control that in the Manzanita charger) and implements a timer.<\/p>\n<p>I bought an Arduino last winter and learned how to do basic hardware programming.<\/p>\n<p>\n<a href=\"http:\/\/www.corbinstreehouse.com\/blog\/wp-content\/uploads\/2012\/11\/IMG_8050.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.corbinstreehouse.com\/blog\/wp-content\/uploads\/2012\/11\/IMG_8050-tm.jpg\" width=\"500\" height=\"375\" alt=\"IMG_8050.JPG\" \/><\/a><\/p>\n<p>I then used <a href=\"http:\/\/www.cadsoftusa.com\">EAGLE<\/a> PCB software (free) to design how I would do this with some circuitry (after testing it on a breadboard first). The concept is really simple: use resistors to control the J1772 pilot signal, and sense a change in the proximity signal (to detect when the J1772 plug is going to be unplugged), and use several relays to turn on the BMS, turn on the EVSE charging station, and turn on the charger (via its Reg bus input).<\/p>\n<p>The inputs are: 12v power, ground, an AC-DC 12v+ (powered by the 120v or 220v plug so I don&#8217;t drain the 12v battery while charging, as my DC-DC isn&#8217;t on), pilot signal input, proximity signal input, pilot\/proximity ground from the inlet plug, V source output to the BMS (to turn it on), HLIM input from the BMS (to sense when to stop charging via the &#8220;high limit&#8221; input of the BMS), and a plug into the REG BUS port of the charger to turn it on and off (by connecting pins 1 to 2 via a relay).<\/p>\n<p>\n<a href=\"http:\/\/www.corbinstreehouse.com\/blog\/wp-content\/uploads\/2012\/11\/Screen-Shot-2012-11-08-at-7.02.05-PM.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.corbinstreehouse.com\/blog\/wp-content\/uploads\/2012\/11\/Screen-Shot-2012-11-08-at-7.02.05-PM-tm.jpg\" width=\"500\" height=\"351\" alt=\"Screen Shot 2012-11-08 at 7.02.05 PM.png\" \/><\/a><\/p>\n<p>The eagle files I <a href=\"https:\/\/github.com\/corbinstreehouse\/ChargerControl\/tree\/master\/ChargerControl%20-%20Eagle\">made are here<\/a>. One other thing I added was a diode on the BMS output, as the BMS was accidentally turning my charger control on when the car started.<\/p>\n<p>Once I made a schematic, I had to figure out how to get it all onto a board. I didn&#8217;t want to print my own PCB (I&#8217;m not really at that level yet) so I wired it all up manually. To figure out how to do that, I made this crazy layout in illustrator:<\/p>\n<p><a href=\"http:\/\/www.corbinstreehouse.com\/blog\/wp-content\/uploads\/2012\/11\/Screen-Shot-2012-11-08-at-7.19.03-PM.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.corbinstreehouse.com\/blog\/wp-content\/uploads\/2012\/11\/Screen-Shot-2012-11-08-at-7.19.03-PM-tm.jpg\" width=\"500\" height=\"359\" alt=\"Screen Shot 2012-11-08 at 7.19.03 PM.png\" \/><\/a><\/p>\n<p>The wiring underneath my board basically ended up looking like this, and it makes me wish I made a PCB. I may eventually do so\u2026when I do some more electronics work on the car. Other parts include a clock kit from adafruit, an LCD kit from adafruit. Here it is all wired up manually to test:<\/p>\n<p>\n<a href=\"http:\/\/www.corbinstreehouse.com\/blog\/wp-content\/uploads\/2012\/11\/IMG_8889.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.corbinstreehouse.com\/blog\/wp-content\/uploads\/2012\/11\/IMG_8889-tm.jpg\" width=\"500\" height=\"375\" alt=\"IMG_8889.JPG\" \/><\/a><\/p>\n<p>The red mini breadboard is used to simulate the J1772 proximity plug.<\/p>\n<p>I then made a box out of lexan and stuff everything in:<\/p>\n<p><a href=\"http:\/\/www.corbinstreehouse.com\/blog\/wp-content\/uploads\/2012\/11\/IMG_8900.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.corbinstreehouse.com\/blog\/wp-content\/uploads\/2012\/11\/IMG_8900-tm.jpg\" width=\"500\" height=\"375\" alt=\"IMG_8900.JPG\" \/><\/a><\/p>\n<p><a href=\"http:\/\/www.corbinstreehouse.com\/blog\/wp-content\/uploads\/2012\/11\/IMG_8904.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.corbinstreehouse.com\/blog\/wp-content\/uploads\/2012\/11\/IMG_8904-tm.jpg\" width=\"500\" height=\"375\" alt=\"IMG_8904.JPG\" \/><\/a><\/p>\n<p>The on\/off switch is a Pololu power switch, which lets me automatically turn the whole thing off in software. See <a href=\"http:\/\/www.sparkfun.com\/products\/8904\">http:\/\/www.sparkfun.com\/products\/8904<\/a><\/p>\n<p style=\"margin: 0px;\">Most the important code is here in <a href=\"https:\/\/github.com\/corbinstreehouse\/ChargerControl\/blob\/master\/ChargerControl\/ChargerControl.cpp\">ChargerControl.cpp<\/a>. I also wrote an <a href=\"https:\/\/github.com\/corbinstreehouse\/ChargerControl\/blob\/master\/ChargerControl\/CrbMenu.cpp\">Arduino LCD menu system<\/a>.<\/p>\n<p style=\"margin: 0px;\"><\/p>\n<p style=\"margin: 0px;\">The software works great. I push a pushbutton on top of the box to turn on the whole thing (I could make this automatically happen when the gas tank door opens). Then, plug in the J1772 plug and everything works: first, the the proximity signal on the latch is sensed. Then the Elithion BMS is turned on (via its Vsource input and a relay). The code waits for the BMS to turn &#8220;off&#8221; the high limit, indicating it is okay to charge. It then generates the pilot signal for the EVSE, which turns on contractors at the charging station and gives the charger power. I then turn the charger on by opening a relay (that opens the charger&#8217;s pin 0 to pin 1 connection, indicating it is okay to charge). When the BMS high limit is hit, the relay closes to turn off the charger and it goes into a &#8220;balancing mode&#8221;. It then &#8220;balances&#8221; the cells for controllable amount of time, and then automatically (and safely) turns everything off!<\/p>\n<p style=\"margin: 0px;\"><\/p>\n<p style=\"margin: 0px;\">When the timer is being used, you just set it to be in &#8220;timer mode&#8221; and set the start time and duration. The timer EVSE has zero power to the car&#8217;s J1772 plug, until the arduino tells it to turn on.<\/p>\n<p style=\"margin: 0px;\"><\/p>\n<p style=\"margin: 0px;\">So far, it seems to be working pretty well. I haven&#8217;t really used the timer yet and only just tested it.<\/p>\n<p style=\"margin: 0px;\"><\/p>\n<p style=\"margin: 0px;\">Warning: use at your own risk.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Based on my requirements, I made some hardware the will more intelligently control my Manzanita charger. It is powered by an Arduino, and has a little LCD to tell me what is going on and&#8230; <a class=\"read-more\" href=\"https:\/\/www.corbinstreehouse.com\/blog\/2012\/11\/electric-bug-charger-control-design\/\">[read more]<\/a><\/p>\n","protected":false},"author":1,"featured_media":3002,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[34],"tags":[],"class_list":["post-3016","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-electric-bug"],"jetpack_featured_media_url":"https:\/\/www.corbinstreehouse.com\/blog\/wp-content\/uploads\/2012\/11\/IMG_8909.jpg","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.corbinstreehouse.com\/blog\/wp-json\/wp\/v2\/posts\/3016","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.corbinstreehouse.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.corbinstreehouse.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.corbinstreehouse.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.corbinstreehouse.com\/blog\/wp-json\/wp\/v2\/comments?post=3016"}],"version-history":[{"count":1,"href":"https:\/\/www.corbinstreehouse.com\/blog\/wp-json\/wp\/v2\/posts\/3016\/revisions"}],"predecessor-version":[{"id":5466,"href":"https:\/\/www.corbinstreehouse.com\/blog\/wp-json\/wp\/v2\/posts\/3016\/revisions\/5466"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.corbinstreehouse.com\/blog\/wp-json\/wp\/v2\/media\/3002"}],"wp:attachment":[{"href":"https:\/\/www.corbinstreehouse.com\/blog\/wp-json\/wp\/v2\/media?parent=3016"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.corbinstreehouse.com\/blog\/wp-json\/wp\/v2\/categories?post=3016"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.corbinstreehouse.com\/blog\/wp-json\/wp\/v2\/tags?post=3016"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}