### 03 Building the AirPi

#### Raspberrypi Tutorials

In this section you will find step by step instructions for building the airpi board. If your board is premade you don't need to read this section - jump to the airPi software section.

BEFORE YOU START - SAFETY FIRST - DON'T DO A THING UNTIL YOU READ THIS

This project will involve soldering of small components. You may get burned, make sure your work area is clean and well ventilated and make sure you use goggles or appropriate safety eye wear. THIS IS REALLY IMPORTANT. If you don't know how to solder we can organise to either show you (if you are year 5 and above or in secondary school) or do it for you if you are younger than that.

You could get someone you know to solder the board for you - if so make sure you thank them and include them in your blog.

As we said the parts are small so don't lose any, breathe them in or eat them - they don't taste nice and you need them all. Follow the instructions carefully. Check and recheck all of your connections, solder joints and parts placements.

Some parts are polarised that means they can only go in one way. Put them in backwards and the thing will not work or worst case the RaspberryPi will be destroyed along with your hopes of Zombie supremacy. Remember check and recheck.

The Circuit Diagram:
Here is a copy of the complete circuit diagram on the version we are going to build. Note on the web there are some different ones use this diagram.

Parts List
Note that we will not be using all go the components. The parts list is here:

AirPi Parts List
Part Number Value Required Status
R10 680K Yes Ok
R11 10k Yes Ok
R12 10k Yes Ok
R13 620R or 520R Yes Ok
R14 620R or 520R Yes Ok
R3 22k Yes Ok
R8 1M Yes Ok
R9 13k Yes Ok
C2 .1uF Yes OK
SK1 16 Pin IC Sckt Yes OK
SK2 8 Pin IC Sckt Yes Ok
D1 UVI-01 Yes Order
J5 BMP085 Yes Order
LDR1 LDR Yes Ok
LED1 Red Yes OK
LED2 Green Yes OK
U1 MCP30081 Yes Ok
U3 TGS2600 Yes Order
U8 MCP6283 Yes Ok
U7 DHT22 Yes Need 5
Bolts x3 3mm Yes Ok
Spacer x 3 15mm Yes Ok
J2 GPS No
R4 66R No
R5 10k No
R6 82R No
R7 100k No
U4 MICS-2710 No
U5 MICS-5525 No

The parts in green are NOT going to be used.

MAKE SURE YOU HAVE ALL OF THE PARTS IN YOUR KIT

if something is missing email spotlight16@dow.catholic.edu.au

The video below shows the full build process. It is quite long and the sound not very good but it is worth looking at. You may want to skip through it.

Step 1        Do all of the LOW FLAT parts this includes:

R3, R8, R9, R10, R11, R12, R13, R14. Note here a couple of things. The circuit diagram has R10 as 4.7M we are using 68K it also has R9 at 22K we are using 13K. Why is this? It is all to do with the UVI sensor. From it's data sheet we see that for a 1M resistor across the detector the output is 0v - 60mV for a UVI of 0 to 15. So what? Well consider the analogue to digital convertor it is going to measure voltages from 0 to 3.3V (thats the way it has been set up). In order to get the most detailed reading on the ADC we need the input voltage to be near the 3.3V it can read (in the video I say 3.8 V but I meant 3.3v). To do this the designers used the little op-amp (MCP6283) to amplify the voltage.
The gain of the amplifier is set by R9 and R10 using the formula  $\inline&space;\bg_white&space;gain&space;=&space;1&space;+&space;\frac{{R_f}}{R_i}$ so with the resistors they had specified gain would be 4.1M/22K + 1 = 214 or so. In this case lets imagine the UVI probe is detecting a 15 day. The probe will be putting out 60mv or to put it another way 0.06V so the output of the amplifier is then 0.06 x 214 = 12.8V way to much for our ADC. If we use the resistors specified here the gain is 1+ 680k/13k = 54 or so. So on that same day the output of our amplifier will be 0.06 * 54 = 3.19V which is pretty close to the 3.3V the ADC can read.

Why did we pick 680K and 13K - the answer is these values were easy to get and the ratio was pretty close to allowing the ADC to operate over the whole 3.3v range.

You will also notice that R13 and R14 are 600R (R means ohms) but we couldn't get these so we put in either 520R or 620R depending on what we could find.

None of these parts are polarised so they can go in each way round but it looks cool if you put them all in the same way.

Step 2        Do the next highest parts including all the parts from C2 (there is no C1)  to LED2.
C2 is not polarised and can be placed in any direction good practice would have you put it in so the marking on the body can be seen.

SKT 1 and 2 are IC sockets and they ARE polarised make sure you put them in the right way round. The notch on the socket must line up with the notch on the PCB!

D1 is polarised make sure you put the long leg in the PCB hole marked with the (+). This is really important. You can mount this flush with the board or use a spacer like paddle pop stick or piece of cardboard to set the UV sensor height from the board.

J1 and J3 are not polarised. However to install J1 you need to get it at the right height. To do this follow the instructions in this video:

J5 is part of the BMP085 pressure sensor. Make sure you set this up so the 3.3v pin lines up with the right most pin on the PCB.

Next is the LDR note that this is not polarised but you may want to set it at the same height as D1. If so use the same spacer to set the height.

Finally we have LED1 and LED2. These parts are polarised make sure you put the long leg in to the PCB hole marked (+) otherwise it will not work. Again you may want these two at the same height as D1 and LDR. If so use the spacer again.

Step 3         Finally put in the tall parts
Now put in the tall parts. Start with U3 and U7. Both of these are polarised so make sure you put them in around the right way! Do NOT put in the ICs U1 and U8 yet! We need to test the board first.

Step 4        Test, Test and Test
Ok now we need to test the board.

Test 1 Visual Inspection:
make sure you look at ALL of your solder joints. Make sure there are no bridges or open joints (dry joints). If you find any just heat them up with the soldering iron to fix them.
Make sure your polarised parts are in the right place!

Test 2 Electrical Test.
Without the ICs in place, plug the airpi on to the raspberryPi (make sure it lines up properly) and boot the raspberryPI.

Use a multimeter set to volts and check:

SKT1:
There is 3.3V between Pin 16 and Pin 9 on SKT 1. Check to see that there is 3.3V between Pin 15 and Pin 9 on the same socket.

SKT2:
Check that there is 5V between pin 7 and pin 4 on SKT2.

Step 5        Insert the integrated circuits and plug it in to the pi

Once you have done the tests from step 4 and all is ok, switch off the pi and plug in the ICs. Remember they are polarised so they must go in the right way round!