Microcontroller Trainer Rev 3

From Blue Smoke Monster - The Wiki
Jump to navigation Jump to search

Welcome to the Microcontroller Trainer Rev 3 wiki page.


Project Update

We are currently enhancing this design, and will be releasing version 3 in q1 or q2 of 2021. We still have kits available for version 2, and will have upgrade packages available for people who want to move to the version 3 kit, so please don't let this discourage you from getting the rev 2 board - we have an upgrade path (at a discount) for you when rev 3 is released - tons of the hardware components will just move to the new board. Check out the Rev 3 project page here. This revision is currently UNRELEASED but much of the design applies to the Rev 2 board as well.

Project Background

The purpose behind this creation is simple - clean up my desk (while so far it's failed at ACTUALLY resulting in a clean desk, it has been super useful). I do a lot of electronics prototyping and experimenting, and most often my various projects use the same types of elements every time - displays, blinky lights, rotary encoders, etc, although from time to time I bounce around from microcontroller to microcontroller, depending on what might be best suited for a given project. Rather than constantly having to try and find all of these things, I decided to design a PCB around them, so they were always 'at the ready' and 'center of workbench'. This project is the result of that work.

Disclaimer

I'm a hobbyist. The trainer board was originally designed for my own use - I never intended to kit it, so there are a few things that are still a little rough around the edges. I didn't worry about sequential naming of all of the components, there are a couple silly silkscreen mistakes, I didn't optimize the power supply design, and there are a few quirks - but all in all, it's a super useful project, so I'm making a few kits available to share it with people. I may continue to make improvements in the future, but for now I'm mostly leaving it 'as-is' - it works.

When you open your kit, you should inventory the parts. The following bill of materials includes information on the parts that are included.

Bill Of Materials

Note: This BOM is not up to date for the rev 3 board. Stay tuned for enhancements.

Part Quantity Description
BB1 1 BB830 Breadboard
OLED 1 .96" OLED
ESP32 1 ESP32 DevKit C
TFT 1 2.4" Touch TFT
BC05 1 BC05 Bluetooth Module
DC-JACK 1 DC Barrel Jack
REG1 1 LM317 Voltage Regulator
REG2 1 LM317 Voltage Regulator
NANO 1 Arduino Nano V3
S1,S2,S3,S4 4 Momentary Pushbutton Switches
WS2812B 4 RGB Serial LED
ESP01 1 ESP01 Module
ENCODER1 1 Rotary Encoder with Knob
ENCODER2 1 Rotary Encoder with Knob
MHEAD 5 Male Breakaway Header
PCB 1 Trainer PCB
C1 1 Electrolytic Cap 470uF
C2,C3 2 Electrolytic Cap 10uF
C4,C5,C33,C36 4 100nf Capacitor (.1uF)
OLD - NO Longer Using These Values for C33,C36 2 1uF Capacitor (1uF)
Various Various Female Pin Headers
Various Various Male Pin Headers
D11,D12,D13,D14 4 Diode
WIRES 1 Dupont Jumper Assortment
R45 1 750 Ohm Resistor
R44, R46 2 240 Ohm Resistor
R47 1 390 Ohm Resistor
R1,R2,R3 3 330 Ohm Resistor
Rev3 PCB Work In Progress


Theory of Operation

The board was designed to be powered by the DC Barrel Jack, which can accept 9-12vDC input. (The silkscreen says 6v, but we've noticed that 6v may be just a tad too low to get the desired 5v output. 9v seems more reliable.) The DC input is regulated down by REG1 to 5 volts. This is our 5 volt rail. Our 5 volt rail is then regulated down to 3.3v by REG2. This was a design compromise to keep the input voltage of REG2 as low as possible. It also allows you to have two voltage rails (5v and 3.3v) while supplying the PCB only a single voltage source. Many of the supplied microcontrollers can be powered by their USB connector and back-power the 5v rail of the PCB. Note: If you apply power to the 5v rail, you will get both 5v and 3.3v output voltages, however if you try and back-power the 3.3v rail, both the 5v LED and 3.3v LED will light, due to the protection diode on the voltage regulator, but this is an erroneous reading. Do not attempt to back-power the board with 3.3 volts, you'll get a 3.3v rail, but your 5v rail will not be functional. Future design enhancements may address this.


Assembly

Surface Mount Parts

There are several surface mount parts on the trainer board. They can all be hand-soldered, or you can use your favorite SMD assembly method, be it hot air, hot plate, reflow oven, etc.

WS2812B

Parts Required: RGB1,RGB2,RGB3,RGB4

Note: New kits have started to ship with SK6812s rather than WS2812b's.

We begin assembly with the WS2812B LED's. You can use either a surface mount soldering technique, or just a soldering iron with a fine tip to solder these LEDs. I would recommend a little bit of tacky flux to help your soldering process, and to hold the part in place as you solder it. Be sure to orient the LEDs as show in the photo here. Personally, I use a hot air gun, but you have to be careful not to overheat the LEDs or they can melt or fail. WS2812B's are fussy little devices. The can absorb moisture in storage and fail during soldering, they can spontaneously blow during use, and can just be an all around fussy beast... but I still love them. If by chance you destroy one during assembly, don't worry, they're easy to replace and they're cheap and readily available. Rumor has it that the clones are a bit more reliable, so you might even be so inclined as to throw away the included WS2812B's and source your own SK6812s instead. R1 is installed (330 Ohm) as a current-limiting resistor on the data line of the LEDs to help prevent failures due to overcurrent on the data line.


Article on WS2812B vs clones


WS2812B Placement

Next we will assemble the power supply section. The power supply is made up of two (2) LM317 voltage regulators, a few capacitors to smooth the DC, and a few resistors to set the output voltage. Capacitor footprints are through hole for easy soldering, while resistor footprints support either through hole or 0806 surface-mount parts. Power is supplied through a 2.1mm DC Barrel Jack. Each LM 317 can supply roughly 500ma of current, so avoid exceeding the rated power or you may damage an LM317. The trainer board is designed with this in mind, and you only connect power to things you're actually using.

Voltage Regulators

Parts Required: REG1,REG2

Install the voltage regulators (REG1, REG2). They are both LM317's and either regulator can be installed in either footprint.

Diodes

Parts Required: D11,D12,D13,D14

Install the diodes (D11, D12, D13, D14). When installing the Diodes, the cathode (end with the stripe) should orient towards the bottom of the board. The diodes are used as part of the voltage regulator circuits and are all the same. Values/markings may vary.

Through Hole Parts

Resistors

Parts Required: R1,R2,R3,R44,R45,R46,R47

Install the resistors next. The board supports both through hole or 0805 SMD resistors. I include through-hole resistors when you buy the trainer in kit form from me. R1 is a 330 ohm resistor, and is used in conjunction with the RGB LEDs in order to limit current on the data line. R2 and R3 are also 330 ohm resistors, and are used to current limit the red power rail LEDs. R44 (240 ohms), R45 (750 ohms), R46 (240 ohms), and R47 (750 ohms) are used to set the output voltage of the LM317 regulators.

Power Supply Section

Ceramic Capacitors

Parts Required: C4,C5,C33,C36

You should now install the capacitors C4, C5, C33, C36. These are non-polarized, .1uf, (marked 104). Stand them on end as shown in the power supply photo.

Mounting Axial Capacitors

Note: In older boards (Before 07/2020), I used 1uf Capacitors for C33, C36. If your kit shipped with qty 4 .1uf's, use .1uf capacitors in place of the 1uF Capacitors. It really doesn't matter much for the purpose of these high-frequency filtering capacitors between the two values, but by moving to .1uF for both I can reduce the parts count. OLD Instructions said : Next, install the capacitors C33, C36. These are slightly larger than the two you just installed. These are also non-polarized, and 1uf (marked 105). Stand them on end, the same as C4 and C5. I prefer end-mounting axial capacitors like shown. Alternatively, this same footprint could support other types of ceramic capacitors - we have some flexibility in the design here.

LEDs

Parts Required: LED1,LED2

You should now install the red power rail LEDs. Orient the LEDs with the short lead towards the top of the board. Newer revisions of the PCB will include a + marking to indicate polarity more clearly.

Pushbutton Switches

Parts Required: S1,S2,S3,S4

Install the push button switches next. Be sure to press them tightly against the board while soldering so that they will sit flat.

Electrolytic Capacitors

Parts Required: C1,C2,C3

I would now install the electrolytic capacitors C1, C2, and C3, paying close attention to polarity. We don't want them exploding now, do we? The smaller two are 10uF and go into C2 and C3, the larger is a 470uF and goes in C1.

This is a great time to test the power supply section, before you solder anything else onto the board. If you plug the power supply in (9-12v DC is perfect) you should have two glowing LEDs. These are power indicators for the 3.3v and 5v rails. If they don't light, troubleshoot and fix the power supply section before continuing on. Using the on-board power supply is purely optional. You can back-power the board from your favorite microcontroller, or source voltage directly to the power rails on the breadboard, and wire it to back-feed the board. Heck - you don't even have to build the power supply section if you're going to do this, but I would recommend at a minimum installing C1, C2, and C3, regardless of how you power the board.

Headers

Parts Required: Male and Female Headers - Cut / Snap to size as needed

Use headers where you want to, or omit them, the choice is yours. The headers with the jumpers will go up on the OLED, both for pin assignment selection, and voltage selection.

The headers come next. The headers above and below the breadboard are the most difficult to align, but I have an assembly tip to help you along. They are aligned vertically on a 2.54mm grid, so you can use the extra 40-pin female header as a 'helping hands' to cluster them together during installation, which keeps them parallel and aligned.

Installable Modules

Parts Required: 2.2, 2.4, or 2.8 TFT,OLED,ENCODER1,ENCODER2,NANO,ESP32,ESP01,HC-05

You can install the remaining modules in whatever order you prefer. This includes the displays, the microcontrollers, and some accessories.

The trainer board is designed to allow support for 3 different popular TFT displays: 2.2 inch without touch, 2.4 inch with touch, and 2.8 inch with touch.

Supported TFT Displays

The pin configuration for the TFT and touch section are the same on all 3 boards, however the way they will fit on the board varies slightly. The footprint shown on the PCB itself is designed around the 2.4 inch with touch, but sometimes these can be hard to source. You can plug in the 2.2 and 2.8 inch versions as well, but the SD card connector won't line up, so keep that in mind. Your kit may have come with any of the 3 screen options, but I try to ship the 2.4 inch version when I can get them. Newer board revisions will eventually include footprints for the 2.8 and 2.2 screens as well.

2.2 Inch TFT
2.4 Inch TFT with Touch
2.8 Inch TFT with Touch

Depending on the HC-05 bluetooth module shipped with your kit (or sourced yourself) , you may find different orientations of the headers. You can either leave the right-angle headers on the boards and let the bluetooth module stick up towards the sky, or you can remove the right angle headers (carefully) and replace them with straight headers for a flush mount. It's a quick and easy task to snip the headers off, de-solder them, and attach new headers in whatever orientation you prefer.

Schematic

The following schematic is a 'work in progress' view of the Rev 3.0 design. A final schematic will be posted as the project revision matures.

Rev 3 Schematic (Work in progress)


Demo Code

I'm currently developing demo code for the board to make testing after assembly easy, and I'll post it for download when it's ready. Most of the community libraries and techniques work, so you probably already have better demo code than I'll write :)


Errata

None, Yet ;)