Electrical Assembly

Gather Materials 

Gather the materials below and get ready to build the PCB for the Thimble WiFi Light Switch!

Introduction
This short video introduces the Thimble WiFi Light Switch.

Parts

All Parts
All Parts
WiFi Light Switch PCB
0.1μF Ceramic Capacitor
Diode
40 Pin Male Breakaway Header
2x4 Female Socket Header
1x6 Female Socket Header
10kΩ Resistor Pack
Small Tactile Button
Large Tactile Button
3.3v Regulator
ESP8266 Module
MOSFETs
10kΩ Resistors
10μF Electrolytic Capacitors
PartQuantity
WiFi Light Switch PCB 1
0.1μF Ceramic Capacitor 1
Diode 1
40 Pin Male Breakaway Header 1
2x4 Female Socket Header 1
1x6 Female Socket Header 1
10kΩ Resistor Pack 1
Small Tactile Button 1
Large Tactile Button 1
3.3v Regulator 1
ESP8266 Module 1
MOSFETs 2
10kΩ Resistors 2
10μF Electrolytic Capacitors 2

Your kit will also include two spare capacitors that aren't attached to brown paper.

Tools you'll need

Soldering Iron
Solder
Flush Cutters
Screw Driver
Pliers (optional)
Solder Sucker (optional)
Multimeter (optional)
Electrical Assembly
This video walks through the complete electrical assembly of the WiFi Light Switch Kit.

Resistors 

It may help to bend the leads of these components into a U shape before putting them in the PCB.
Place the two 10k resistors through the bottom left of the PCB and bend the leads back to hold them in place. Resistors have no polarity; you can put them in either direction.

Install the 10k Resistors
Install the 10k Resistors
Install the 10k Resistors
Solder
Clip the leads
Clipped leads

Diode 

Place the diode through the holes marked D1; found above the reset button.
Make sure the black line on the diode matches the line on the PCB.
Unlike resistors, diodes limit the flow of electricity in one direction, if you put the diode in the wrong way the circuit will not get power!

Install the diode in the correct orientation
Install the diode in the correct orientation
Solder the leads
Clip the leads
Clipped leads

Reset Button 

Place the Adruino reset button in the hole labeled SW1.
The pins of the button are shaped to grab onto the PCB when it is fully inserted.
Push the button through until the button sits flat.

Install button
Install button
Solder the leads
No need to clip the leads once soldered

Resistor Pack 

A resistor pack is a group of resistors, in this case they all share the same connection to ground. This is usually done to save space. It is important to note: unlike the single resistors we put in earlier, resistor packs have a direction and will not work if soldered in backwards.
Put the resistor pack with pin one (marked with a dot) in the square hole. The markings should be facing towards the thimble logo just above.

Install resistor pack like this with the dot above the square hole
Install resistor pack like this with the dot above the square hole
Make sure the text faces the Thimble logo
Solder the leads
No need to clip the leads once soldered

10μF Capacitors 

There are two types of capacitors in this kit: Electrolytic (the can shaped black ones), and Ceramic (the little yellow ones). The 10μF Capacitors marked on the PCB are electrolytic and therefor polarized. This means that the direction does matter when installing them.
Place the negative lead (the shorter one) of the 10μF capacitor through the round hole marked with silkscreen on the PCB. The section of white silkscreen should match the negative line on the side of the capacitor.
Do the same thing for the other capacitor at the top of the PCB.

First 10μF Capacitor
First 10μF Capacitor
Second 10μF Capacitor
Solder the leads carefully
Clip the leads
Clipped leads

0.1μF Capacitor 

Next install the single yellow 0.1μF ceramic capacitor at the top of the board.
Ceramic capacitors are not polarized and will work in either direction.

Ceramic Capacitor
Ceramic Capacitor
Solder the leads carefully
Clip the leads
Clipped leads

MOSFETs 

The ESP8266 (WiFi module) was designed for 3.3v, and not the 5v data lines coming from the Arduino. To protect it, this circuit uses two 2N7000 N-channel MOSFETs; one for Transmit, TX and one for Receive, RX.
MOSFETs are like a door that uses one voltage to control another. On one side of the door is 3.3v, on other side is the ESP. The 5v signal from the Arduino is what opens and closes the door.
When the Arduino data line is off (0v) the door is closed and the ESP does not get 3.3v data. When the Arduino output goes high (5v) it opens the door for the 3.3v to go to the ESP. This same principle is also used to allow low power devices to safely control high voltages too.
For a more in depth explanation on how MOSFETs work, check out this video by Afrotechmods.

