{"id":1167,"date":"2017-08-07T14:09:40","date_gmt":"2017-08-07T13:09:40","guid":{"rendered":"http:\/\/ofalcao.pt\/blog\/?p=1167"},"modified":"2017-08-07T14:19:38","modified_gmt":"2017-08-07T13:19:38","slug":"iot-monorail-lego-compatible","status":"publish","type":"post","link":"https:\/\/ofalcao.pt\/blog\/2017\/iot-monorail-lego-compatible","title":{"rendered":"IoT monorail (LEGO-compatible)"},"content":{"rendered":"<div class=\"seriesmeta\">This post is part 1 of 1 of \u00a0<a href=\"https:\/\/ofalcao.pt\/blog\/series\/iot-monorail\" class=\"series-313\" title=\"IoT Monorail\">IoT Monorail<\/a><\/div><p>When I was young never had the chance to get a LEGO monorail.<\/p>\n<p>I still feel sad knowing that LEGO will never produce the monorail again but at least I can now buy some used monorail parts at Bricklink stores. Expensive so I also decided to buy some custom 3D-printed parts from 4DBrix. Great, I&#8217;m gathering a small monorail system that soon will be automated with LEGO MINDSTORMS or\/and Raspberry Pi.<\/p>\n<p>But what I would really love\u00a0 to find is someone selling custom motors, compatible with the rail teeth. LEGO probably had its reasons to choose a gear and rack combination non-compatible with the LEGO Technic system but that makes it difficult to re-use the rails with current Power Function, Technic or even MINDSTORMS products.<\/p>\n<p>Others have embraced this problem designed a completely new rail system totally LEGO-based, like <a href=\"https:\/\/www.youtube.com\/user\/MasaoHidaka\/videos\">Masao Hidaka<\/a> amazing work. But always tender the idea of finding a compatible gear that I could use with a LEGO motor or at least with a small general motor so that I could create my own monorail engine and use the LEGO monorail tracks (and 4DBrix aswell).<\/p>\n<p>So I found that gear. In fact I&#8217;ve found several gears.<\/p>\n<p>The LEGO monorail engine gear is a 12-teeth metal gear with more or less a 6.9 mm diameter:<\/p>\n<p><a href=\"http:\/\/bricksetforum.com\/discussion\/24739\/were-bringing-back-the-monorail-3d-printed\"><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/d2ydh70d4b5xgv.cloudfront.net\/images\/e\/9\/lego-6399-6991-monorail-motor-9v-with-couplings-complete-assembly-2684c01a-5ac846cf39d6579f9136dbce30d81a37.jpg?w=840\" \/><\/a><\/p>\n<p>I never found an exact match. But I did find several smaller gears, with different number of teeth, that work very well. I chose a 10-teeth gear from a <a href=\"https:\/\/www.ptrobotics.com\/acessorios-mecanicos\/1124-mechanical-accessories-for-robotics-cbk6085cebek-c-6085-mechanical-accessories-for-robotics.html\">Cebek C-6086<\/a> kit available at a portuguese robotics shop:<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/i0.wp.com\/www.ptrobotics.com\/1370-thickbox_default\/mechanical-accessories-for-robotics-cbk6085cebek-c-6085-mechanical-accessories-for-robotics.jpg?resize=424%2C424&#038;ssl=1\" width=\"424\" height=\"424\" \/><\/p>\n<p>So I started gluing this small gear to a LEGO Technic piece that fits in the old micro-motor:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large\" src=\"https:\/\/lh3.googleusercontent.com\/nkEHiBzZc-b5CmrXyTwy_SULI8aCitHGmmYhNuMg4q4_Ppu5BOsB32XL7RfjZzVyaGKWWmhB4dpV-1Ee0y09kwbhPAJRqUAMC4jfZ1jpK1cM8HHtpsIHekEeHrWSUFSmhn-_i2HsjGwwYYQXHqUQSMr747X3DNxb74QdctgD3g6q6v2CEj18d5bgz4BzLfuO9fmLVhFN1jVqJSMhlhM0CuY8YKgtpi_XQMrHQxkkboDBiMX0w82M2a6nMpXIDedd7jANvBqh7yICrT0eDDPs4lNgFa_a8pi9T06F57i7wX3XT1VYjjCCwyUX91SNm2wNmMBphkn-vxTfDOcUpbQ7-HosPJSUUXwxhwYE5Iz7i165TpZrnkb9wc_wSrHZ5pNnWjN2cBuI78f3JfBZWDW9AgfZDJkkE7mLGcrAYs1uY1H6EHG924ibxHh-hO4Brp7TpIR9rssaRSrKfkA1WXw3XudnGUSu2GALAks8AXPF3wOTFtTtSX0QO1PS5gwjQvRcozyZLttu48667xMu9liR0KJiUkcJ2eLIvYN1xSVQmjK0SXXDPoOF073kZ0gVoTS_x-4NsDdGVM4OitFrZ_cFF8khnJS3k_nAdThiGsrOQwnjdyWIWcDi5y1mDhlPiKa9AQG0MjGi1tBXRThTOcQj4CYynOrhX9pTMNvKi-A2bPRVKQ=w1512-h850-no\" width=\"1512\" height=\"849\" \/><\/p>\n<p>To my surprise, this actually worked quite well, although too bulky and somewhat slow:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large\" src=\"https:\/\/lh3.googleusercontent.com\/IDd4rF5CiY1ShBSVrVeYuxtHVBAcTFxUzTjHi9wrOjFLROa_0k87lzJZY0-X3jNAowcVIn9pjvLyGoZdZ22SwUVJVkH78HMPdH_2d-48ET1NIa3plxJOcIEdnEgh8tYe8nxp--aEHYTPhs8J4HlghPJkZrvFIAWwsSjR7J4oC5GGDOnvaV2TpZAUjmoEiwFD-uct3dkd2YSiwIDXavCV6-C3nUcjmtJbVCGqKogoM13vcg-yVXSHX3zYiJupBmlrw1vW_2jwioDf44FqVSrKczg866rOgd3uR0pwrv34fRrWzaZQFQIgTlV5P1rBfU1cAbcUq-ClZkx6sSZWz-mTuEc0ojGGUZf8eksMOhV_HPmtCNbaMrtoLdLLtiHT3ogndcN2vUH3U7YS9l1YMmDB-rl12erpg8cXDQSxrylF5GkKnYpwMm0ZCpwlMPNgpcIl9-UWdYdF2a0_VtQve1yXMk8yRU4XHzIcbrL9JMFWQZ7ystVgBbI40l0LMCBERpHCrPaSizLTXeOKmDP5eANSi8X4ByGD8o3zl0fi8qjgxX-I0zwjcrplGfAlGIvQPzisnRPa-QKOGPn64fzgKM6sXOx934zV9swgiw4KKoCnnLjOyojjRw8c4ifD6rqCvsIdYOgAyCndxrjc9Ap7w3lV94YPcqn_UzCP0glAiTFOKG2IXg=w1512-h850-no\" width=\"1512\" height=\"849\" \/><\/p>\n<div class=\"jetpack-video-wrapper\"><iframe loading=\"lazy\" title=\"LEGO monorail compatible gear\" width=\"840\" height=\"473\" src=\"https:\/\/www.youtube.com\/embed\/xg1bWrFHSeA?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe><\/div>\n<p>So I decided to use a small <a href=\"https:\/\/www.pololu.com\/product\/1095\">Pololu #1095<\/a> geared motor I have from previous experiments with IoT LEGO vehicles:<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter \" src=\"https:\/\/i0.wp.com\/a.pololu-files.com\/picture\/0J427.600x480.jpg?resize=243%2C194&#038;ssl=1\" width=\"243\" height=\"194\" \/><\/p>\n<p>I don&#8217;t have a 3D printer and I&#8217;m also not good at 3D designing so I started using small scraps of plastic and cyano glue to create my own Technic adapter and after a few tries I already had something:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large\" src=\"https:\/\/lh3.googleusercontent.com\/6_6GdPEjsErtzCxF2F4sQAZqN9TS51G-A0icjstoHbnKZ-YA0NXsD27SeoShqdRE4Q7i1o3ZjaX9rfWM_Rwr3YP-Ir7r8o5zAueFf2ccVgjwBXDAawllRhDy7u2Cx6-XhsjpK7CKpfvC2sa6vwat2UQIZel43VjcgIXpn4EikWSyPcPpWDCqsM8BfqaF83ZsDR7vTZYgLhtjkOTOVUEXf2dgefOF5YrsNzQFy0pz5rLY-0fSGMI1pNqgzRnEsW67ALOH6LEFHpEHC4ZEAYmsrWqawLHGHyPx9k4rJfIJ2eLadM2x6rLUr1KCQx8s5HtnZAf4jK-ZNM9u4YBxRnb3oYzU3jx8wdhFNn_OinCG1igT1JWXtWv1DalbkXGKBiElhIEQ2ALJzJnN-n-Qj2lmAtV38wYltxS8zOYZhWN1I8jQYaoi_Jb11nQyf3FgKPS27WVUmPWhaT7eMxDyHKJaB4nZ1KKZuYTWW6fNsB86YnZZYX9zllcbwpnNOSB4lbT25Qa2APX-_aZwPDY7MSy6kPA-EWASgPIVCDnmbBAUYj1bE7HIygWaccfoZchTvmCdej2OlVvmMHTp3GKIx6HWzXQVq2rBi2MeJCLKbG3_TT3OLQ3h0mu5Y5JdcTXdCLoNZlykZBm0nsOM8K3Ngx2VI7OFimZWxGIwbNTbGw-sNJMVxA=w1512-h850-no\" width=\"1512\" height=\"849\" \/><\/p>\n<p>(I used another gear because the first one didn&#8217;t fit in the motor shaft)<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large\" src=\"https:\/\/lh3.googleusercontent.com\/madt9e5ZS49WCyNXtInapf2CCgR8Z7QjENS1dM4QQ8OyhVDKeSenmQ6qTHaZ44W1jpTaOrnFxNnD6t6qnNArA5gIf-kQUCTz5iHBILEuw6HGxpj1jhyIzlolTZKsjpZMwtVk61OkGg5Eaiz25u0yq6wfsTEFVFeGNF6q3C5ZU7-_zqE2-h46kGJtPGIrfLev5tuE7ipicKPPsr0Q8izBBcJZJtX6O9GbM2g4uqAsrsXG8HdNFQCCtQOuU8ak9GEZxY29mJdfCO9PBFm5hUB04r6qJE2rr-Clq1Xxgbc1hV8U-nIB9_NZcEkoYmO96Hblgqzz9VPHYWJAfG-DEB13I6KAyPv5eyYOQiz7gFSwUC80lndoAr2Pv164vzBQIWR_XsbnC2X1LFE947kYkOBZ__S-QM403-7wFe1dNlrUdP91GNn7gt_Axa2KQeMw38-iJDXVPveGTqoBwcyMEJkwK4n4_HoJmcJb5Z5vgwdETw1EezaKDSG6H3cXbNO62FC3Alqqn3Fpm-Cf7lJj_y84EXENRq2dscXirof5-g_ao9cX241dMlyIzchMCRq-GAmogWCNkZlWwxi-NrhAA5as9AONjC6zYkOqnOWM1_0_zvSGjFZ-bjYtkPIm3m9G0UOrwKwp3m4cz3-z3CoUyMR7c-0WDdn3KbFcD_uNaxoBSZCxEA=w1512-h850-no\" width=\"1512\" height=\"849\" \/><\/p>\n<p>With two small LiPo batteries it worked fine on straight tracks but not so well with curved tracks:<\/p>\n<div class=\"jetpack-video-wrapper\"><iframe loading=\"lazy\" title=\"[WIP] LEGO monorail compatible engine 2\" width=\"840\" height=\"473\" src=\"https:\/\/www.youtube.com\/embed\/1Hc4rDhpJII?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe><\/div>\n<p>So after another few tries I finally got my first working prototype:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large\" src=\"https:\/\/lh3.googleusercontent.com\/8VZNDK6wtijxGixvJYalH8Us4XON-DIGeNFLpD30sbwtpw_rJBjhPUPgXmDbs9cImkKfFxVGT-boPM4dszD-8CO7B9hMItK2IXBqKZI2o5rzZa7P5tYta7WxeIpqQ5qL3Cl4hl9uAp54L0kkDuSQ0yOC8STQEEvY3bxRR2UnJKYpR6_mIu0c3J7xG65JTCOS6z9M2WFGheE-kzMXl8DZ4oO56IG68VR645mjWEYXB5W7FW8nF07nwwgR4oqREiyhHf0e6MXIH_f32EsNRV8hi2p8-zmb-PrrCqdXIJR4jHnPadEsKyrc4S7U2DbTCRMap2IdBZ62iCDn9yRiWByGgaiWU3FnrThxVrOS6_lFAKN7CieEZnFaj1mjRg-gOi3oPJUusYZtvkcBEmDYBYZtT6kwyzKhyDVBHiwWc-VZChHVgpVG438xW0bNYrWIAGUFgWStez0uYgTG_4guARdXFLwwUwBQgW5v0MnPJA9GJtgBERDe0dtmFvh7KspZUEQE0gTKxJke9gguwItcSLol6Z7cY81bd4IhQWgJYzTbMnYayHNdkKAr2B9_YZKIGv7SDimit0KJ_O2uowZtzVyYyWRSPB6jbqzNEoYeOACCGoiNS2N16DHBiiKp81T-3Cxy_ol1s9fRgXK_XrF7BzfPjwNhvQ4JCOfyN4WO-qry178GVg=w1512-h850-no\" width=\"1512\" height=\"849\" \/><\/p>\n<p>It uses a NodeMCU (ESP-12E) microcontroller board running a small HTTP server so I turn the motor ON\/OFF from a browser or with wget commands like these bash script used on the next video:<\/p>\n<pre>#!\/usr\/bin\/env bash\r\nwget http:\/\/10.26.10.93\/gpio\/1 -O \/dev\/null\r\nsleep 6.0\r\nwget http:\/\/10.26.10.93\/gpio\/0 -O \/dev\/null<\/pre>\n<div class=\"jetpack-video-wrapper\"><iframe loading=\"lazy\" title=\"IoT monorail (LEGO-compatible) v0.1\" width=\"840\" height=\"473\" src=\"https:\/\/www.youtube.com\/embed\/vYMatsCb3N4?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe><\/div>\n<p>Will post more details later. For now this is the part list:<\/p>\n<ul>\n<li>NodeMCU (ESP-12E) microcontroller<\/li>\n<li>DRV8838 motor driver<\/li>\n<li>Pololu #1095 geared micro-motor<\/li>\n<li>PP3 9V battery<\/li>\n<li>PP3 connector<\/li>\n<li>jumper wires<\/li>\n<li>LEGO Technic pieces<\/li>\n<li>UHU tack<\/li>\n<li>cyano glue and plastic coffee spoons<\/li>\n<\/ul>\n<p>I&#8217;m also collecting all photos <a href=\"https:\/\/goo.gl\/photos\/gnxqPtBs6CjmmfeU7\">here<\/a> and all videos <a href=\"https:\/\/www.youtube.com\/playlist?list=PLfFEUoXrO1hLfp-aqlIDQzJz2ZN8UTSQO\">here<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"seriesmeta\">This post is part 1  of 1 of \u00a0<a href=\"https:\/\/ofalcao.pt\/blog\/series\/iot-monorail\" class=\"series-313\" title=\"IoT Monorail\">IoT Monorail<\/a><\/div><p>When I was young never had the chance to get a LEGO monorail. I still feel sad knowing that LEGO will never produce the monorail again but at least I can now buy some used monorail parts at Bricklink stores. Expensive so I also decided to buy some custom 3D-printed parts from 4DBrix. Great, I&#8217;m &hellip; <a href=\"https:\/\/ofalcao.pt\/blog\/2017\/iot-monorail-lego-compatible\" class=\"more-link\">Continuar a ler<span class=\"screen-reader-text\"> &#8220;IoT monorail (LEGO-compatible)&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false},"version":2}},"categories":[1],"tags":[],"series":[313],"class_list":["post-1167","post","type-post","status-publish","format-standard","hentry","category-sem-categoria","series-iot-monorail"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p2Mhyv-iP","_links":{"self":[{"href":"https:\/\/ofalcao.pt\/blog\/wp-json\/wp\/v2\/posts\/1167","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ofalcao.pt\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ofalcao.pt\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ofalcao.pt\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ofalcao.pt\/blog\/wp-json\/wp\/v2\/comments?post=1167"}],"version-history":[{"count":0,"href":"https:\/\/ofalcao.pt\/blog\/wp-json\/wp\/v2\/posts\/1167\/revisions"}],"wp:attachment":[{"href":"https:\/\/ofalcao.pt\/blog\/wp-json\/wp\/v2\/media?parent=1167"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ofalcao.pt\/blog\/wp-json\/wp\/v2\/categories?post=1167"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ofalcao.pt\/blog\/wp-json\/wp\/v2\/tags?post=1167"},{"taxonomy":"series","embeddable":true,"href":"https:\/\/ofalcao.pt\/blog\/wp-json\/wp\/v2\/series?post=1167"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}