{"id":1172,"date":"2016-01-22T22:43:34","date_gmt":"2016-01-22T22:43:34","guid":{"rendered":"http:\/\/4tronix.co.uk\/blog\/?p=1172"},"modified":"2019-03-05T13:40:17","modified_gmt":"2019-03-05T13:40:17","slug":"pzm-pi-zero-motor-shim","status":"publish","type":"post","link":"https:\/\/4tronix.co.uk\/blog\/?p=1172","title":{"rendered":"PZM &#8211; Pi Zero Motor Shim"},"content":{"rendered":"<h1>Add Motors to (Almost) Any Pi Zero Project<\/h1>\n<p><a href=\"http:\/\/4tronix.co.uk\/blog\/wp-content\/uploads\/2016\/01\/2016-01-22_0008a.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-1173\" src=\"http:\/\/4tronix.co.uk\/blog\/wp-content\/uploads\/2016\/01\/2016-01-22_0008a-300x166.jpg\" alt=\"2016-01-22_0008a\" width=\"469\" height=\"259\" srcset=\"https:\/\/4tronix.co.uk\/blog\/wp-content\/uploads\/2016\/01\/2016-01-22_0008a-300x166.jpg 300w, https:\/\/4tronix.co.uk\/blog\/wp-content\/uploads\/2016\/01\/2016-01-22_0008a.jpg 504w\" sizes=\"auto, (max-width: 469px) 100vw, 469px\" \/><\/a><\/p>\n<p><a title=\"Purchase Pi Zero Motor Shim\" href=\"https:\/\/shop.4tronix.co.uk\/products\/pzm\" target=\"_blank\" rel=\"noopener\">Purchase here<\/a><\/p>\n<p>This tiny little board (38 x 16mm) can be added to a Raspberry Pi Zero (or any other Pi for that matter) to provide dual H-Bridge control of 2 DC motors.<\/p>\n<p>It is so thin (0.8mm) that it can be soldered onto the bottom of the connector (assuming you have added one to your Pi Zero), or you can solder on the female or male headers included in the kit so you can connect and remove it, however you have configured your Pi Zero.<\/p>\n<p><a href=\"http:\/\/4tronix.co.uk\/blog\/wp-content\/uploads\/2016\/01\/2016-01-22_0007a.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-1174\" src=\"http:\/\/4tronix.co.uk\/blog\/wp-content\/uploads\/2016\/01\/2016-01-22_0007a-300x192.jpg\" alt=\"2016-01-22_0007a\" width=\"300\" height=\"192\" srcset=\"https:\/\/4tronix.co.uk\/blog\/wp-content\/uploads\/2016\/01\/2016-01-22_0007a-300x192.jpg 300w, https:\/\/4tronix.co.uk\/blog\/wp-content\/uploads\/2016\/01\/2016-01-22_0007a.jpg 541w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>Above shows the PZM with a female header added so it can be plugged onto a &#8220;normal&#8221; male header as shown below, Note how the PZM sticks out from the Pi, so other boards can still be mounted as usual<\/p>\n<p><a href=\"http:\/\/4tronix.co.uk\/blog\/wp-content\/uploads\/2016\/01\/2016-01-22_0002.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-1175\" src=\"http:\/\/4tronix.co.uk\/blog\/wp-content\/uploads\/2016\/01\/2016-01-22_0002-300x240.jpg\" alt=\"2016-01-22_0002\" width=\"300\" height=\"240\" srcset=\"https:\/\/4tronix.co.uk\/blog\/wp-content\/uploads\/2016\/01\/2016-01-22_0002-300x240.jpg 300w, https:\/\/4tronix.co.uk\/blog\/wp-content\/uploads\/2016\/01\/2016-01-22_0002-1024x819.jpg 1024w, https:\/\/4tronix.co.uk\/blog\/wp-content\/uploads\/2016\/01\/2016-01-22_0002.jpg 1280w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>Alternatively, you can mount it by soldering it directly to the bottom of the header, thus leaving the header free to attach other boards as shown below:<\/p>\n<p><a href=\"http:\/\/4tronix.co.uk\/blog\/wp-content\/uploads\/2016\/01\/2016-01-22_0013a.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-1176\" src=\"http:\/\/4tronix.co.uk\/blog\/wp-content\/uploads\/2016\/01\/2016-01-22_0013a-300x244.jpg\" alt=\"2016-01-22_0013a\" width=\"300\" height=\"244\" srcset=\"https:\/\/4tronix.co.uk\/blog\/wp-content\/uploads\/2016\/01\/2016-01-22_0013a-300x244.jpg 300w, https:\/\/4tronix.co.uk\/blog\/wp-content\/uploads\/2016\/01\/2016-01-22_0013a.jpg 999w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p><a href=\"http:\/\/4tronix.co.uk\/blog\/wp-content\/uploads\/2016\/01\/2016-01-22_0012a.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-1177\" src=\"http:\/\/4tronix.co.uk\/blog\/wp-content\/uploads\/2016\/01\/2016-01-22_0012a-300x182.jpg\" alt=\"2016-01-22_0012a\" width=\"300\" height=\"182\" srcset=\"https:\/\/4tronix.co.uk\/blog\/wp-content\/uploads\/2016\/01\/2016-01-22_0012a-300x182.jpg 300w, https:\/\/4tronix.co.uk\/blog\/wp-content\/uploads\/2016\/01\/2016-01-22_0012a-1024x622.jpg 1024w, https:\/\/4tronix.co.uk\/blog\/wp-content\/uploads\/2016\/01\/2016-01-22_0012a.jpg 1215w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<h2>Contents<\/h2>\n<p>So what do you get in the package?<\/p>\n<ul>\n<li>Ready assembled PZM shim<\/li>\n<li>3 x screw terminals<\/li>\n<li>3&#215;2 Male header<\/li>\n<li>3&#215;2 Female header<\/li>\n<\/ul>\n<p><a href=\"http:\/\/4tronix.co.uk\/blog\/wp-content\/uploads\/2016\/01\/pzm_kit01.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-1178\" src=\"http:\/\/4tronix.co.uk\/blog\/wp-content\/uploads\/2016\/01\/pzm_kit01-244x300.jpg\" alt=\"pzm_kit01\" width=\"244\" height=\"300\" srcset=\"https:\/\/4tronix.co.uk\/blog\/wp-content\/uploads\/2016\/01\/pzm_kit01-244x300.jpg 244w, https:\/\/4tronix.co.uk\/blog\/wp-content\/uploads\/2016\/01\/pzm_kit01.jpg 523w\" sizes=\"auto, (max-width: 244px) 100vw, 244px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<h2>Programming?<\/h2>\n<p>This is a 4 pin driven, dual H Bridge. 2 pins control Motor A and 2 pins control Motor B<\/p>\n<ul>\n<li>Motor A is physical pins 35 and 36 (Broadcom GPIO 16 and 19)<\/li>\n<li>Motor B is physical pins 37 and 38 (Broadcom GPIO 26 and 20)<\/li>\n<li>For each motor:\n<ul>\n<li>One pin High and the other Low for Forward<\/li>\n<li>One pin Low and the other High for Reverse<\/li>\n<li>Both pins Low will stop driving the motor and allow it to slowly coast to a halt<\/li>\n<li>Both pins High will brake the motor and bring it to a halt very quickly<\/li>\n<\/ul>\n<\/li>\n<li>The pzm.py library module provides basic functions for forward, reverse, spin left, spin right, turn left\/right forward, turn left\/right reverse<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<h3>Downloads:<\/h3>\n<p>From a terminal window on your Pi type the following lines exactly:<br \/>\n$ <span style=\"color: #800080;\">wget http:\/\/4tronix.co.uk\/pzm.sh -O pzm.sh<\/span><br \/>\n<span style=\"color: #800080;\"><span style=\"color: #000000;\"> $<\/span> bash pzm.sh<\/span><\/p>\n<p>This will have created a pzm folder in your home directory, with the following files:<\/p>\n<ul>\n<li><a title=\"PZM Library\" href=\"http:\/\/4tronix.co.uk\/pzm\/pzm.py\" target=\"_blank\" rel=\"noopener\">pzm.py<\/a> python library<\/li>\n<li><a title=\"pzmTest01\" href=\"http:\/\/4tronix.co.uk\/pzm\/pzmTest01.py\" target=\"_blank\" rel=\"noopener\">pzmTest01.py <\/a>shows use of the motors without using the library<\/li>\n<li><a title=\"pzmTest02\" href=\"http:\/\/4tronix.co.uk\/pzm\/pzmTest02.py\" target=\"_blank\" rel=\"noopener\">pzmTest02.py<\/a> shows the motors moving in the same way as pzmTest01 but using the library (much simpler program)<\/li>\n<li><a title=\"pzmTest03\" href=\"http:\/\/4tronix.co.uk\/pzm\/pzmTest03.py\" target=\"_blank\" rel=\"noopener\">pzmTest03.py<\/a> allows the use of arrow keys (and , and . to change speed) to control the motor directions<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<h2>Wiring?<\/h2>\n<ul>\n<li>Put power 3V to 11V on the terminal marked VIN and GND. If you are using low power motors you can use the 5V from the Pi (note this isn&#8217;t connected to the PZM board)<\/li>\n<li>Reverse polarity protection is provided so you won&#8217;t break it by putting them on the wrong way round, but it won&#8217;t work until you get it right!<\/li>\n<li>Connect one motor to Motor A and the other to Motor B<\/li>\n<li>Done!<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Add Motors to (Almost) Any Pi Zero Project Purchase here This tiny little board (38 x 16mm) can be added to a Raspberry Pi Zero (or any other Pi for that matter) to provide dual H-Bridge control of 2 DC motors. It is so thin (0.8mm) that it can be soldered onto the bottom of &hellip; <a href=\"https:\/\/4tronix.co.uk\/blog\/?p=1172\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">PZM &#8211; Pi Zero Motor Shim<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-1172","post","type-post","status-publish","format-standard","hentry","category-robotics-for-raspberry-pi"],"_links":{"self":[{"href":"https:\/\/4tronix.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1172","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/4tronix.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/4tronix.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/4tronix.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/4tronix.co.uk\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1172"}],"version-history":[{"count":8,"href":"https:\/\/4tronix.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1172\/revisions"}],"predecessor-version":[{"id":1943,"href":"https:\/\/4tronix.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1172\/revisions\/1943"}],"wp:attachment":[{"href":"https:\/\/4tronix.co.uk\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1172"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/4tronix.co.uk\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1172"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/4tronix.co.uk\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1172"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}