Install the two Mosfets in the holes marked Q1 and Q2, making sure the line up the flat side of the MOSFET to the flat line of the silkscreen.

Line up the flat side with the flat part of the silkscreen
Line up the flat side with the flat part of the silkscreen
Install the second MOSFET the same way
Solder the leads
Clip the leads
Clipped leads

Voltage Regulator 

The 3.3v regulator has three pins, Input, Output, and Ground. Its job is to take 5v input from the Arduino and safely lower it to 3.3v for powering the ESP.
You might be wondering why we can't just use the 3.3v output that the Arduino already has? The reason is while most Arduinos can supply 3.3v, they can only do so for low power devices. In this case the ESP uses more current than the Arduino's 3.3v regulator can provide.

To install the 3.3v regulator carefully bend the leads with some pliers, or the edge of your PCB, to a 90 degree angle. Insert your voltage regulator so the large metal side faces down.
Make sure the metal tab doesn't cover the row of holes along the bottom of your PCB.

Bend the pins at a right angle like so
Bend the pins at a right angle like so
Install with the flat metal side facing down
Make sure the solder joints are nice and strong
Clip the leads just above the solder joint
Clipped leads

Arduino Headers 

Cut (or snap) the following segments from the 40 pin strip of male headers:
One segment of 8 pins
One segment of 6 pins
Two segments of 3 pins

The grooves between each pin will help you cut or snap the headers off cleanly.
There will be some leftover if you accidentally cut the wrong number.

One segment of 8 pins
One segment of 6 pins
Two segments of 3 pins

If you look closely at the row of holes along the bottom of the PCB and you will notice they don't line up perfectly. This feature was added to help hold the header pins when soldering by applying slight pressure to both sides.

Insert the 8 and 6 pin segments on the bottom row of holes and solder them in:

Install the 8 pin header into the PCB
Install the 8 pin header into the PCB
Install the 6 pin header into the PCB
Solder the headers, making sure they are straight

Install the two 3 pin segments into the rows marked Servo 1 & 2 and solder them in:

Install the first 3 pin segment into the Servo 1 holes
Install the first 3 pin segment into the Servo 1 holes
Install the second 3 pin segment into the Servo 2 holes
Solder the headers in place

When you're done, your PCB should look like this.When you're done, your PCB should look like this.

Big Button 

Align the big button with it's mounting holes labeled SW2, just like the Arduino Reset button you installed earlier. This button features two guide pegs that fit into the PCB to align it correctly.

Install the big button
Install the big button
Solder the leads
Soldered

ESP Socket 

Install the 2x4 female socket into the top left corner of the PCB labeled ESP.

Install the ESP Socket
Install the ESP Socket
Make sure all the pins are soldered to the PCB
Soldered

ESP Breakout 

Optionally, you can install the ESP breakout header in the top right of the board.
This offers connections to the ESPs two GPIO outputs as well as data and reset lines. This can be very helpful for flashing new firmware onto the ESP but is not required to use this kit.
Your ESP comes pre-programmed with firmware version 1.5, which is required for this kit.

Install the ESP breakout header into the top right of the board
Install the ESP breakout header into the top right of the board
Solder the pins
Soldered

Test your PCB 

You're done with soldering the PCB.
Make sure you haven't forgotten any parts, and that you only have the two spare capacitors left over. Check over all your solder joints to make sure they are clean and strong.

To test the quality of your work plug in the ESP and a servo like so:

Wire color Function
Brown Ground
Red Power (5v)
Orange Data
Line up the pins of the ESP
Line up the pins of the ESP
ESP installed
Plug in the servo

Attach the Arduino to the Light Switch PCB by lining up the analog and power headers to the pins on the bottom of your PCB:

Give your Arduino some power from a computer and you should see the ESP power LED light up as well as hear and see the servo move to it's default position.
If not, go back through the assembly steps and check that you haven't forgotten anything, and that all your components are installed correctly. If you're still stuck, have a look at the Troubleshooting section for some solutions to common mistakes.

Discussion and Comments for the Electrical Assembly block