{"id":270,"date":"2019-02-10T17:46:25","date_gmt":"2019-02-10T17:46:25","guid":{"rendered":"http:\/\/www.hardwarehacker.co.uk\/blog\/?p=270"},"modified":"2021-04-07T08:29:57","modified_gmt":"2021-04-07T08:29:57","slug":"tour-of-the-main-pcb","status":"publish","type":"post","link":"https:\/\/www.hardwarehacker.co.uk\/blog\/tour-of-the-main-pcb\/","title":{"rendered":"Tour of the main PCB"},"content":{"rendered":"<p>As mentioned in my <a href=\"https:\/\/www.hardwarehacker.co.uk\/blog\/mad-not-quite-hatting\/\">previous post<\/a>, this year we needed (an excuse) to learn KiCad and build a custom PCB.\u00a0 Thankfully, we did succeed in soldering it up , despite the tiny pitch on some of the components.<\/p>\n<p><a href=\"http:\/\/www.hardwarehacker.co.uk\/blog\/wp-content\/uploads\/2019\/02\/IMG_20181222_150316.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-276\" src=\"http:\/\/www.hardwarehacker.co.uk\/blog\/wp-content\/uploads\/2019\/02\/IMG_20181222_150316-300x225.jpg\" alt=\"Picture of the board\" width=\"300\" height=\"225\" srcset=\"https:\/\/www.hardwarehacker.co.uk\/blog\/wp-content\/uploads\/2019\/02\/IMG_20181222_150316-300x225.jpg 300w, https:\/\/www.hardwarehacker.co.uk\/blog\/wp-content\/uploads\/2019\/02\/IMG_20181222_150316-768x576.jpg 768w, https:\/\/www.hardwarehacker.co.uk\/blog\/wp-content\/uploads\/2019\/02\/IMG_20181222_150316-1024x768.jpg 1024w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>The PCB dives into a few parts.\u00a0 I expect you&#8217;ll all recognise the Pi header in the top left.\u00a0 Above that, in yellow on the annotated image, we have the SPI peripherals: the screen and the IMU (which we use mainly for the gyroscope).<\/p>\n<figure id=\"attachment_283\" aria-describedby=\"caption-attachment-283\" style=\"width: 300px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/www.hardwarehacker.co.uk\/blog\/wp-content\/uploads\/2019\/02\/board-with-annotations.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-283\" src=\"http:\/\/www.hardwarehacker.co.uk\/blog\/wp-content\/uploads\/2019\/02\/board-with-annotations-300x225.jpg\" alt=\"Annotated board\" width=\"300\" height=\"225\" srcset=\"https:\/\/www.hardwarehacker.co.uk\/blog\/wp-content\/uploads\/2019\/02\/board-with-annotations-300x225.jpg 300w, https:\/\/www.hardwarehacker.co.uk\/blog\/wp-content\/uploads\/2019\/02\/board-with-annotations-768x576.jpg 768w, https:\/\/www.hardwarehacker.co.uk\/blog\/wp-content\/uploads\/2019\/02\/board-with-annotations-1024x768.jpg 1024w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><figcaption id=\"caption-attachment-283\" class=\"wp-caption-text\">Yellow: peripheral connectors; Pink: Parallax Propeller; Green: Time-of-flight sensor connectors; Red: Isolation chips<\/figcaption><\/figure>\n<p>Below the header, in pink, we have the Parallax propeller chip, a fast microcontroller that we use to decode the signals from the motors.\u00a0 \u00a0Each motor can put out 200k pulses per second, which isn&#8217;t really possible to handle from the GPIO pins because Linux can&#8217;t really handle that many interrupts per second.<\/p>\n<p><a href=\"http:\/\/www.hardwarehacker.co.uk\/blog\/wp-content\/uploads\/2019\/02\/IMG_20181222_115123.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-273\" src=\"http:\/\/www.hardwarehacker.co.uk\/blog\/wp-content\/uploads\/2019\/02\/IMG_20181222_115123-300x225.jpg\" alt=\"\" width=\"300\" height=\"225\" srcset=\"https:\/\/www.hardwarehacker.co.uk\/blog\/wp-content\/uploads\/2019\/02\/IMG_20181222_115123-300x225.jpg 300w, https:\/\/www.hardwarehacker.co.uk\/blog\/wp-content\/uploads\/2019\/02\/IMG_20181222_115123-768x576.jpg 768w, https:\/\/www.hardwarehacker.co.uk\/blog\/wp-content\/uploads\/2019\/02\/IMG_20181222_115123-1024x768.jpg 1024w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>To the right, in yellow, we have connectors for the &#8220;noisy&#8221; off-board components.\u00a0 These sit over their own ground plane, so that, if we want to, we can drive them from a completely isolated power supply. From top to bottom:<\/p>\n<ul>\n<li>&#8220;noisy&#8221; 5v power<\/li>\n<li>motor driver control 1<\/li>\n<li>motor encoder 1<\/li>\n<li>motor driver control 2<\/li>\n<li>motor encoder 2<\/li>\n<li>servo controller<\/li>\n<li>2 x power monitors<\/li>\n<\/ul>\n<p>To bridge the gap between the microcontroller and the noisy world of the motors, (in red) we have a pair of ISO7742 chips.\u00a0 These provide two input and two output signals, which are level shifted from 3.3v to 5v and are\u00a0 isolated through an internal capacitor.\u00a0 Unlike an optoisolator, they were super-simple to use, requiring 3.3v and 5v power and grounds, a couple of decoupling capacitors and some pull-ups on their enable pins.<\/p>\n<p><a href=\"http:\/\/www.hardwarehacker.co.uk\/blog\/wp-content\/uploads\/2019\/02\/Screenshot-from-2019-02-10-17-08-11.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-284\" src=\"http:\/\/www.hardwarehacker.co.uk\/blog\/wp-content\/uploads\/2019\/02\/Screenshot-from-2019-02-10-17-08-11-300x170.png\" alt=\"\" width=\"300\" height=\"170\" srcset=\"https:\/\/www.hardwarehacker.co.uk\/blog\/wp-content\/uploads\/2019\/02\/Screenshot-from-2019-02-10-17-08-11-300x170.png 300w, https:\/\/www.hardwarehacker.co.uk\/blog\/wp-content\/uploads\/2019\/02\/Screenshot-from-2019-02-10-17-08-11-768x434.png 768w, https:\/\/www.hardwarehacker.co.uk\/blog\/wp-content\/uploads\/2019\/02\/Screenshot-from-2019-02-10-17-08-11.png 778w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>Similarly, below that, we have an isolated i2c line for driving the servo board (which runs from the &#8220;noisy&#8221; 5v power supply.<\/p>\n<p>In the bottom left (in green) we have 6 connectors for optical time-of-flight sensors.<\/p>\n<p>The time of flight sensors, Propeller, servo controller and voltage monitors are all i2c controlled, which poses a couple of problems:<\/p>\n<ul>\n<li>i2c busses tend to become unstable with more than a handful of devices (because each device adds capacitance to the bus, making it harder for any device to drive the bus)<\/li>\n<li>we have no control over the addresses of many of the devices; for example, all the time-of-flight sensors use the same address.<\/li>\n<\/ul>\n<p>To address those problems, we included an i2c multiplexer in the design (to the left of the Propeller), allowing us to switch any combination of devices on and off the bus.<\/p>\n<figure id=\"attachment_286\" aria-describedby=\"caption-attachment-286\" style=\"width: 300px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/www.hardwarehacker.co.uk\/blog\/wp-content\/uploads\/2019\/02\/Screenshot-from-2019-02-10-17-24-39.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-286\" src=\"http:\/\/www.hardwarehacker.co.uk\/blog\/wp-content\/uploads\/2019\/02\/Screenshot-from-2019-02-10-17-24-39-300x246.png\" alt=\"Multiplexer schematic\" width=\"300\" height=\"246\" srcset=\"https:\/\/www.hardwarehacker.co.uk\/blog\/wp-content\/uploads\/2019\/02\/Screenshot-from-2019-02-10-17-24-39-300x246.png 300w, https:\/\/www.hardwarehacker.co.uk\/blog\/wp-content\/uploads\/2019\/02\/Screenshot-from-2019-02-10-17-24-39.png 529w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><figcaption id=\"caption-attachment-286\" class=\"wp-caption-text\">Multiplexer schematic<\/figcaption><\/figure>\n<figure id=\"attachment_274\" aria-describedby=\"caption-attachment-274\" style=\"width: 300px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/www.hardwarehacker.co.uk\/blog\/wp-content\/uploads\/2019\/02\/IMG_20181222_120940.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-274 size-medium\" src=\"http:\/\/www.hardwarehacker.co.uk\/blog\/wp-content\/uploads\/2019\/02\/IMG_20181222_120940-300x225.jpg\" alt=\"Picture of the multiplexer\" width=\"300\" height=\"225\" srcset=\"https:\/\/www.hardwarehacker.co.uk\/blog\/wp-content\/uploads\/2019\/02\/IMG_20181222_120940-300x225.jpg 300w, https:\/\/www.hardwarehacker.co.uk\/blog\/wp-content\/uploads\/2019\/02\/IMG_20181222_120940-768x576.jpg 768w, https:\/\/www.hardwarehacker.co.uk\/blog\/wp-content\/uploads\/2019\/02\/IMG_20181222_120940-1024x768.jpg 1024w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><figcaption id=\"caption-attachment-274\" class=\"wp-caption-text\">Multiplexer<\/figcaption><\/figure>\n<p>Despite having very little space to play with, we were able to squeeze in a bit of prototyping area, which we&#8217;ve used to address errata.\u00a0 For example, I found that I&#8217;d missed a couple of pull-ups on the i2c port that the propeller was attached to.\u00a0 A bit of thin kynar wire to the rescue:<\/p>\n<p><a href=\"http:\/\/www.hardwarehacker.co.uk\/blog\/wp-content\/uploads\/2019\/02\/kynar.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-281\" src=\"http:\/\/www.hardwarehacker.co.uk\/blog\/wp-content\/uploads\/2019\/02\/kynar-225x300.jpg\" alt=\"\" width=\"225\" height=\"300\" srcset=\"https:\/\/www.hardwarehacker.co.uk\/blog\/wp-content\/uploads\/2019\/02\/kynar-225x300.jpg 225w, https:\/\/www.hardwarehacker.co.uk\/blog\/wp-content\/uploads\/2019\/02\/kynar-768x1024.jpg 768w, https:\/\/www.hardwarehacker.co.uk\/blog\/wp-content\/uploads\/2019\/02\/kynar.jpg 1536w\" sizes=\"(max-width: 225px) 100vw, 225px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>As mentioned in my previous post, this year we needed (an excuse) to learn KiCad and build a custom PCB.\u00a0 Thankfully, we did succeed in soldering it up , despite the tiny pitch on some of the components. The PCB dives into a few parts.\u00a0 I expect you&#8217;ll all recognise the Pi header in the &hellip; <a href=\"https:\/\/www.hardwarehacker.co.uk\/blog\/tour-of-the-main-pcb\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Tour of the main PCB<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9,5,10],"tags":[8,2],"_links":{"self":[{"href":"https:\/\/www.hardwarehacker.co.uk\/blog\/wp-json\/wp\/v2\/posts\/270"}],"collection":[{"href":"https:\/\/www.hardwarehacker.co.uk\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hardwarehacker.co.uk\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hardwarehacker.co.uk\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hardwarehacker.co.uk\/blog\/wp-json\/wp\/v2\/comments?post=270"}],"version-history":[{"count":2,"href":"https:\/\/www.hardwarehacker.co.uk\/blog\/wp-json\/wp\/v2\/posts\/270\/revisions"}],"predecessor-version":[{"id":287,"href":"https:\/\/www.hardwarehacker.co.uk\/blog\/wp-json\/wp\/v2\/posts\/270\/revisions\/287"}],"wp:attachment":[{"href":"https:\/\/www.hardwarehacker.co.uk\/blog\/wp-json\/wp\/v2\/media?parent=270"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hardwarehacker.co.uk\/blog\/wp-json\/wp\/v2\/categories?post=270"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hardwarehacker.co.uk\/blog\/wp-json\/wp\/v2\/tags?post=270"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}