Building a Wi-Node - in Words and Pictures
Guide created and maintained by: Ian Chilton - please direct any suggestions or corrections to: ian [at] ichilton [dot] co [dot] uk.
If you get stuck, there is a Nanode Mailing List and an IRC channel - #nanode on irc.freenode.net.
The Wi-Node can be used in two modes - either as a shield (or backpack) for an existing Arduino/Nanode or as a standalone node.
It's the standalone node we will be building here. We will build the basic node and then add optional additional functions and the components required for each. A separate Wi-Node Backpack Guide is available for users wishing to build as a shield to fit to an existing Nanode 5.
If you are not familar with the Nanode, see my blog post introducing the Nanode and my blog post introducing the Nanode RF & Wi-Node.
To sumarise, the Wi-Node is an Arduino compatible board with RFM12B wireless, SRAM, Micro-SD card and a motor driver.
I am maintaining a a page of useful Nanode links which are worth keeping an eye on as there is information like pin usage and pointers to useful code and libraries.
Some other useful information:
Layout and identify the components from the kit.
The exact kit contents will vary depending on which kit you bought and any optional extras purchased.
Here are the components required to build the base node, plus wireless:
From Wi-Node Build |
From Wi-Node Build |
On top of those, additional components can be added to provide additional functions - as sketched out here:
From Wi-Node Build |
Note, there is an error in the above photo - the block of 4 resistors at the bottom right (R8, R9, R2 and R4) are labelled motor, but are actually for the analogue inputs. I'm also missing C12 and C13 labels at the bottom right. New version will follow.
The green highlighted components are those listed above and are needed to build an Arduino like bare Wi-Node board.
We can also see from this what components are required for each of the optional components:
It's worth noting the operation of the 3 resistor networks:
Ok, we're ready to start. Here is the PCB ready:
From Wi-Node Build |
Start with the resistors. Bend each leg of the resistor over 90 degrees, right next to the body. The last colour on all of the resistors is brown - it's recommended that you align them all in the same direction and have the brown at the same end.
First we add the 10K resistor - it's colour code is Brown, Black, Black, Red. It's at the left hand side above the reset switch.
From Wi-Node Build |
Add the 100R resistor - it's colour code is: Brown, Black, Black, Black. It's at the right hand side of the board at the top of the row of resistors.
From Wi-Node Build |
Add the 1N4148 diode - this protects the programming interface from any current from an external power supply. It's at the bottom of the board, to the right of the reset switch.
Add the four 100nF ceramic capacitors, as per the photo. They are blue and marked 104. One on the left next to the programming header, two to the right of the 23K256 slot and one on the right above the 100R resistor.
From Wi-Node Build |
Add the two 22pF ceramic capacitors. They have black marked tops, are marked 22 and go either side of the 16Mhz crystal (at the right of the ATMega328).
From Wi-Node Build |
Add the 16Mhz crystal - to the right of the ATMega328.
From Wi-Node Build |
Add the green LED - it's at the top right hand side of the board, next to pin 8 of the L293D. The long leg should go to the top of the board and the shot leg and flat edge should go towards the bottom of the board.
From Wi-Node Build |
The 6-way right angle header goes at the bottom left of the board. It's used to both program and power the board.
From Wi-Node Build |
Add the MCP1702 3.3v voltage regulator - it's at the bottom left next to the reset switch. The flat edge goes towards the bottom of the board. You should just need to bend the middle pin outwards slightly and insert it into the holes.
From Wi-Node Build |
Fit the DIL socket for the ATMega328. Note that one end has a small notch in it - this signifies pin 1 and should match up with the notch on the legend. It's best to tack diagonally opposite corners to hold the socket in place whilst the rest of the pins are soldered. Make sure they are fitted flat on to the board.
Note: If you are going to fit the optional RFM12B module, it's recommended you leave the DIL Socket until after Step 15 to give more space to get in and solder the RFM12B.
From Wi-Node Build |
Add the reset switch at the bottom left of the board.
From Wi-Node Build |
Fit the 10uF Electrolytic capacitor just above the MCP1702 on the left hand side of the board. Ensure it is fitted the correct way round. The long leg needs to go to the + symbol on the legend and you will be able to see the white side on the photo (which goes towards the left of the board).
From Wi-Node Build |
You have nearly completed the board. However, before we add any of the (expensive) IC's, we need to check that they will receive the correct voltage.
Use a multimeter (in DC mode) to measure the voltage between pin 7 (GND) and pin 8 (VCC) of the ATMega328, as shown in the photo. You should receive something around 3.3v.
From Wi-Node Build |
WARNING: Only proceed if all of your voltage readings from above are correct - if they weren't then you have a problem with your build.
If you are going to fit the optional RFM12B wireless module. Place the module on the pads (observe the orientation - crystal to the inside) and solder each pad onto the board from above. It's worth doing opposite corners first to hold it in place, before doing the remaining pads.
From Wi-Node Build |
From Wi-Node Build |
If you fitted the RFM12B module, you need to add an antenna - this is a piece of wire of approx 82mm, which will act as a quarter wave for the 868Mhz RF.
From Wi-Node Build |
If you didn't fit the DIL socket earlier, as advised - you can fit that now.
Add the Arduino shield connectors. There are 2 x 6 way and 2 x 8 way SIL sockets. Make sure you get them in the inner lines of holes and that they are fitted straight and vertical. Best to tack one end pin whilst you hold them straight - check the alignment then solder the remaining pins in place. You could also use a shield to keep them aligned if you have one handy.
From Wi-Node Build |
Add the ATMega328 IC into the socket. Note the spot next to pin 1 and ensure you insert it in the right way.
IC's usually come with their legs pointing slightly outwards. To get them to fit easily into the socket, you should put the legs flat on a desk and rock the IC slightly to bend the pins inwards - do that at both sides and try again to fit into the socket.
From Wi-Node Build |
From Wi-Node Build |
This concludes the build of the base board.
From Wi-Node Build |
We'll now look at the different optional steps you may wish to consider.
In order to use digital pins 4, 9, 10, 11 and 13 from the shield connectors, we need to fit some wire links instead of RN4 (which is required when using the Wi-Node as a backpack.
Fit 5 separate wire links between the following pins: 1 and 2, 3 and 4, 5 and 6, 7 and 8, 9 and 10.
I used some of the component leg cut-off's and bent it over a pair of plyers.
Refer to the information in Step 1 about the options available for the Analogue inputs.
For 3V3 analogue inputs (connecting straight to the ATMega328), Replace R8, R9, R2 and R4 (bottom right of the board behind the screw terminals, marked 10k) with wire links. Do not fit RN1 or C12 or C13.
10.25V Inputs (almost exaxtly 10mV increments per count) - R8, R9, R2 and R4 (bottom right of the board behind the screw terminals, marked 10k) are to be fitted with 10k resistors and RN1 (to the left of those resistors) to be fitted with a 4K7 resistor network.
36V Inputs (in roughly 35mV increments per count) - R8, R9, R2 and R4 (bottom right of the board behind the screw terminals, marked 10k) are to be fitted with 10k resistors and RN1 (to the left of those resistors) to be fitted with a 1K resistor network.
If you are using the options 2 or 3 above, you can also fit 2x optional 100nF Ceramic Capacitors - C12, C13 to make a low pass filter on A0 and A1 with the 10K resistor which filters out any noise above about 1600Hz.
Screw terminals can be added for ease of access to the analogue inputs: A0, A1, A2 and A3.
Refer to the information in Step 1 for more information about the 23K256 SRAM.
Fit the 100k Resistor (Brown, Black, Black, Orange) at the bottom left of the board, behind the programming header.
Fit the 8-pin DIL socket in the bottom left corner of the board, above the reset switch. Note that the notce (pin 1) should be facing towards the bottom of the board.
Fit the 23K256 IC, ensuring that the notch lines up with the notce on the socket.
If you wish to keep the memory contents of the 23K256 and RTC when the power is removed, fit a 0.22F super capacitor. This goes in the bottom middle of the board, under the DS1307 DIL socket (to the right of the ATMega328). It is supplied unpolarised and can be fitted either way. I usually put the flat side to negative and have the arrows pointing to positive.
I'm going to fit this after the RTC components - see step 23e for photo if you are not doing the RTC and want to fit the super capacitor now.
Refer to the information in Step 1 for more about the RTC.
There are two options here - a DIP socket on the top of the board or SOIC pads on the bottom of the board. Both Dallas DS1307 and Microchip MCP7941x IC's are supported. I'll cover adding an MPC7941x in the SOIC slot here as that's what's included in the Wi-Node kits if your choose kit includes the RTC option. Either a MCP79410 or an MPC79411 may be used - the only difference is the latter has it's unique id area pre-programmed with a unique ethernet MAC address.
First locate the SOIC pads - they are on the bottom of the board, to the right of the ATMega328. They are labelled DS1307SO8.
You should apply a small amount of solder to each pad (on the back of the board). Place the IC over the pads using some tweezers (ensure you note pin 1 to get it the corredct way). Use your soldering iron to heat one of the pins and melt the solder, affixing the IC to the board. If you tack opposite corners first, ensure it's placed correctly and then you can leisurely solder the remaining pins without fear of it moving.
Add the 2x 10k resistors (Brown, Black, Black, Red), R3 and R5. They are located at the right hand side of the board, are labelled 10k and are the two directly under the 100R fitted in step 3. There should be 4x 10k labelled spaces left below them.
Add the 1N4148 Diode, D2. This is to the right of the space for the DIP version. Ensure it goes the correct way round as per the markings. The black bar on the diode should be facing to the bottom of the board.
Add the very small, cylindrical 32.768k RTC crystal. This is under the space for the DIP version and can go either way round.
If you wish to keep the memory contents of the 23K256 and RTC when the power is removed, fit a 0.22F super capacitor. This goes in the bottom middle of the board, under the DS1307 DIL socket (to the right of the ATMega328). It is supplied unpolarised and can be fitted either way. I usually put the flat side to negative and have the arrows pointing to positive.
It has recently been found that if you use an MCP7941x chip you need to fit 2x 22pF capacitors, otherwise the clock loses around a minute a day. Fitting a 22pF between each leg of the 32.768khz crystal and ground fixes this problem. This is not required if you use a DS1307. Fortunately, the Wi-Node PCB contains space for either a DIL or an SOIC RTC chip, so you can do the other one to access the required pins. You should fit a 22pf capacitor between Pin 1 and Pin 4 (GND) and another between Pin 2 and Pin 4 (GND).
Refer to the information in Step 1 for more about the L293D.
Fit the 16-pin DIL socket. It goes to the right of the 16Mhz crystal with the notch (indicating pin 1) downwards.
Fit the 5x 100nF ceramic capacitors, C6, C7, C8, C9 and C11.
Fit the 100uF Electrolytic, C17.
Fit the 7805 Voltage Regulator.
The enable pin for outputs 3&4 can be changed between digital 9 so it will be enabled at the same time as outputs 1&2 and digital 3 where outputs 3&4 can be controlled separately at the expensve of the interrupt / wake up alarm from the RTC.
2x 3-way screw terminals can be fitted to provide easy access to GND, VIN and the four LS293D outputs.
Fit the L293D IC into the socket.
To Follow.
Congratulations, you have completed the build of your Wi-Node
We can now see if you have done it successfully!
Connect a 5v FTDI cable or Nanode Programming Adapter to power the board. If after a few seconds you see the LED come on and start flashing then the microcontroller is working and running code. If not, you should remove power and check over the board and connections.
If you are using a Nanode programming adapter and your system prompts you for drivers, you can download those here.
If you are not using a Nanode programming adapter, you can use a normal FTDI lead but ensure the pinouts are as follows (left to right - left nearest the usb connector):
If you have two boards with RFM12B modules, you can test them by using my RFM12B Test code.
If you have fitted the optional MCP7941x Real Time Clock, you can test that out by using my Arduino MCP7941x Library and running the example sketches.
I'm also aiming to provide code to test other aspects of the board and some working examples of Nanode/Wi-Node usage, but in the meantime i'm collecting useful code snippets and links on my Nanode Information Page.