Share this page to your:
Mastodon

Main Board

There are two custom PCBs in the VM. The first I call the main board, the second is the screen connector board. I've designed both using Eagle and you can find my eagle files in github. The screen connector board connects to the ILI9341 touch screen and breaks out the screen connections for the main board, including the touch connections. The main board has everything else. Let's look at that first.

The main board supports a Teensy 3.2, SD card holder, battery, battery charger and the LSM303 compass and accelerometer.

teensy

On the lower left is the battery charger circuit and the power switch. The red and black wires lead to the LIPO battery. LIPO batteries like these ones come with a connector and my plan was to add a socket for that to the board. But it stood up too high so I ende up just soldering it directly. Make sure you have the power switch off when you solder or it will spark. The power switch is just below the SD card holder (the big silver thing in the middle). When it is off the unit is completely off, not asleep, and there is no power going to the Teensy. There is, however, power going to the Teensy's clock from the small watch battery. That means you don't have to set the time whenever you turn it on.

Just below the switch is an LED which comes on when the battery is charging and goes off when it is charged. You charge it by plugging into the USB on the Teensy.

I already mentioned the SD card holder. The SD card provides some space for writing logs and fetching images for display. This will be discussed in more detail in the section on software.

Just to the right of the SD card holder is the LSM303 which is our compas and accelerometer.

At the top of the image is the Teensy 3.2. Notice the green wire leading from one of the Teensy terminals down into the wires on the right? That is a 'green wire'. I couldn't get Eagle to make that connection on the PCB itself, it was tight for space, so this is a fix for that.

The wires on the right hand side are in two rows. The outer row goes to the screen and includes the touch lines, so that is everything the screen needs. The screen connector board has a similar row of connectors that line up with these. The inner row, just to the left of the outer row, has the connections for the control panel ie the two LEDs, speaker and wake button.

The Eagle files for this are in github and you'll find ordering info there as well in the Readme file.

To make the board, once you have PCB and all the parts, involves soldering the parts onto it. I've divided this into three steps. First you want to prepare your Teensy, then do the SMD work and then the Through-Hole soldering. Definitely leave the Through-Hole work until last.

Teensy 3.2

The biggest single component on the main board is the Teensy 3.2, and it is about the last thing you solder onto the board. However, it does need a little preparation. Before you do anything with it though, make sure you load a program into it. All you need is a USB cable, the Arduino software, and the Teensyduino software. The PJRC site (they make the Teensy) have good instructions and you'll want to read up on using the Arduino IDE. All the software is free.

teensy

This is the underside of the teensy I used. The first thing to note is the 32.768 kHz, 12.5 pF crystal just next to the A12 pad. The details about this are on the PJRC website. That link also covers the need for the coin cell battery. The crystal and the battery allow us to make use of the built in clock in the Teensy.

The next thing to note is that I have soldered wires to several of the pads on the underside of the Teensy. These lead to connectors on the main board. To be honest they aren't yet used, but it seemed a shame to solder the Teensy down and never be able to get to them. As well as the pads there are also several extra pins. You normally solder a strip of pins down each side on a Teensy and then it fits onto a bread board. This Teensy has the VUSB, AREF, A10 and A11 pins soldered as well. It means it won't fit on a breadboard any more, but this one is destined for our main board so that is not a problem. Actually of those four only the VUSB is being used so you can omit the others if you want.

Finally, while you can't see it in the picture, I have split the pads joining VUSB to VIN, as described best on the information card that comes with the Teensy 3.2. Breaking those two apart means the USB power can go to the battery charger circuit rather than directly to the Teensy, and the Teensy gets its power from the battery. Otherwise we'd have to walk around with a trailing USB cable, as it is we only plug into a USB outlet to charge the battery.

SMD

I hope you've already done some SMD soldering. If you haven't then don't start with this, try something simpler such as my little battery charger circuit. You can order that PCB from here:

Order from OSH Park

The reason I suggest this one is that it is quite useful and also fairly simple. It is uses similar parts to the main board too so it is good practice.

