{"id":1202,"date":"2016-02-14T16:36:03","date_gmt":"2016-02-14T16:36:03","guid":{"rendered":"http:\/\/4tronix.co.uk\/blog\/?p=1202"},"modified":"2019-05-17T16:09:53","modified_gmt":"2019-05-17T16:09:53","slug":"assembling-initio-using-robohat","status":"publish","type":"post","link":"https:\/\/4tronix.co.uk\/blog\/?p=1202","title":{"rendered":"Assembling Initio using RoboHAT"},"content":{"rendered":"<h1>Using RoboHAT with Initio<\/h1>\n<p><a href=\"http:\/\/4tronix.co.uk\/blog\/wp-content\/uploads\/2016\/02\/rh13.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-1203\" src=\"http:\/\/4tronix.co.uk\/blog\/wp-content\/uploads\/2016\/02\/rh13-300x252.jpg\" alt=\"rh13\" width=\"300\" height=\"252\" srcset=\"https:\/\/4tronix.co.uk\/blog\/wp-content\/uploads\/2016\/02\/rh13-300x252.jpg 300w, https:\/\/4tronix.co.uk\/blog\/wp-content\/uploads\/2016\/02\/rh13.jpg 800w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>Click on any image to enlarge<\/p>\n<p>&nbsp;<\/p>\n<p>You should already have followed the instructions for <a title=\"Assembling Initio Chassis\" href=\"http:\/\/4tronix.co.uk\/blog\/?p=795\">assembling the chassis <\/a>here.<\/p>\n<p>In this section we will add the RoboHAT controller, the obstacle sensors, line sensors and the pan\/tilt assembly with ultrasonic sensor.<\/p>\n<h2>1. Fitting the RoboHAT to the Raspberry Pi<\/h2>\n<p><a href=\"http:\/\/4tronix.co.uk\/blog\/wp-content\/uploads\/2016\/02\/step01.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-1204\" src=\"http:\/\/4tronix.co.uk\/blog\/wp-content\/uploads\/2016\/02\/step01-300x199.jpg\" alt=\"step01\" width=\"300\" height=\"199\" srcset=\"https:\/\/4tronix.co.uk\/blog\/wp-content\/uploads\/2016\/02\/step01-300x199.jpg 300w, https:\/\/4tronix.co.uk\/blog\/wp-content\/uploads\/2016\/02\/step01.jpg 800w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>Screw one of the support pillars to the underneath of the RoboHAT at the front (under the RoboHat logo). Then plug the RoboHAT onto the Raspberry Pi.<\/p>\n<p>Push the RoboHAT carefully onto the GPIO pins of the Raspberry Pi, ensuring the pins are placed correctly as shown in the photo above<\/p>\n<p><a href=\"http:\/\/4tronix.co.uk\/blog\/wp-content\/uploads\/2016\/02\/step02.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-1205\" src=\"http:\/\/4tronix.co.uk\/blog\/wp-content\/uploads\/2016\/02\/step02-300x199.jpg\" alt=\"step02\" width=\"300\" height=\"199\" srcset=\"https:\/\/4tronix.co.uk\/blog\/wp-content\/uploads\/2016\/02\/step02-300x199.jpg 300w, https:\/\/4tronix.co.uk\/blog\/wp-content\/uploads\/2016\/02\/step02.jpg 800w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>Connect the motor wires as shown. Red \u2013 Black \u2013 Black \u2013 Red<\/p>\n<p>It won\u2019t damage it if you connect them differently, but the example programs won\u2019t go the direction that you would expect<\/p>\n<p><a href=\"http:\/\/4tronix.co.uk\/blog\/wp-content\/uploads\/2015\/02\/ultpi_23.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/4tronix.co.uk\/blog\/wp-content\/uploads\/2015\/02\/ultpi_23-300x199.jpg\" alt=\"ultpi_23\" width=\"300\" height=\"199\" \/><\/a><\/p>\n<p>Plug the Black\/White cable with the DC Jack into the left-most pins on the switch PCB on Initio and the DC Jack end into the RoboHAT as shown above.<\/p>\n<p>There will be a spare cable with Red and Black wires. This is not required for the Raspberry Pi build and should be removed so the ends don&#8217;t short.<\/p>\n<p>Check all the wiring again very carefully, then now is a good time to see if the Pi powers up and you can control the motors.<\/p>\n<p>Use 6xAA batteries. These should be good quality rechargeable batteries. We recommend Energizer Extremes or Eneloops<\/p>\n<p>Connect a monitor, keyboard and mouse to the Raspberry Pi, plug in your SD card and switch on. The green light near the On\/Off switch should turn on, the LEDs on the Pi should start flashing and the booting sequence should appear on the monitor. If not, switch off and double check the wiring.<\/p>\n<p>Instead of using the batteries, you can plug a micro-USB cable directly into the connector on the Pi. This is an excellent way to get started and allows you to test everything (except the motors, which may turn but only slowly) without using batteries.<\/p>\n<p>&nbsp;<\/p>\n<h2>2. Mounting Obstacle Sensors<\/h2>\n<p><a href=\"http:\/\/4tronix.co.uk\/blog\/wp-content\/uploads\/2015\/02\/ultpi_02.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/4tronix.co.uk\/blog\/wp-content\/uploads\/2015\/02\/ultpi_02-300x260.jpg\" alt=\"ultpi_02\" width=\"300\" height=\"260\" \/><\/a><\/p>\n<p>Check that each sensor has 2 mounting collars. Screw one onto the body of the sensor, leaving room at the front for the second one<\/p>\n<p><a href=\"http:\/\/4tronix.co.uk\/blog\/wp-content\/uploads\/2015\/02\/ultpi_03.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/4tronix.co.uk\/blog\/wp-content\/uploads\/2015\/02\/ultpi_03-300x199.jpg\" alt=\"ultpi_03\" width=\"300\" height=\"199\" \/><\/a><\/p>\n<p>Push the sensor through from the rear of the mounting bracket and screw on the second collar. Feed the wires up through the holes in the top plate<\/p>\n<p><a href=\"http:\/\/4tronix.co.uk\/blog\/wp-content\/uploads\/2015\/02\/ultpi_04.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/4tronix.co.uk\/blog\/wp-content\/uploads\/2015\/02\/ultpi_04-300x199.jpg\" alt=\"ultpi_04\" width=\"300\" height=\"199\" \/><\/a><\/p>\n<p>Repeat for the second side<\/p>\n<p><a href=\"http:\/\/4tronix.co.uk\/blog\/wp-content\/uploads\/2016\/02\/step03.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-1206\" src=\"http:\/\/4tronix.co.uk\/blog\/wp-content\/uploads\/2016\/02\/step03-300x199.jpg\" alt=\"step03\" width=\"300\" height=\"199\" srcset=\"https:\/\/4tronix.co.uk\/blog\/wp-content\/uploads\/2016\/02\/step03-300x199.jpg 300w, https:\/\/4tronix.co.uk\/blog\/wp-content\/uploads\/2016\/02\/step03.jpg 800w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>Connect to the RoboHAT INPUTs<\/p>\n<ul>\n<li>Left sensor to Pin 7 (marked x07 or #04)<\/li>\n<li>Right sensor to Pin 11 (marked x11 or #17)<\/li>\n<\/ul>\n<p>The wire colours from the obstacle sensor are:<\/p>\n<ul>\n<li>Black: Gnd<\/li>\n<li>Red:\u00a0 5V<\/li>\n<li>White or Yellow: Signal<\/li>\n<\/ul>\n<p>Make sure you connect them to the correct pins on the RoboHAT<\/p>\n<p>&nbsp;<\/p>\n<h2>3. Mounting the Line Sensors<\/h2>\n<p><a href=\"http:\/\/4tronix.co.uk\/blog\/wp-content\/uploads\/2015\/02\/ultpi_07.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/4tronix.co.uk\/blog\/wp-content\/uploads\/2015\/02\/ultpi_07-300x197.jpg\" alt=\"ultpi_07\" width=\"300\" height=\"197\" \/><\/a><\/p>\n<p>First, take the 30cm female-female jumper strip of 10 wires and split it into three strips:<\/p>\n<ul>\n<li>Brown, Red, Orange, Yellow (this is for the Ultrasonic Sensor)<\/li>\n<li>Green, Blue, Purple (this is for the Left Line Sensor)<\/li>\n<li>Grey, White, Black (this is for the Right Line Sensor)<\/li>\n<\/ul>\n<p><a href=\"http:\/\/4tronix.co.uk\/blog\/wp-content\/uploads\/2015\/02\/ultpi_08.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/4tronix.co.uk\/blog\/wp-content\/uploads\/2015\/02\/ultpi_08-300x213.jpg\" alt=\"ultpi_08\" width=\"300\" height=\"213\" \/><\/a><\/p>\n<p>Next, prepare the two Line Sensors and 2 of the 3x8PB screws as shown<\/p>\n<p><a href=\"http:\/\/4tronix.co.uk\/blog\/wp-content\/uploads\/2015\/02\/ultpi_09.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/4tronix.co.uk\/blog\/wp-content\/uploads\/2015\/02\/ultpi_09-300x199.jpg\" alt=\"ultpi_09\" width=\"300\" height=\"199\" \/><\/a><\/p>\n<p>Screw the line sensors in position as shown, using the screwhole in the middle of the circuit board<\/p>\n<p><a href=\"http:\/\/4tronix.co.uk\/blog\/wp-content\/uploads\/2015\/02\/ultpi_10.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/4tronix.co.uk\/blog\/wp-content\/uploads\/2015\/02\/ultpi_10-300x199.jpg\" alt=\"ultpi_10\" width=\"300\" height=\"199\" \/><\/a><\/p>\n<p>Connect the Green, Blue, Purple wire to the Left Sensor and the Grey, White, Black cable to the Right Sensor<\/p>\n<p>** Note some sensors have the pins in order 5V, Signal, Gnd; other have them in order Signal, 5V, Gnd \u2013 make sure you know which wire colour is connected to which.<\/p>\n<p><a href=\"http:\/\/4tronix.co.uk\/blog\/wp-content\/uploads\/2016\/02\/step04.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-1207\" src=\"http:\/\/4tronix.co.uk\/blog\/wp-content\/uploads\/2016\/02\/step04-300x199.jpg\" alt=\"step04\" width=\"300\" height=\"199\" srcset=\"https:\/\/4tronix.co.uk\/blog\/wp-content\/uploads\/2016\/02\/step04-300x199.jpg 300w, https:\/\/4tronix.co.uk\/blog\/wp-content\/uploads\/2016\/02\/step04.jpg 800w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>Connect the sensors to the RoboHAT<\/p>\n<ul>\n<li>Left sensor to Pin 29 (marked x29 or #05)<\/li>\n<li>Right sensor to Pin 13 (marked x13 or #27)<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<h2>4. Connecting the Pan\/Tilt Assembly<\/h2>\n<p><a href=\"http:\/\/4tronix.co.uk\/blog\/wp-content\/uploads\/2015\/02\/ultpi_12.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/4tronix.co.uk\/blog\/wp-content\/uploads\/2015\/02\/ultpi_12-300x227.jpg\" alt=\"ultpi_12\" width=\"300\" height=\"227\" \/><\/a><\/p>\n<p>This is now supplied fully assembled with the Initio Ultimate kit. If you have an unassembled one, then please visit the <a title=\"Assembling the Pan\/Tilt Kit\" href=\"http:\/\/4tronix.co.uk\/arduino\/Pan-Tilt-Micro.php\" target=\"_blank\" rel=\"noopener\">assembly instructions here <\/a>(opens in new window)<\/p>\n<p>Take 4 of the 2.0x6PB screws (these are the smallest ones in the packet and there are 6 of them)<\/p>\n<p><a href=\"http:\/\/4tronix.co.uk\/blog\/wp-content\/uploads\/2015\/02\/ultpi_13.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/4tronix.co.uk\/blog\/wp-content\/uploads\/2015\/02\/ultpi_13-300x199.jpg\" alt=\"ultpi_13\" width=\"300\" height=\"199\" \/><\/a><\/p>\n<p>Screw the base of the pan\/tilt assembly to the upper plate in the position shown<\/p>\n<p>Rotate the pan\/tilt carefully left and right to access the screw holes<\/p>\n<p><a href=\"http:\/\/4tronix.co.uk\/blog\/wp-content\/uploads\/2016\/02\/step05.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-1208\" src=\"http:\/\/4tronix.co.uk\/blog\/wp-content\/uploads\/2016\/02\/step05-300x199.jpg\" alt=\"step05\" width=\"300\" height=\"199\" srcset=\"https:\/\/4tronix.co.uk\/blog\/wp-content\/uploads\/2016\/02\/step05-300x199.jpg 300w, https:\/\/4tronix.co.uk\/blog\/wp-content\/uploads\/2016\/02\/step05.jpg 800w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>Connect the Pan servo (bottom servo) to Pin 22 (marked x22 or #25)<\/p>\n<p>Connect the Tilt servo (upper servo) to Pin 18 (marked x18 or #24)<\/p>\n<p>Note the colours of the servo wires and ensure they are connected correctly:<\/p>\n<ul>\n<li>Black: Gnd<\/li>\n<li>Red: 5V<\/li>\n<li>Orange or White: Signal<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<h2>5. Connecting the Ultrasonic Sensor<\/h2>\n<p><strong>NOTE:<\/strong> More recent kits use a specially purchased ultrasonic sensor which has the connection pins at the front, instead of at the rear as shown below. If you have one of these, then simply use 2 small screws (included) to fit the sensor securely to the mounting plate. If your connection pins are at the back, please follow the instructions below. The wiring is the same in either case.<\/p>\n<p><a href=\"http:\/\/4tronix.co.uk\/blog\/wp-content\/uploads\/2015\/02\/ultpi_15.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/4tronix.co.uk\/blog\/wp-content\/uploads\/2015\/02\/ultpi_15-300x206.jpg\" alt=\"ultpi_15\" width=\"300\" height=\"206\" \/><\/a><\/p>\n<p>For this you will need the mounting plate, saddle clamp and the final 2 of the 2.0x6PB screws used in step 4<\/p>\n<p><a href=\"http:\/\/4tronix.co.uk\/blog\/wp-content\/uploads\/2015\/02\/ultpi_16.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/4tronix.co.uk\/blog\/wp-content\/uploads\/2015\/02\/ultpi_16-300x234.jpg\" alt=\"ultpi_16\" width=\"300\" height=\"234\" \/><\/a><\/p>\n<p>Push the 4-way 30cm female-female cable that you made in Step 3 onto the top of the ultrasonic sensor:<\/p>\n<ul>\n<li>Brown: Gnd<\/li>\n<li>Red: Echo<\/li>\n<li>Orange: Trig or Ping<\/li>\n<li>Yellow: 5V or VCC<\/li>\n<\/ul>\n<p><a href=\"http:\/\/4tronix.co.uk\/blog\/wp-content\/uploads\/2015\/02\/ultpi_17.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/4tronix.co.uk\/blog\/wp-content\/uploads\/2015\/02\/ultpi_17-300x223.jpg\" alt=\"ultpi_17\" width=\"300\" height=\"223\" \/><\/a><\/p>\n<p>Screw the saddle clamp over the cable terminals as shown above<\/p>\n<p><a href=\"http:\/\/4tronix.co.uk\/blog\/wp-content\/uploads\/2015\/02\/ultpi_18.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/4tronix.co.uk\/blog\/wp-content\/uploads\/2015\/02\/ultpi_18-300x199.jpg\" alt=\"ultpi_18\" width=\"300\" height=\"199\" \/><\/a><\/p>\n<p>Clip the whole assembly to the front of the Pan\/Tilt assembly as shown above<\/p>\n<p>Note that you can purchase additional clip-on mounts so you could mount a camera on one and simply clip it off to change from Ultrasonic to Camera<\/p>\n<p><a href=\"http:\/\/4tronix.co.uk\/blog\/wp-content\/uploads\/2016\/02\/step06.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-1209\" src=\"http:\/\/4tronix.co.uk\/blog\/wp-content\/uploads\/2016\/02\/step06-300x199.jpg\" alt=\"step06\" width=\"300\" height=\"199\" srcset=\"https:\/\/4tronix.co.uk\/blog\/wp-content\/uploads\/2016\/02\/step06-300x199.jpg 300w, https:\/\/4tronix.co.uk\/blog\/wp-content\/uploads\/2016\/02\/step06.jpg 800w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>Connect the other end of the cable into the ultrasonic pins located between the 2 motor terminals<\/p>\n<p>Ensure that Brown is Gnd, and they are in the order as shown<\/p>\n<p>&nbsp;<\/p>\n<h3>The main build of your Ultimate Initio Kit for the Raspberry Pi is now complete.<\/h3>\n<p>&nbsp;<\/p>\n<h2>6. Connecting the Wheel Sensors (Optional)<\/h2>\n<p>Note that the wheel sensors require additional code to operate properly that is not included in the python library.<\/p>\n<p>It is recommended that you <strong>do not fit these until you are familiar<\/strong> with the operation of the rest of the robot.<\/p>\n<p>If you want to fit them, use Pins 15 and 16 (marked x15, x16 or #22, #23)<\/p>\n<p>For each Wheel Sensor, connect:<\/p>\n<ul>\n<li>Black to Gnd<\/li>\n<li>Red to 5V<\/li>\n<li>Orange or Brown to the selected pin (in fact, each wheel has 2 sensors that are slightly out of phase so you can get direction of travel from them, but you will then need 2 pins for each sensor)<\/li>\n<li>DO NOT connect the sensor wires directly to GPIO pins on the Raspberry Pi as they are 5V signals. Always use beffered inputs as on the RoboHAT<\/li>\n<\/ul>\n<p>It is recommended to leave the wheel sensor cables unconnected to start with<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Using RoboHAT with Initio Click on any image to enlarge &nbsp; You should already have followed the instructions for assembling the chassis here. In this section we will add the RoboHAT controller, the obstacle sensors, line sensors and the pan\/tilt assembly with ultrasonic sensor. 1. Fitting the RoboHAT to the Raspberry Pi Screw one of &hellip; <a href=\"https:\/\/4tronix.co.uk\/blog\/?p=1202\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Assembling Initio using RoboHAT<\/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-1202","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\/1202","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=1202"}],"version-history":[{"count":5,"href":"https:\/\/4tronix.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1202\/revisions"}],"predecessor-version":[{"id":1991,"href":"https:\/\/4tronix.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1202\/revisions\/1991"}],"wp:attachment":[{"href":"https:\/\/4tronix.co.uk\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1202"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/4tronix.co.uk\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1202"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/4tronix.co.uk\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1202"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}