Silicon ChipMake it with Micromite - May 2020 SILICON CHIP
  1. Outer Front Cover
  2. Contents
  3. Subscriptions: PE Subscription
  4. Publisher's Letter: Publisher's Statement
  5. Publisher's Letter
  6. Feature: The Fox Report by Barry Fox
  7. Feature: Techno Talk by Mark Nelson
  8. Feature: Net Work by Alan Winstanley
  9. Project: 433MHz Wireless Data Range Extender by John Clarke
  10. Project: Bridge-mode Audio Amplifier Adaptor by NICHOLAS VINEN
  11. Project: iCEstick by Tim Blythman
  12. Project: Ultra-low-distortion Preamplifier with Tone Controls by John Clarke
  13. Feature: Circuit Surgery by Ian Bell
  14. Feature: PIC n’Mix by Mike Hibbett
  15. Feature: Make it with Micromite by Phil Boyce
  16. Feature: AUDIO OUT by Jake Rothman
  17. Feature: Visual programming with XOD by Julian Edgar
  18. Back Issues by Julian Edgar
  19. Feature: Max’s Cool Beans by Max the Magnificent
  20. PCB Order Form
  21. Advertising Index

This is only a preview of the May 2020 issue of Practical Electronics.

You can view 0 of the 80 pages in the full issue.

Articles in this series:
  • Techno Talk (May 2020)
  • Techno Talk (May 2020)
  • Techno Talk (June 2020)
  • Techno Talk (June 2020)
  • Techno Talk (July 2020)
  • Techno Talk (July 2020)
  • Techno Talk (August 2020)
  • Techno Talk (August 2020)
  • Techno Talk (September 2020)
  • Techno Talk (September 2020)
  • Techno Talk (October 2020)
  • Techno Talk (October 2020)
  • (November 2020)
  • (November 2020)
  • Techno Talk (December 2020)
  • Techno Talk (December 2020)
  • Techno Talk (January 2021)
  • Techno Talk (January 2021)
  • Techno Talk (February 2021)
  • Techno Talk (February 2021)
  • Techno Talk (March 2021)
  • Techno Talk (March 2021)
  • Techno Talk (April 2021)
  • Techno Talk (April 2021)
  • Techno Talk (May 2021)
  • Techno Talk (May 2021)
  • Techno Talk (June 2021)
  • Techno Talk (June 2021)
  • Techno Talk (July 2021)
  • Techno Talk (July 2021)
  • Techno Talk (August 2021)
  • Techno Talk (August 2021)
  • Techno Talk (September 2021)
  • Techno Talk (September 2021)
  • Techno Talk (October 2021)
  • Techno Talk (October 2021)
  • Techno Talk (November 2021)
  • Techno Talk (November 2021)
  • Techno Talk (December 2021)
  • Techno Talk (December 2021)
  • Communing with nature (January 2022)
  • Communing with nature (January 2022)
  • Should we be worried? (February 2022)
  • Should we be worried? (February 2022)
  • How resilient is your lifeline? (March 2022)
  • How resilient is your lifeline? (March 2022)
  • Go eco, get ethical! (April 2022)
  • Go eco, get ethical! (April 2022)
  • From nano to bio (May 2022)
  • From nano to bio (May 2022)
  • Positivity follows the gloom (June 2022)
  • Positivity follows the gloom (June 2022)
  • Mixed menu (July 2022)
  • Mixed menu (July 2022)
  • Time for a total rethink? (August 2022)
  • Time for a total rethink? (August 2022)
  • What’s in a name? (September 2022)
  • What’s in a name? (September 2022)
  • Forget leaves on the line! (October 2022)
  • Forget leaves on the line! (October 2022)
  • Giant Boost for Batteries (December 2022)
  • Giant Boost for Batteries (December 2022)
  • Raudive Voices Revisited (January 2023)
  • Raudive Voices Revisited (January 2023)
  • A thousand words (February 2023)
  • A thousand words (February 2023)
  • It’s handover time (March 2023)
  • It’s handover time (March 2023)
  • AI, Robots, Horticulture and Agriculture (April 2023)
  • AI, Robots, Horticulture and Agriculture (April 2023)
  • Prophecy can be perplexing (May 2023)
  • Prophecy can be perplexing (May 2023)
  • Technology comes in different shapes and sizes (June 2023)
  • Technology comes in different shapes and sizes (June 2023)
  • AI and robots – what could possibly go wrong? (July 2023)
  • AI and robots – what could possibly go wrong? (July 2023)
  • How long until we’re all out of work? (August 2023)
  • How long until we’re all out of work? (August 2023)
  • We both have truths, are mine the same as yours? (September 2023)
  • We both have truths, are mine the same as yours? (September 2023)
  • Holy Spheres, Batman! (October 2023)
  • Holy Spheres, Batman! (October 2023)
  • Where’s my pneumatic car? (November 2023)
  • Where’s my pneumatic car? (November 2023)
  • Good grief! (December 2023)
  • Good grief! (December 2023)
  • Cheeky chiplets (January 2024)
  • Cheeky chiplets (January 2024)
  • Cheeky chiplets (February 2024)
  • Cheeky chiplets (February 2024)
  • The Wibbly-Wobbly World of Quantum (March 2024)
  • The Wibbly-Wobbly World of Quantum (March 2024)
  • Techno Talk - Wait! What? Really? (April 2024)
  • Techno Talk - Wait! What? Really? (April 2024)
  • Techno Talk - One step closer to a dystopian abyss? (May 2024)
  • Techno Talk - One step closer to a dystopian abyss? (May 2024)
  • Techno Talk - Program that! (June 2024)
  • Techno Talk - Program that! (June 2024)
  • Techno Talk (July 2024)
  • Techno Talk (July 2024)
  • Techno Talk - That makes so much sense! (August 2024)
  • Techno Talk - That makes so much sense! (August 2024)
  • Techno Talk - I don’t want to be a Norbert... (September 2024)
  • Techno Talk - I don’t want to be a Norbert... (September 2024)
  • Techno Talk - Sticking the landing (October 2024)
  • Techno Talk - Sticking the landing (October 2024)
  • Techno Talk (November 2024)
  • Techno Talk (November 2024)
  • Techno Talk (December 2024)
  • Techno Talk (December 2024)
  • Techno Talk (January 2025)
  • Techno Talk (January 2025)
  • Techno Talk (February 2025)
  • Techno Talk (February 2025)
  • Techno Talk (March 2025)
  • Techno Talk (March 2025)
  • Techno Talk (April 2025)
  • Techno Talk (April 2025)
  • Techno Talk (May 2025)
  • Techno Talk (May 2025)
  • Techno Talk (June 2025)
  • Techno Talk (June 2025)
  • Techno Talk (July 2025)
  • Techno Talk (July 2025)
