HOPE Lab: Microbug

Check out the HOPE instructor's blog page about the microbug for a better understanding of what it does!

read it up before starting the lab!

CURRENTLY SOME IMAGES ARE BROKEN.

microbug blogpost

Lab Instructions


We’ll be beginning a new multi-week (4 weeks specifically) lab for doing the schematic and layout of a small programmable robot. Here’s a video of a robot very similar to the one we want to make (just ours will be based around a nice PCB).

Below is a basic block diagram of the robot; we expect your schematic to somewhat resemble this (but you don't need to draw wires between the blocks if using labels is neater).

We expect to see these main “blocks” in your schematics:

  • A microcontroller block (micro and power filter passives).
  • A motors and motor controller block (and power filtering passives).
  • A sensing block (the reflectance sensors and its passives)
  • An LED block (LEDs and their passives)
  • A programming header block
  • A power block

microbug block diagram

For the basic parts we’ll be using these:

Part Detail
Microcontroller ATtiny1616, the brains that will actually control the motors and read the sensors and make decisions
Reflectance Sensors QRE1113GR, for seeing changes in brightness underneath it, like for following a line
3x LEDs as indicators/blinky lights back to the user
Battery CR2032, you’ll need to choose a battery holder and maybe need to make a custom footprint based on the datasheet
Motor Driver TC78H651AFNG, to be able to supply high currents to the motors; why can’t we just directly drive the motors from the microntroller’s pins!
Motors To move around; just use a generic motor symbol for now in schematics, for layout you’ll need to later make a footprint that we will give dimensions for.

Supporting passives and other connectors will be up to you to find. If you aren't sure what some passives values might need to be, or what sizes seem reasonable, ask us! Not sure what filtering really means? Again, feel free to ask!

When you are finding the parts, don't forget to record them in a BOM!

Motor Footprint

The motors are these tiny DC motors from some seller on ebay. Note that we remove the square shell in assembly, hence the circular cutouts in the board.


micro motors

The pads are the squares, and dimensions are in mm. Add additional appropriate footprint layers.


motor footprint dimensions

Complete the layout


You are provided with the board outline, which comes as a .dxf file. IMPORT THE BOARD OUTLINE BEFORE PLACEMENT OR ROUTING.
We highly, highly suggest searching up the datasheets for the parts we choose to understand what they are supposed to do, and faciliate part placement and orientation in relation to the board outline. Not all part placement rules are specificed below. Understanding how things should be oriented is part of the lab. For example, take a look at the battery cell holder on Digikey.

  1. Make sure it falls under BAC's standard capabilities just like in your last design (USB Charger lab).
  2. You are allowed and encouraged to use both sides of the board.
  3. Standard 2 layer board. You are not allowed to design with more than 2 layers.
  4. You MUST use the provided board outline and component footprints.
    • Exception: you are allowed to change the footprints for the 2 LEDs not being used as the rear caster.
  5. Try to minimize the number of vias used. A suggested maximum is 20.
  6. One of the LEDs must go on in center of the back of the board, facing downwards. It acts as the caster for the robot.
    • All pin headers should be facing up.
    • The other two LEDs should be visible from the top of the PCB.
  7. The two light sensors must be facing downwards on the left and right sides of the caster LED in the back. They are meant to be used as sensors for line following.
  8. Motors must be mounted at the two cutouts at the flat "head" end of the board. You should try to align the center of the pads as nicely as you can with the rounded cutouts. Take a look at the gif to get a general idea of how the motors are expected to be mounted. Note that the motors the board outline was made for are round.

proto-bug
  1. Add the IEEE logo (provided as a bitmap image) somewhere on the board with a reasonable size. Instructions below for how to create footprint from bitmap. As with all silkscreen elements, do not have it overlap pads, board edges, or other silkscreen.
    • We also highly suggest adding additional silkscreen to label important connections). One connector is meant to be used with a jumper, can you figure out which one it is?

Checkoff: We're going to be checking for all of the above, in addition to a completed layout with no DRC errors, and BAC InstantDFM report.

Important (and late) note: There is one unconnected error that we expect to be in your completed board layout. Hint: look at the datasheet for the battery holder.

How to Import the Board Outline

Download the board outline from here. If you cleverly set your grid size you can get things to line up nicely using the properties panel.

  1. In the Pcbnew layout editor: File -> Import -> Import Graphics. Then select the microbug_body.dxf. Change the graphic layer to "Edge.Cuts" then click OK.

importing outline
  1. Click to set down the imported board outline. It should look like so: (placement arbitary, only to show proper imported size)

importing bitmap in the bitmap to component converter

How to flip parts to the other side of the board

The rear caster LED is required to be facing downwards along with the two light sensors, and we suggest having the battery holder on the bottom as well.

Note: Text SHOULD BE mirrored when on the back.

  1. Hover over the part you want to flip to the other side of the board, then press F (or Right-Click -> Flip).
  2. That's it. Notice how the colors of the footprint silkscreen changes from the color for the top to the color for the bottom.

flipping parts

How to insert images

Silkscreen art? Copper art? Just, boring logos?

  1. In the main KiCad project window, find the Bitmap to Component Converter (looks like a lowercase 'a' being measured).
  2. Click "Load Bitmap" and select the desired bitmap. For this lab, the "ieee-logo.bmp" should be in folder named "logos".

importing bitmap in the bitmap to component converter
  1. Note that the imported image is huge (146.6mm by 146.5mm). You can resize by:
    1. Making the image smaller externally, like in Photoshop or something.
    2. Change the Resolution (in Bitmap info, right above the "Load Bitmap" button). Increase the values to have the resulting footprint appear smaller, and reduce to make it bigger. DPI stands for "dots per inch".
  2. Keep format in Pcbnew (you're going to make a footprint object essentially), and select "Front silk screen" in the "Board Layer for Outline" section.
    • If want to do exposed copper art, you should use the "Front solder mask" option. Don't do this for this lab.
  3. Click the "Export" button and save the footprint (.kicad_mod) file into the "microbug-fplib.pretty" folder in the project directory.
  4. Import the footprint directly in Pcbnew, or add a placeholder, no-pin symbol in the schematic and assign as footprint.

adding image as footprint