There are different ways to go about SMD work varies depending on if you are making lots of boards or one-offs. I only make one-offs and this is what I do: Get some solder paste and spread it on the copper pads using a toothpick and whatever visual aids you need. A magnifying headset is really useful, and something to hold the board steady. Then, using tweezers, put the SMD components into place. They are tiny, often not much bigger than pin heads. Make sure you have something to catch them if you drop them. Once they are all stuck on the board I put it on a hot plate. Heat it to about 200C and the solder paste will liquify. Carefully remove the board then and let it cool. Do this outside to avoid fumes and don't use that hot plate for cooking food afterwards.

Solder paste is like magic. Even if you have not been too careful where you put it the surface tension will make it move to the copper pads and off the spaces in between. There are some great videos of this happening. However, magic or not, you should do your best to remove excess paste in case there is so much it cannot separate. This is especially true for parts with lots of little pins. In this case that means the LSM303. The idea is to use the minimum amount of paste you can get away with.

So, if you don't know what you're doing that's how I do it, and you should get some practice on something simple, and watch some tutorials etc. If you do know what you're doing then read on.

The SMD components are the MicroSD, on/off switch, LSM303, a couple of power management chips and various capacitors and resistors. You'll find them all described on the Eagle files.

Through Hole

The Through Hole components all have pins or wires that poke through holes in the board. This includes the Teensy board and the battery, and the connectors along the edge. I originally expected to mount a socket for the battery and the 3.7 Lipo batteries all come with little plugs on their wires. But the socket was too bulky so I snipped the plug off and soldered it on directly. Make sure the power switch is off when you do this or you might get sparking if the battery is charged.

Scroll back to the image at the top and you will see a green wire running from Teensy pin 10 to the edge connector labelled RS. This ought to have been a copper connection on the main board but it didn't make it into the design for that so I use the 'green wire' technique to fix it (hence the colour of the wire). Also you can see the MAX30105 heart rate monitor soldered to the Teensy. The connections there are:

Make sure the wires to the MAX30105 are long enough, they need to reach around to the back of your wrist. A little too long is better than a little too short. I made mine about 20cm.

You also want to wire the coin cell battery to the VBat and GND on the Teensy.

Intial Test

Now is a good time to give your board a test. You'll need a separate screen for this, not the one you'll use in the final device.

TestScreen

The screen pictured is sold all over the place. It is an ILI9341 with touch panel. Be careful you get one with a touch panel. They are often sold as display only, ie without the touch capability, and they look just the same. That screen will plug into the connectors on the side of the main board and it should all work. However you don't want to solder the test screen onto the main board because it will be too hard to remove it later. This is what I did:

Connector

This is the main board you already saw with a ribbon cable of wires attached to the connector strip on the board. At the left hand end this is attached to a 2.54 female connector strip. These have hole spacing to match the pins in the test board. You'll see I have one long connector to handle the wires for the screen and a shorter connector to handle the wires for the control panel. The shorter connector is glued to the top of the long connector and I've added hot glue to the connections at the back to reduce mechanical strain on them. Don't worry too much about the shorter connector just yet. You want to verify that the screen is all working.

Although attaching the ribbon cable is technically a through-hole soldering job, I find it better to not poke the wires through the holes in this case. This is because they are stiff and they will want to turn the ribbon cable the wrong way later. Just lay the wires flat on top of the holes and solder them like that. The connection is not as strong but it won't fight you when you assemble this thing later.

The best way to do an initial test is to use the Arduino IDE to install the ILI9341_t3 library and then load the samples from that and see if they run. This library is optimised for Teensy 3 boards to operate the screen. There are several samples eg graphicstest and touchpaint and these should just work

Summary

This covered the main board, where to order it and how to build it. You'll have prepared your Teensy board, done some SMD soldering and some through-hole soldering as well as attaching the ribbon cable to the main board. Then you plugged a test board into the connector and loaded one of the sample programs into the teensy to verify everything works.