Make it with Micromite Phil Boyce – hands on with the mighty PIC-powered, BASIC microcontroller Part 16: Introduction to the Micromite Robot Buggy T his month, we begin a really fun project – the Micromite Robot Buggy (MRB). The whole idea behind this robot is to demonstrate how to bring together many of the lessons learnt so far in the Make it with Micromite (MIWM) series, and combine them into a fun, highly customisable project. To help minimise the overall cost of the robot, three important design criteria were set: 1. Use the MKC as the robot brain – all aspects of the robot will be programmable, and under the control of MMBASIC code. 2. Use the Bluetooth module to provide a wireless link between the MKC and your terminal app. 3. Enable plug in of any other MIWM module from the series to provide extra features at no additional cost. The MRB could be regarded as a mobile MKC; but for the MKC to become mobile, some additional hardware is needed. For example, a minimum of two motors, a set of wheels, and some form of battery power. This month, we will start discussing a new module: the robot chassis. This will not only provide the new hardware required, but also allow the MKC and other MIWM modules to be plugged in. The robot chassis module comprises two main parts: an acrylic chassis unit (for attaching the mechanical hardware), and a daughterboard (for mounting the electronics). By simply plugging in your MKC, Bluetooth module and TFT module, along with a basic test program, you will create the MRB shown in Fig.1. Background The design of the MRB was inspired by the versatile Pololu Zumo robot. The Zumo is popular with Arduino users thanks to the availability of a Zumo shield (which enables an Arduino to be directly inserted). The Arduino then controls all aspects of the robot. Practical Electronics | May | 2020 Fig.1. The Micromite Robot Buggy (MRB) (front) next to the popular Zumo buggy, on which the design is based. Note the red acrylic chassis under the stripboard. The Zumo is a small (100mm × 100mm) robot that uses a pair of silicone tracks to provide traction. It is a very modular design, with all mechanical and electrical elements available as individual parts. Therefore, the Zumo seemed like a suitable robot from which to create a Micromitecontrolled version. Initially, I considered replacing the Arduino Zumo shield with an equivalent Micromite daughterboard, and mount this onto the existing Zumo chassis. The Micromite daughterboard should ideally be a piece of stripboard using throughhole components and modules, making it a quick project for this series. However, early prototypes of the Micromite version quickly highlighted the fact that in order to physically accommodate the MKC (and other modules from the MIWM series), a slightly bigger chassis would be required. This would mean that we could no longer use the readily available Zumo chassis. This wasn’t too much of an issue because the Zumo chassis could easily be replaced with an alternative. Access to a laser cutter meant I could create a custom acrylic chassis designed to meet our exact requirements. The end result is only slightly larger (150mm × 150mm) and is shown in Fig.2. Replacing the Zumo chassis with our own custom chassis meant that two other matters needed resolving. This is because the Zumo chassis has appropriately sized (small) tracks, and also has a built-in 53 Fig.4. The shorter Zumo tracks have 22 toothed-slots designed to be used with wheels spaced 48mm apart. The MRB uses the longer 30-toothed tracks allowing the wheel spacing to be increased to 85mm. Fig.2. This custom laser-cut acrylic chassis is used instead of the smaller Zumo chassis. battery compartment designed to take four AA rechargeable batteries. So we need to resolve design issues around tracks and power. The silicone tracks need to be increased in size to suit our bigger chassis. In fact, all that is required is to increase the distance between the wheels (easy), which means slightly longer tracks. On the Zumo, each silicone track has 22 ‘teeth’ and it is wrapped around a pair of toothed-wheels (the wheels and tracks are available as a kit). The track length ultimately defines the distance between the wheel-centres and on the Zumo this equates to a spacing of 48mm. Thankfully, there is an alternative kit available which has tracks containing 30 teeth (30T, see Fig.3). This simply means that the tracks are slightly longer than the Zumo version, and they result in the wheels being spaced 85mm apart. This is perfect for our new chassis, so these 30T tracks are used in our robot. You can see the increased wheel spacing and the longer tracks in Fig.4. Power Now we turn to power for the robot. Initial prototypes were designed to use a readily available mobile phone USB battery pack. These can supply the 5V output required to power the robot; however, an unforeseen problem was that 99% of these units are designed to automatically switch off if they are not connected to a ‘load’ (ie, not connected to a phone). The current consumption of the Micromite falls well below the battery pack’s Fig.3. The 30T track and toothed wheels are available as a kit (Pololu #3033). 54 threshold and hence it would automatically switch off after just a few seconds. All kinds of ‘dummy loads’ were tried (LEDs worked the best) but then a new issue arose – how to turn the robot on and off, especially if the battery pack’s on/off button was inaccessible. The battery pack also needs to be recharged, requiring access to its charging socket, which means it would need to be easily removed from the robot. Furthermore, most battery packs are physically bigger (thicker) than we want, so the decision was taken to abandon this idea, and instead use a thin LiPo battery (Fig.5), partnered with a PowerBoost 1000C module from Adafruit (Fig.6). This excellent module not only takes the LiPo voltage (typically 3.7V) and boosts it to 5.2V, it also has a dedicated LiPo charger onboard to recharge the battery without ever needing to have direct physical access to it. An enable pin (EN) on the module provides the ability to switch the 5.2V boosted output on and off. With a little design imagination we can use a push button (instead of a switch) to turn the robot power on; and then use program-code to turn the power off – more on this next month. So, in summary, by using a custom acrylic chassis, the longer 30T tracks and a LiPo battery (along with the Adafruit booster/ charging module), we can replace the Zumo chassis with our own bespoke design. Building-blocks overview We explained above that to create the MRB, several new parts (mechanical and electrical) are brought together along with some existing MIWM modules. The way these building blocks work together is summarised in Fig.7. To make things a little simpler to follow, the diagram is laid out to mimic the actual physical locations on the robot itself. Fig.5. A typical 2-wire LiPo battery is both thin and lightweight making it suitable for our robot. Ensure a minimum capacity of 2000mAh, and that the leads are terminated in a 2-way JST connector as shown here. Practical Electronics | May | 2020 T FT Mod ule Fig.7 shows that the laser-cut acrylic chassis is used as a baseplate to which the following items are attached:  Two motors (Fig.8)  Two motor mounts (Fig.9)  Two wheel mounts (Fig.10) Fig.8. A Pololu micro metal gearmotor. The prototype uses a 6V, 75:1, LP, extended shaft (#2209). T rack 1 W h eel 1B LiP o battery Motor d rive r LiP o ch arger/ 5V booster P ower j ump er link W h eel mount W h eel mount P ower button W h eel 1A / 2A : d rivi ng W h eel 1B / 2B : auxi liary W h eel 2B Note that each building block falls into one of three distinct categories, colour coded as follows:  New elements associated with the acrylic chassis are shown in red (mainly the mechanics of the wheels)  New elements associated with the daughterboard are shown in blue (all the new electronics associated with power circuit, and the motor-driver)  Existing modules from the MIWM series are shown in grey. Motor 2 T rack 2 Fig.6. The Adafruit PowerBoost 1000C module contains all the battery management circuitry allowing a LiPo battery to power our robot. Motor 1 W h eel 2A W h eel 1A P iezo US B B oB B luetooth Mod ule B luetooth Mod ule MK C DM T erminal ap p Fig.7. Block diagram of the Micromite Robot Buggy. The chassis and daughterboard contain all the new parts, and also allows the MKC, and existing modules, to be plugged in.  Four toothed wheels and two tracks  Power button (Fig.12) (plus pull-down (Fig.4)  The daughterboard. resistor and power-link). These control the EN pin on the Adafruit module  Motor-driver module (Fig.13) (an H-bridge interface allowing motor control from the Micromite I/O pins)  Pins and sockets (Fig.14) positioned in a precise manner making it easy to plug everything together, as detailed here: Pins for the MKC and Bluetooth module to be plugged in (from below) Sockets for a MIWM module to be plugged in from above (such as the TFT module) A pin and socket pair for each motor (allows for easy assembly/ disassembly of the daughterboard from the chassis) Header pins for attaching the ‘SMD’ modules (Adafruit, motor driver, USB BoB). Incidentally, the first prototype of the MRB had the motors and wheels attached directly onto the stripboard (ie, mounted onto the daughterboard). However, there was too much flexing of the stripboard; it just didn’t have the required rigidity to keep the wheels in place and the tracks suitably tensioned. Hence the all-in-one chassis/daughterboard/stripboard idea was abandoned and replaced by the ‘chassis plus daughterboard’ concept. The daughterboard is a piece of stripboard (fixed to the chassis) with the following items/modules attached:  LiPo booster/charger module (the Adafruit Powerboost 1000C module) (Fig.6)  Micro USB BoB (breakout board – see Fig.11). This provides a conveniently located USB socket from which to charge the LiPo (via the Adafruit module) Fig.9. (left) Micro metal gearmotor (extended) bracket kit (Pololu #1089) and Fig.10. (right) Two M3 threaded mounting brackets are used to fix the ‘auxiliary’ wheels to the chassis. Practical Electronics | May | 2020 Comp uter All of the above will be discussed in more detail, but you should be able to make reasonable sense of the block diagram in Fig.7. Your existing MKC is being upgraded to having a set of wheels and a battery. The wheels will need to use four low-power I/O pins on the Micromite and these are connected to the input of a motor driver module. The motor driver then outputs the higher power required to operate the motors. The battery circuit also uses an I/O pin and this is used to switch the robot power off (with the pushbutton turning power on). All power functionality is managed by the LiPo booster/charger module which simply ensures 5.2V power is supplied to the robot from the rechargeable LiPo battery whenever the robot is turned on. To recharge the LiPo, a 5V charger can be plugged into the USB BoB. 55 Fig.11. (above) A USB BoB is utilised in order to conveniently locate the LiPo charging socket. Fig.12. (right) A miniature push-to-break button is used to turn on the LiPo booster and hence deliver power to the robot. Motors, wheels and tracks In Fig.7, you can see a pair of wheels, a silicone track and a single motor, positioned on each side of the robot. The two motors used in our robot are referred to as ‘micro metal gearmotors’ and as the name implies, they contain a gearbox (fixed ratio) made from metal – as shown in Fig.8. The gearbox gives the motor more torque than a standard motor – something that is useful in any robot. The motors operate from 6V DC, applied to a pair of contacts located on the nongearbox end of the motor (see Fig.15). As with any standard DC motor, reversing the voltage will reverse the spin on the motor. Note that in our design, we are driving the motor at approximately 5.2V, which is still enough to provide a decent amount of torque. Each motor is fixed to the chassis by means of a motor mount, as shown in Fig.16. One wheel in each pair is attached directly to the motor’s JP1 JP2 JS1 JS2 JP3 JP9 JP4 shaft and this is referred to as the ‘driving’ wheel. The other wheel is referred to as the ‘auxiliary’ wheel and is free to spin on a spindle (Fig.17). The spindle simply screws into a wheel mount (Fig.10), which in turn is fixed to the chassis. A silicone track is positioned around the pair of wheels with enough tension so that when power is applied to the motor, it turns the driving wheel, which in turn rotates the track around the auxiliary wheel (Fig.4). This setup is repeated on the other side of the robot to provide the traction for movement. Driving both motors in the same direction will result in the robot moving in one direction, and reversing the voltage to both motors will move the robot in the opposite direction. To turn (or rather, to ‘spin’) the robot, one motor is driven in one direction, and the other motor in the opposite direction. Reversing the voltages will cause the robot to spin in the opposite direction. Motor choice A point to bear in mind is that the quality of the motor is very important when used in a project such as this. If you do an online search for ‘micro metal gearmotor’, you will see that there are many variants to choose from, and prices will range from around £5 per motor, to approximately £25 per motor. A really good reference guide to these motors can be found on the Pololu website, so can I recommend that you take a look: http://bit.ly/pe-may20-pololu1 Choosing the wrong motor type will cause problems, so I will cover four highlevel points to help you choose right one: 1. These motors are available in two voltage options, 6V and 12V. Ignore the 12V ones – we need the 6V version. 2. Two shaft lengths are available, ‘normal’ (single shaft), and ‘extended’ (dual shaft). The extended type (see Fig.15) allow for a shaft encoder disc to be mounted on the back of the extended motor shaft (visit: http://bit.ly/pe-may20pololu2). The encoder disc (magnetic or optical) can then be used with additional JP5 JS3 JP6 JP7 JP8 Parts list and next month JS5 56 hardware (a sensor) to provide a stream of output pulses for each revolution of the motor. By counting the pulses, the number of revolutions can be counted and hence the speed of the motor can be inferred. This feature is not currently implemented in our design; however, we may add it at a later date. There is only a small price difference between the normal and extended shaft types, so we would recommend opting for the extended type. That said, the normal type is absolutely fine to use. 3. Four power variants are available: low (LP), medium (MP), high (HP), and high with carbon brushes (HPCB). This is the one parameter that really affects the price of the motor. We used the cheapest LP motors in our prototype and they worked just fine. However, the more power you can afford, then the more torque your robot will have. The carbonbrush option is not a requirement. 4. The gear ratio is the final (but most important) parameter to consider. You will see figures quoted between 5:1 and 1000:1. The lower the ratio, the faster your robot will move – however, its driver shafts will deliver less torque (or put another way, it won’t be able to move as much weight). The ideal ratio for our robot is somewhere between 50:1 and 100:1. In our prototypes we have typically used 75:1. The above has given you an idea as to what can be used, but if you’re a little overwhelmed with the number of choices, then I suggest using two: 6V, 75:1, LP or HP, extended (dual) shaft motors. LP or HP depends on your budget and/or the supplier’s availability. JS4 Fig.14. A complete set of connectors used in the robot buggy. Ensure you modify the connectors to match them as they are shown here. Fig.13. The motor driver module is based on the 2-channel DRV8833 H-Bridge IC. Fig.15. Close-up of the modified 4-way socket soldered to the motor contacts. Note the motor contact marked with ‘+’ needs to be to the left when in the motor mount. Here the ‘extended’ shaft can be seen protruding out the back of the motor. That just about wraps it up for this month. Next month, we will look at assembly and the electronics involved. In the mean time, have a look at Table 1 to see a complete list of all the parts required to build the robot chassis module. Most of the items are referenced to the various photos throughout this article to assist with identification and Practical Electronics | May | 2020 (a) (b) (c) Fig.16. Fixing the motor and motor-mount bracket (shown here mounted on an off-cut chassis). Left to right: a) Motor gearbox sits into slots; b) Place nuts into bracket ‘wings’; c) Screw onto chassis from the other side. assembly. The majority have already been mentioned already in the text; however, there are a few other parts required that will come up in the assembly guide. For example, some nylon nuts and bolts used for attaching the daughterboard to the acrylic chassis. You may already have some of the items in the list; if not, they should be easy Questions? Please email Phil at: contactus<at>micromite.org enough to source through the Internet. Online UK suppliers such as Cool Components, PiHut, Pimoroni, Hobby Components, and Rapid Electronics are worth visiting for the items that may be more specific (I have no affiliation with any of these – but I am a regular customer of them all thanks to the useful product range they stock). If you prefer a one-stop-shop, then as usual, micromite.org will offer various options including the custom laser-cut acrylic chassis. Table 1: Parts list for the robot chassis module. You will also need a length of wire to complete all the all wire-links (1m is enough) Qty Fig 1 Part No Fig.17. CAD drawing showing how to attach the ‘auxiliary’ wheel with the supplied spindle, washer, and nut. (Note: in our design, the generic blue ‘robot chassis’ shown here is actually the motor mount – see Fig.10.) Description Comments Fig.2 Acrylic chassis Laser-cut (from micromite.org) 1 Fig.3 30T track & wheel kit Tracks, wheels, spindles, washers + nuts (Pololu #3033) 1 Fig.5 LiPo battery Minimum 2000mAh (with 2-way JST connector) 1 Fig.6 LiPo charger/booster Adafruit PowerBoost 1000C 2 Fig.8 Micro metal gearmotor various options - see text 2 Fig.9 Motor mount kit Brackets, screws + nuts (Pololu #1089) 2 Fig.10 Wheel mount M3, metal (from micromite.org) MOD3 4 12mm M3 nylon screw 8 M3 nylon nut 1 Stripboard 50 holes x 36 tracks (typically 95mm x 127mm) 1 Fig.11 MOD2 micro USB BoB (from micromite.org) 1 Fig.12 S1 Push-to-break button Multicomp MC8MS8P1B06M7QES (from micromite.org) R1 10k 1 Fig.13 MOD1 Motor-driver module 1 Fig.14 JP8 2-way pin strip + jumper-link 2 Fig.14 JP1, JP2 4-way pin strip (modified) For motors 1 Fig.14 JP7 5-way pin strip For USB BoB 2 Fig.14 JP3, JP4 6-way pin strip For motor driver module 1 Fig.14 JP9 8-way pin strip (modified) For LiPo charger/booster module 1 Fig.14 JP5 13-way pin strip (modified) For connecting MKC/BT module 1 Fig.14 JP6 14-way pin strip (modified) For connecting MKC/BT module 2 Fig.14 JS1, JS2 4-way socket (modified) For motors 2 Fig.14 JS3, JS4 6-way socket For plugging in MIWM modules 1 Fig.14 JS5 14-way socket For plugging in MIWM modules 1 Practical Electronics | May | 2020 pull-down resistor DRV8833 (from micromite.org) 57