{"id":695,"date":"2014-03-22T12:41:12","date_gmt":"2014-03-22T10:41:12","guid":{"rendered":"http:\/\/www.knackes.com\/blog\/?p=695"},"modified":"2014-03-22T12:41:12","modified_gmt":"2014-03-22T10:41:12","slug":"arduino-adxl362-motion-activated-12v-switch-en-anglais","status":"publish","type":"post","link":"https:\/\/kim6.knackes.com\/blog\/index.php\/2014\/03\/22\/arduino-adxl362-motion-activated-12v-switch-en-anglais\/","title":{"rendered":"Arduino + ADXL362 Motion activated 12V switch (en anglais)"},"content":{"rendered":"<p>Second english post to document my Arduino + ADXL362 Motion activated 12V switch.<\/p>\n<p><a href=\"https:\/\/static.knackes.com\/images\/7D\/2014\/2014-03-22-ShakeMotion\/ShakeMotion.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" title=\"Arduino ShakeMotion\" alt=\"Arduino ShakeMotion\" src=\"https:\/\/static.knackes.com\/images\/7D\/2014\/2014-03-22-ShakeMotion\/ShakeMotion-Small.jpg\" width=\"500\" height=\"527\" \/><\/a>My car powers the cigarette lighter even when the keys are removed, Which &#8211; very slowly &#8211; drained the batteries when gadgets where left connected to it. One option would be to open the dashboard to connect a second outlet to the right cable on the car radio, but that would be too easy.<!--more-->The basic Idea was to use an <a title=\"ADXL362\" href=\"http:\/\/www.analog.com\/en\/mems-sensors\/mems-accelerometers\/adxl362\/products\/product.html\" target=\"_blank\" rel=\"noopener\">ADXL362 accelerometer<\/a> to know if the vehicle was moving in the last 10 minutes or turn the output off. I first wanted to use the ADXL362&rsquo;s internal motion activation mechanism, but failed to get the result I wanted, so I resorted to a purely software alternative ruining on the <a title=\"Arduino Pro Mini\" href=\"http:\/\/arduino.cc\/en\/Main\/ArduinoBoardProMini\" target=\"_blank\" rel=\"noopener\">Arduino Pro Mini<\/a>. For this I forked the effort of driving the accelerometer started by <a title=\"Anne Mahaffrey GitHub\" href=\"http:\/\/annem.github.io\/ADXL362\/\" target=\"_blank\" rel=\"noopener\">Anne Mahaffrey<\/a> to my own, freshly created <a title=\"pixelk GitHub repository\" href=\"https:\/\/github.com\/pixelk0\/ADXL362\" target=\"_blank\" rel=\"noopener\">GitHub repository<\/a>.\u00a0Finally glue everything together with a small arduino sketch : <a title=\"Arduino sketch\" href=\"https:\/\/stuff.knackes.com\/dld\/201403\/ADXL362_Acc_LED_2_1_0F60A88E.zip\" target=\"_blank\" rel=\"noopener\">ADXL362_Acc_LED_2_1.zip<\/a>.<\/p>\n<p>Here is a schema from the circuit (done in Fritzing) :<br \/>\n<a href=\"https:\/\/static.knackes.com\/images\/7D\/2014\/2014-03-22-ShakeMotion\/Schema.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" title=\"Arduino ShakeMotion\" alt=\"Arduino ShakeMotion\" src=\"https:\/\/static.knackes.com\/images\/7D\/2014\/2014-03-22-ShakeMotion\/Schema-Small.png\" width=\"500\" height=\"354\" \/><\/a>Schema file in Fritzing format : <a title=\"Fritzing file\" href=\"https:\/\/stuff.knackes.com\/dld\/201403\/ShakeMotion_2_6898ADD6.fzz\" target=\"_blank\" rel=\"noopener\">ShakeMotion_2.fzz<\/a> (the ADXL is not the right one)<\/p>\n<p>and here is my Bill Of Material :<\/p>\n<ul>\n<li>Arduino Pro Mini 3.3V\/8MHz<\/li>\n<li>Sparkfun ADXL362 breakout board (<a title=\"Sparkfun's ADXL362 breakout\" href=\"https:\/\/www.sparkfun.com\/products\/11446\" target=\"_blank\" rel=\"noopener\">SKU SEN-11446<\/a>)<\/li>\n<li>LM7805 voltage regulator<\/li>\n<li>FQP30N06L N-Channel MOSFET<\/li>\n<li>1N4007 diode<\/li>\n<li>1.5kE18 transient-voltage-suppression bidirectional diode (thanks to <a title=\"Sparkfun forum thread\" href=\"https:\/\/forum.sparkfun.com\/viewtopic.php?f=42&amp;t=37801\" target=\"_blank\" rel=\"noopener\">the sparkfun forum<\/a> for telling me about those)<\/li>\n<li>2500 mA resettable fuse<\/li>\n<li>10\u00b5F\/50V electrolytic capacitor<\/li>\n<li>100\u00b5F\/16V electrolytic capacitor<\/li>\n<li>Red LED<\/li>\n<li>330 \u03a9 resistor<\/li>\n<li>10\u00a0\u03a9 resistor<\/li>\n<li>100K\u00a0\u03a9 resistor<\/li>\n<\/ul>\n<p>I just added a 12V-to-USB power board to directly feed an USB powered gadget to the\u00a0back side of the box, and it&rsquo;s finished.<\/p>\n<p>There is much room for improvement : use low power modes on the Arduino, use the built-in motion sensor mode of the ADXL362, use a less power-hungry solution than a LM7805, tailor all my protection components for the same nominal current, but for the moment, it works.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Second english post to document my Arduino + ADXL362 Motion activated 12V switch. My car powers the cigarette lighter even when the keys are removed, Which &#8211; very slowly &#8211; drained the batteries when gadgets where left connected to it. &hellip; <a href=\"https:\/\/kim6.knackes.com\/blog\/index.php\/2014\/03\/22\/arduino-adxl362-motion-activated-12v-switch-en-anglais\/\">Continuer la lecture <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[12],"class_list":["post-695","post","type-post","status-publish","format-standard","hentry","category-electronique","tag-arduino"],"_links":{"self":[{"href":"https:\/\/kim6.knackes.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/695","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kim6.knackes.com\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kim6.knackes.com\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kim6.knackes.com\/blog\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kim6.knackes.com\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=695"}],"version-history":[{"count":0,"href":"https:\/\/kim6.knackes.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/695\/revisions"}],"wp:attachment":[{"href":"https:\/\/kim6.knackes.com\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=695"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kim6.knackes.com\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=695"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kim6.knackes.com\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=695"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}