Difference between revisions of "Pebble V2.0 Instructions"

From Open Hardware Miniconf
Jump to: navigation, search
 
(46 intermediate revisions by 4 users not shown)
Line 1: Line 1:
  
'''Getting Started'''
+
 
 +
 
 +
== Hardware Overview ==
 +
 
 +
* Arduino Uno compatible, with ATmega328 and ATmega8U2 carrying the appropriate bootloaders.
 +
* Boost-converter power supply for portable battery operation at battery voltages between 2.4-4.5 volts.
 +
* RGB LED with each of the 3 LEDs independently programmable, including PWM capability.
 +
* Standard HD44780 20x4 alphanumeric LCD display.
 +
* Support for a low cost Nintendo DS style 4-wire resistive touchscreen (not included in the kit for LCA2012)
 +
* Support for an XBee 802.15.4 radio module or any other "Bee"-compatible module that operates at 3.3V and talks to a serial UART (not included in the kit for LCA2012)
 +
* Two general-purpose open-collector low-side-switching output transistors for controlling external devices such as relays.
 +
* Rotary encoder for user input.
 +
* Temperature sensor (MCP9701) and light sensor (TEMT6000).
 +
 
 +
==Getting Started==
  
 
Here's a basic guide to assembling a Pebble (Mk. 2) kit. In your kit, all the SMD components are pre-soldered on the board, the ATmega8U2 USB-to-serial circuit on the board has been pre-tested and the ATmega8U2 flashed appropriately, and the ATmega328 microcontroller has been pre-flashed with an appropriate Arduino Uno compatible bootloader.
 
Here's a basic guide to assembling a Pebble (Mk. 2) kit. In your kit, all the SMD components are pre-soldered on the board, the ATmega8U2 USB-to-serial circuit on the board has been pre-tested and the ATmega8U2 flashed appropriately, and the ATmega328 microcontroller has been pre-flashed with an appropriate Arduino Uno compatible bootloader.
Line 6: Line 20:
 
Now, let's start assembling the through-hole components on the board. Don't worry, it's all pretty easy to assemble.
 
Now, let's start assembling the through-hole components on the board. Don't worry, it's all pretty easy to assemble.
  
'''Kit Assembly (only the through-hole components)'''
+
[[File:IMAG0615.jpg]]
 +
 
 +
== Kit Assembly (only the through-hole components)==
 +
 
 +
=== Terminal Blocks, Electrolytic Capacitors, Trimpot===
 +
 
 +
We will start by installing the 2-pin screw terminal block for the battery connection, in the upper left of the board. Make sure that the holes where the wires are inserted into the terminals face out towards the outside edge of the board. The sloped face need to face outwards. Next, we will also insert and solder the two 220 uF electrolytic capacitors in the upper left of the board. The capacitors are polarised, they need to be inserted into the board with the negative lead (the one marked with a stripe down the length of the capacitor body) inserted into the hole marked "-", and the positive lead (which should be longer) inserted into the hole marked "+".
 +
 
 +
The 10uH inductor is a large round cotton reel shaped component. It is not polarised. You will find that you are not able to mount it flush with the board, so just push it down firmly until it won't go any lower.
 +
 
 +
[[File:IMAG0619.jpg]]
 +
 
 +
We will also fit the shorting jumper onto the two-pin header at this stage.
 +
 
 +
The trimpot is used to adjust the LCD display contrast and is mounted in one way. Insert and solder the trimpot onto the board. It can only be inserted one way.
 +
 
 +
[[File:IMAG0624.jpg]]
 +
 
 +
=== Headers ===
 +
 
 +
Insert and solder the two 6-pin ISP programming headers, which have 2 rows of three pins. The ISP programming headers make a very snug fit into their holes on the PCB, and you may need to use some sort of tool (The end of the handle of a screwdriver or cutters) to apply firm pressure to press these fully down into place.
 +
 
 +
Insert and solder the 16-pin male header strip which connects to the LCD display.
 +
 
 +
Insert and solder the pair of 8-pin female header strips and the pair of 6-pin female header strips that are used to mate with Arduino "shields". The female headers don't always sit straight in the holes, so make sure you hold them straight while you solder just one of the pins to start with. Then you can adjust the alignment of the headers before soldering the rest of the pins.
 +
 
 +
[[File:IMAG0628.jpg]]
 +
 
 +
=== RGB LED ===
  
We will start by installing the 2-pin screw terminal block for the battery connection, in the upper left of the board. Make sure that the holes where the wires are inserted into the terminals face out towards the outside edge of the board. Next, we will also insert and solder the two 220 uF electrolytic capacitors in the upper left of the board, along with the 10 uH inductor and the 2-pin header which is used to connect or disconnect the USB power rail. '''Remember that the two electrolytic capacitors are polarized and they must be inserted with the correct orientation.'''
+
The RGB LED is a rounded, milky-coloured part with 4 long leads coming out one end.
  
The inductor is the relatively large black cylinder with two wires and with no markings, and it is not polarized. The two-pin header can sometimes require a bit of firm pressure to fit it into its holes on the PCB. We will also fit the shorting jumper onto the two-pin header at this stage. We'll now also insert and solder the 28-pin DIP socket for the AVR microcontroller, and the 16 MHz crystal for the AVR. The crystal is not polarized, but '''the IC socket should be inserted so that the pin-1 indicator notch on the socket corresponds to the silkscreen marking'''. We'll also insert and solder the trimpot which is used to adjust the LCD display contrast.
+
'''Note: The RGB LED must be inserted the correct way, with the flat side of the LED corresponding to the silkscreen marking. One of the LED pins is longer than the others, and one of the holes in the PCB has a square pad. The long lead goes into the square pad.'''
  
We'll also insert and solder the RGB LED, remembering that '''the RGB LED must be inserted the correct way, with the flat side of the LED corresponding to the silkscreen marking'''. The four leads of the RGB LED will need to kind of splay out on an angle as you insert the LED onto the board, so it will end up sitting up approximately 5 mm off the board and it will not sit completely flush with the board.
+
If you have any doubt about the orientation of the RGB LED please ask for help. Soldering it in only takes a moment, but getting it back out again can be extremely difficult!
  
Now we will insert and solder the MCP9701 temperature sensor. '''The MCP9701 has a TO-92 package which looks identical to the two P2N2222 transistors, so make sure you read the markings printed on them and you don't get them confused.''' We can then also insert and solder the two P2N2222 transistors. '''Remember that the transistors and the temperature sensor must all be inserted the right way around, as marked on the silkscreen.'''
+
The four leads of the RGB LED will need to kind of splay out on an angle as you insert the LED onto the board, so it will end up sitting up approximately 5 mm off the board and it will not sit completely flush with the board. After ensuring that you have it oriented correctly, insert and solder in the RGB LED.
  
Next we will insert and solder the two 6-pin ISP programming headers, and we will also insert and solder the 16-pin header strip which connects to the LCD display. We will then also insert and solder the pair of 8-pin female header strips and the pair of 6-pin female header strips that are used to mate with Arduino "shields". The 6-pin ISP programming headers make a very snug fit into their holes on the PCB, and you may want to use some sort of tool (I use the end of the handle of a screwdriver) to apply firm pressure to press these fully down into place. We will also insert and solder the two 2.0 mm 10-pin female header sockets for the (optional) XBee module, as well as the pair of 2-pin PCB-mounted screw terminal blocks for the two general-purpose open-collector transistor outputs.
+
=== DIP Socket ===
 +
Insert and solder the 28-pin DIP socket for the AVR microcontroller.
  
It can be easier to hold the XBee header sockets in if you have an XBee module handy, by inserting the sockets onto the pins of the XBee module first and then inserting this assembly into the holes on the board. If you have a spare Arduino shield, a similar procedure can also be used to hold the Arduino shield header sockets straight.
+
'''The IC socket should be inserted so that the pin-1 indicator notch on the socket corresponds to the silkscreen marking, with the notch to the right if you're holding the PCB as shown below.'''
  
Now we'll also insert and solder the rotary encoder. It should just "snap" into place on the board as its mechanical mounting tabs are inserted into the PCB. Finally, we'll also need to unpack the LCD display and we'll solder a 16-way pin header onto its connection pads, and we'll also need to insert the AVR microcontroller chip into the IC socket - '''make sure it's oriented the correct way.'''
+
[[File:IMAG0631.jpg]]
  
 +
=== MCP9701 Temperature Sensor and 2N2222 Transistors ===
  
 +
In the bottom right hand corner you will find three semi-circular shapes on the silscreen, which are for one MCP9701 temperature sensors and two 2N2222 transistors. All three parts are in "TO-92" packages, and look absolutely identical.
  
'''Testing'''
+
'''Careful! Don't get them mixed up and put the parts in the wrong spots. They are not interchangeable.'''
  
If you want to use the LCD, you’ll need to attach the LCD display. This is done by making sure that your LCD display has a 16-pin header soldered onto it, and connecting the 16-wire ribbon cable to both the LCD display and the LCD header on the main board, making sure that '''pin 1 on the Pebble board is connected to pin 1 on the LCD display'''.
+
The only way to tell them apart is by looking at the extremely small printing on the face of the part. If you have trouble reading them, don't guess. There are magnifying glasses at the front of the room. To help ensure that you don't get them confused, it could be a good idea to separate out the MCP9701 and put the two P2N2222 transistors back in the bag or parts tray until you're ready to fit them.
  
Plug in the USB cable (which we've conveniently included for you) into a PC and into the Pebble board, and the blue power LED should light, and the new USB device should be recognized by the OS. If the power LED does not light, you '''did''' install the jumper to short out the USB power disconnection header, right?
+
The MCP9701 is mounted facing the bottom edge near the mounting hole, in the location labelled "Temp". Insert it and gently push it down until the body is about 5 to 8mm clear of the PCB. The leads will need to splay out a little to fit. Solder it in place carefully, doing each joint quickly and then letting the part cool down for a few seconds before doing the next one.
  
At this stage, you should be able to talk to the board from the PC. It's completely compatible with the Arduino Uno, but we re-used the same firmware used on the Freetronics Eleven, so it identifies itself as a Freetronics Eleven.
+
Insert and solder the two transistors in the same way.
  
If your PC is running Windows, you'll need to [http://www.freetronics.com/pages/installing-the-usb-driver-file-for-windows install the driver] if you've never used an Arduino Uno or compatible device on your PC before. If you're running Linux or Mac OSX etc, then it should just work without any effort.
+
==== Xbee Headers ====
 +
It can be easier to hold the XBee header sockets in if you have an XBee module handy, by inserting the sockets onto the pins of the XBee module first and then inserting this assembly into the holes on the board. If you don't have an XBee module and don't intend to fit one, you can simply leave those headers off the board.
  
You'll also need to have the Arduino IDE installed, of course. Select "Arduino Uno" as the target hardware type, select the right (virtual) serial port for the Arduino IDE to talk to, and you should be all ready to upload programs.
+
=== Rotary Encoder===
 +
Now we'll also insert and solder the rotary encoder. It should "snap" into place on the board as its mechanical mounting tabs are inserted into the PCB. The tabs can be tricky to clip in though and you need to be careful not to bend the thin leads while wrestling with the mounting tabs. You may find it helpful to get the part fully aligned and then use a tiny screwdriver or similar to push the tabs sideways until they clip in.
  
 +
=== LCD Module Header===
 +
Unpack the LCD module and solder a 16-way pin male header onto its connection pads, with the header on the bottom of the PCB. The LCD connects to the Pebble via a ribbon cable (also supplied) so you can mount the display separately. When plugging them all together, make sure that pin 1 on the header on the PCB connects via the cable to pin 1 on the header on the LCD. One way to check is to hold the LCD directly over the PCB as if it was going to mount over the top of it, in which case the pins on the two sets of headers will naturally align correctly.
  
 +
=== ATmega328P Microcontroller ===
 +
'''Warning: the MCU is a static-sensitive part. Minimise your handling of the pins once it has been removed from its protective anti-static foam.'''
  
'''Hardware Features'''
+
The orientation of the MCU is critical. Pin 1 is noted by a notch at one end of the IC. It may be hidden by the sticker but should be revealed by pushing the sticker back a little. Ask if you are not sure. You will find that the legs of the IC may not line up correctly with holes in the socket. Please do not force it as that trick never works. Instead use a flat surface such as the workbench to push the legs in a little bit and then repeat for the other side. The trick is to be "firm, but not brutal" - it can take a reasonable amount of force to bend all the pins straight, but it's easy to overdo it and fold them over. Once again, please ask for help with this step if unsure.
  
- Arduino Uno compatible, with ATmega328 and ATmega8U2 carrying the appropriate bootloaders
+
[[File:IMAG0638.jpg]]
  
- Boost-converter power supply for portable battery operation at voltages between 2.4-5.0 volts.
+
===Testing===
  
- RGB LED with each of the 3 dies independently programmable, including PWM capability
+
Plug in the USB cable (which we've included for you) into a PC and into the Pebble board, and the blue power LED should light, and the new USB device should be recognized by the OS. If the power LED does not light, you '''did''' install the jumper to short out the USB power disconnection header, right? (Note that the power switch doesn't do anything except when battery power is used. If USB power is connected, then it is "always on".)
  
- Standard HD44780 20x4 alphanumeric LCD display
+
At this stage, you should be able to talk to the board from the PC. It's completely compatible with the Arduino Uno, but we re-used the same firmware used on the Freetronics Eleven, so it identifies itself as a Freetronics Eleven.
  
- Support for a low cost Nintendo DS style resistive touchscreen
+
If your PC is running Windows, you'll need to [http://www.freetronics.com/pages/installing-the-usb-driver-file-for-windows install the driver] if you've never used an Arduino Uno or compatible device on your PC before. If you're running Linux or Mac OSX etc, then it should just work without any effort.
  
- Support for an XBee digital radio modem or any other "Bee"-compatible module that operates at 3.3V and talks to a serial UART.
+
You'll also need to have the Arduino IDE installed, of course. Select "Arduino Uno" as the target hardware type, select the right (virtual) serial port for the Arduino IDE to talk to, and you should be all ready to upload programs.
  
- Two general-purpose open-collector low-side-switching output transistors for controlling external devices such as relays or small speakers
+
If you want to use the LCD, you’ll need to attach the LCD display. This is done by making sure that your LCD display has a 16-pin header soldered onto it, and connecting the 16-wire ribbon cable to both the LCD display and the LCD header on the main board, making sure that '''pin 1 on the Pebble board is connected to pin 1 on the LCD display'''.
  
- Rotary encoder for user input
+
===Demo Software===
  
- Temperature sensor (MCP9701) and light sensor (TEMT6000)
+
If you want test code, you can look at [http://marc.merlins.org/perso/arduino/post_2012-01-24_Much-Improved-Pebble-v2-Aiko-Demo-Code.html Marc MERLIN's page with a full test for most of the Pebble v2's hardware] (note the few example standalone programs that do not use Aiko at the end of that page, and hosted on https://github.com/marcmerlin/pebble_v2_demos ).
  
'''Battery power'''
+
Marc's code was based on Andy's original work on github: https://github.com/geekscape/aiko_pebble_v2 .
  
Now, if you want to use portable power without just being limited to USB use, let’s look at power options.
+
===Hardware Features===
  
If you want to use a mains plugpack as the power supply, the kind of plugpack that provides a 5.0 V output onto a standard USB socket is a good choice.
+
* Arduino Uno compatible, with ATmega328 and ATmega8U2 carrying the appropriate bootloaders.
 +
* Boost-converter power supply for portable battery operation at battery voltages between 2.4-4.5 volts.
 +
* RGB LED with each of the 3 LEDs independently programmable, including PWM capability.
 +
* Standard HD44780 20x4 alphanumeric LCD display.
 +
* Support for a low cost Nintendo DS style 4-wire resistive touchscreen.
 +
* Support for an XBee 802.15.4 radio module or any other "Bee"-compatible module that operates at 3.3V and talks to a serial UART.
 +
* Two general-purpose open-collector low-side-switching output transistors for controlling external devices such as relays.
 +
* Rotary encoder for user input.
 +
* Temperature sensor (MCP9701) and light sensor (TEMT6000).
  
The battery voltage input must be within the range of about 2.4 - 4.5 V for correct operation. Thou shall not ever exceed 5 volts, into either of the power supply inputs, on this device.
+
===Battery power===
  
You can use two standard alkaline or NiCd or NiMH cells in series, for a voltage supply of 3.0 V (or 2.4 V if you’re using 1.2 V NiMH cells), or you can use 3.6-4.5 V from a set of three cells in series. The latter will provide an improvement in battery life. The 2.4 V you will get from two NiMH cells is OK, but it is towards the lower end of the operational voltage window.
+
Now, if you want to use portable power without just being limited to USB use, let’s look at power options.
  
You can use common “AA” or “AAA” cells, however the larger types such as “C” or “D” cells will provide greater charge capacity and a greater runtime. You could also use a 3.7 V lithium-polymer cell, where a small, lightweight battery with high energy density is desired.
+
After you've programmed the board with some code, if you want to use an alternative power source away from your PC, you can either use battery power or you can provide regulated 5.0 V DC power to the USB socket via a standard USB cable - for example by using one of those common 5.0V mains switchmode plugpacks with a "dumb" USB connector for power output.
  
There is no battery charging electronics built into the device - to recharge your batteries they must be disconnected and recharged externally.
+
The battery voltage input must be within the range of about 2.4 - 4.5 V for correct operation. '''Thou shall not ever exceed 5 volts''', into either of the power supply inputs, on this device.
  
A 2 x AA battery holder like the one pictured should be included in your kit. To use it, you’ll need to disconnect the USB power supply jumper (this does not affect USB programming and communications with the USB cable connected) and connect the wires from the battery holder to the battery connection terminals on the board.
+
You can use two standard alkaline or NiCd or NiMH cells in series, for a voltage supply of 3.0 V (or 2.4 V if you’re using 1.2 V NiMH cells), or you can use 3.6-4.5 V from a set of three cells in series. The latter will provide an improvement in battery life. The 2.4 V you will get from two NiMH cells is OK, but it is towards the lower end of the operational voltage window.
  
"Example battery holder, I need to nick a picture of one and insert it: http://search.digikey.com/us/en/products/BC2AAW/BC2AAW-ND/2190080"
+
You can use common “AA” or “AAA” cells, however the larger types such as “C” or “D” cells will provide greater charge capacity and a greater runtime. You could also use a 3.7 V lithium-polymer cell, where a small, lightweight battery with high energy density is desired. (Note that there is no battery holder included with the kit and you can add your own separately if you want to use battery power.)
  
If you were using a different battery configuration, as per the examples and requirements above, you may wish to swap this over for a different kind of battery holder.
+
Make sure that the positive and negative wires from the battery holder are connected to the terminal block on the board with the correct polarity, as marked on the silkscreen, and ensure that charged batteries are inserted into the battery holder with the correct polarity. With the batteries installed and wired up, you should then be able to turn on the power switch on the board, and the power LED should light up. (The on-board power switch has no effect if USB power is connected.) If you’re using a battery holder which has a built-in power switch then this power switch must also be turned on.
  
Make sure that the positive and negative wires from the battery holder are connected to the terminal block on the board with the correct polarity, as marked on the silkscreen, and ensure that charged batteries are inserted into the battery holder with the correct polarity.
+
There is no battery charging electronics built into the device - to recharge your batteries they must be disconnected and recharged externally.
  
With the batteries installed and wired up, you should then be able to turn on the power switch on the board, and the power LED should light up. (The on-board power switch has no effect if USB power is connected.) If you’re using a battery holder which has a built-in power switch then this power switch must also be turned on.
 
  
If you’re using battery power at the same time that you have the USB power jumper connected and USB plugged in, this should be OK and it should function normally with no weird issues or damage. However, I need to perform testing to double-check this once the production hardware arrives... until then, if in doubt leave the USB power jumper disconnected when battery power is connected.
 
  
'''Semi-permanent solder jumpers'''
+
===Semi-permanent solder jumpers===
  
SJ1 is normally closed, this is for automatic reset of the AVR, controlled by the USB UART interface, during programming. Cut it to disable auto-reset.
+
SJ1 is normally closed, this is for automatic reset of the AVR, controlled by the USB UART interface, during programming. Cut it to disable auto-reset.<br>
SJ2 connects the USB shield to ground. This is normally closed and should never normally need to be opened.
+
SJ2 connects the USB shield to ground. This is normally closed and should never normally need to be opened.<br>
SJ3 is normally open. This is for the bootloader programming of the ATmega16U2 and should never need to be closed.
+
SJ3 is normally open. This is for the DFU programming of the ATmega16U2 and should never need to be closed.<br>
 
SJ4 is normally closed, and this connects the high side of the two low-side-switching open collector output transistors to +5V. Disconnect it if you want to use an external higher-voltage power supply for these circuits.
 
SJ4 is normally closed, and this connects the high side of the two low-side-switching open collector output transistors to +5V. Disconnect it if you want to use an external higher-voltage power supply for these circuits.

Latest revision as of 08:03, 27 January 2012


Hardware Overview

  • Arduino Uno compatible, with ATmega328 and ATmega8U2 carrying the appropriate bootloaders.
  • Boost-converter power supply for portable battery operation at battery voltages between 2.4-4.5 volts.
  • RGB LED with each of the 3 LEDs independently programmable, including PWM capability.
  • Standard HD44780 20x4 alphanumeric LCD display.
  • Support for a low cost Nintendo DS style 4-wire resistive touchscreen (not included in the kit for LCA2012)
  • Support for an XBee 802.15.4 radio module or any other "Bee"-compatible module that operates at 3.3V and talks to a serial UART (not included in the kit for LCA2012)
  • Two general-purpose open-collector low-side-switching output transistors for controlling external devices such as relays.
  • Rotary encoder for user input.
  • Temperature sensor (MCP9701) and light sensor (TEMT6000).

Getting Started

Here's a basic guide to assembling a Pebble (Mk. 2) kit. In your kit, all the SMD components are pre-soldered on the board, the ATmega8U2 USB-to-serial circuit on the board has been pre-tested and the ATmega8U2 flashed appropriately, and the ATmega328 microcontroller has been pre-flashed with an appropriate Arduino Uno compatible bootloader.

Now, let's start assembling the through-hole components on the board. Don't worry, it's all pretty easy to assemble.

IMAG0615.jpg

Kit Assembly (only the through-hole components)

Terminal Blocks, Electrolytic Capacitors, Trimpot

We will start by installing the 2-pin screw terminal block for the battery connection, in the upper left of the board. Make sure that the holes where the wires are inserted into the terminals face out towards the outside edge of the board. The sloped face need to face outwards. Next, we will also insert and solder the two 220 uF electrolytic capacitors in the upper left of the board. The capacitors are polarised, they need to be inserted into the board with the negative lead (the one marked with a stripe down the length of the capacitor body) inserted into the hole marked "-", and the positive lead (which should be longer) inserted into the hole marked "+".

The 10uH inductor is a large round cotton reel shaped component. It is not polarised. You will find that you are not able to mount it flush with the board, so just push it down firmly until it won't go any lower.

IMAG0619.jpg

We will also fit the shorting jumper onto the two-pin header at this stage.

The trimpot is used to adjust the LCD display contrast and is mounted in one way. Insert and solder the trimpot onto the board. It can only be inserted one way.

IMAG0624.jpg

Headers

Insert and solder the two 6-pin ISP programming headers, which have 2 rows of three pins. The ISP programming headers make a very snug fit into their holes on the PCB, and you may need to use some sort of tool (The end of the handle of a screwdriver or cutters) to apply firm pressure to press these fully down into place.

Insert and solder the 16-pin male header strip which connects to the LCD display.

Insert and solder the pair of 8-pin female header strips and the pair of 6-pin female header strips that are used to mate with Arduino "shields". The female headers don't always sit straight in the holes, so make sure you hold them straight while you solder just one of the pins to start with. Then you can adjust the alignment of the headers before soldering the rest of the pins.

IMAG0628.jpg

RGB LED

The RGB LED is a rounded, milky-coloured part with 4 long leads coming out one end.

Note: The RGB LED must be inserted the correct way, with the flat side of the LED corresponding to the silkscreen marking. One of the LED pins is longer than the others, and one of the holes in the PCB has a square pad. The long lead goes into the square pad.

If you have any doubt about the orientation of the RGB LED please ask for help. Soldering it in only takes a moment, but getting it back out again can be extremely difficult!

The four leads of the RGB LED will need to kind of splay out on an angle as you insert the LED onto the board, so it will end up sitting up approximately 5 mm off the board and it will not sit completely flush with the board. After ensuring that you have it oriented correctly, insert and solder in the RGB LED.

DIP Socket

Insert and solder the 28-pin DIP socket for the AVR microcontroller.

The IC socket should be inserted so that the pin-1 indicator notch on the socket corresponds to the silkscreen marking, with the notch to the right if you're holding the PCB as shown below.

IMAG0631.jpg

MCP9701 Temperature Sensor and 2N2222 Transistors

In the bottom right hand corner you will find three semi-circular shapes on the silscreen, which are for one MCP9701 temperature sensors and two 2N2222 transistors. All three parts are in "TO-92" packages, and look absolutely identical.

Careful! Don't get them mixed up and put the parts in the wrong spots. They are not interchangeable.

The only way to tell them apart is by looking at the extremely small printing on the face of the part. If you have trouble reading them, don't guess. There are magnifying glasses at the front of the room. To help ensure that you don't get them confused, it could be a good idea to separate out the MCP9701 and put the two P2N2222 transistors back in the bag or parts tray until you're ready to fit them.

The MCP9701 is mounted facing the bottom edge near the mounting hole, in the location labelled "Temp". Insert it and gently push it down until the body is about 5 to 8mm clear of the PCB. The leads will need to splay out a little to fit. Solder it in place carefully, doing each joint quickly and then letting the part cool down for a few seconds before doing the next one.

Insert and solder the two transistors in the same way.

Xbee Headers

It can be easier to hold the XBee header sockets in if you have an XBee module handy, by inserting the sockets onto the pins of the XBee module first and then inserting this assembly into the holes on the board. If you don't have an XBee module and don't intend to fit one, you can simply leave those headers off the board.

Rotary Encoder

Now we'll also insert and solder the rotary encoder. It should "snap" into place on the board as its mechanical mounting tabs are inserted into the PCB. The tabs can be tricky to clip in though and you need to be careful not to bend the thin leads while wrestling with the mounting tabs. You may find it helpful to get the part fully aligned and then use a tiny screwdriver or similar to push the tabs sideways until they clip in.

LCD Module Header

Unpack the LCD module and solder a 16-way pin male header onto its connection pads, with the header on the bottom of the PCB. The LCD connects to the Pebble via a ribbon cable (also supplied) so you can mount the display separately. When plugging them all together, make sure that pin 1 on the header on the PCB connects via the cable to pin 1 on the header on the LCD. One way to check is to hold the LCD directly over the PCB as if it was going to mount over the top of it, in which case the pins on the two sets of headers will naturally align correctly.

ATmega328P Microcontroller

Warning: the MCU is a static-sensitive part. Minimise your handling of the pins once it has been removed from its protective anti-static foam.

The orientation of the MCU is critical. Pin 1 is noted by a notch at one end of the IC. It may be hidden by the sticker but should be revealed by pushing the sticker back a little. Ask if you are not sure. You will find that the legs of the IC may not line up correctly with holes in the socket. Please do not force it as that trick never works. Instead use a flat surface such as the workbench to push the legs in a little bit and then repeat for the other side. The trick is to be "firm, but not brutal" - it can take a reasonable amount of force to bend all the pins straight, but it's easy to overdo it and fold them over. Once again, please ask for help with this step if unsure.

IMAG0638.jpg

Testing

Plug in the USB cable (which we've included for you) into a PC and into the Pebble board, and the blue power LED should light, and the new USB device should be recognized by the OS. If the power LED does not light, you did install the jumper to short out the USB power disconnection header, right? (Note that the power switch doesn't do anything except when battery power is used. If USB power is connected, then it is "always on".)

At this stage, you should be able to talk to the board from the PC. It's completely compatible with the Arduino Uno, but we re-used the same firmware used on the Freetronics Eleven, so it identifies itself as a Freetronics Eleven.

If your PC is running Windows, you'll need to install the driver if you've never used an Arduino Uno or compatible device on your PC before. If you're running Linux or Mac OSX etc, then it should just work without any effort.

You'll also need to have the Arduino IDE installed, of course. Select "Arduino Uno" as the target hardware type, select the right (virtual) serial port for the Arduino IDE to talk to, and you should be all ready to upload programs.

If you want to use the LCD, you’ll need to attach the LCD display. This is done by making sure that your LCD display has a 16-pin header soldered onto it, and connecting the 16-wire ribbon cable to both the LCD display and the LCD header on the main board, making sure that pin 1 on the Pebble board is connected to pin 1 on the LCD display.

Demo Software

If you want test code, you can look at Marc MERLIN's page with a full test for most of the Pebble v2's hardware (note the few example standalone programs that do not use Aiko at the end of that page, and hosted on https://github.com/marcmerlin/pebble_v2_demos ).

Marc's code was based on Andy's original work on github: https://github.com/geekscape/aiko_pebble_v2 .

Hardware Features

  • Arduino Uno compatible, with ATmega328 and ATmega8U2 carrying the appropriate bootloaders.
  • Boost-converter power supply for portable battery operation at battery voltages between 2.4-4.5 volts.
  • RGB LED with each of the 3 LEDs independently programmable, including PWM capability.
  • Standard HD44780 20x4 alphanumeric LCD display.
  • Support for a low cost Nintendo DS style 4-wire resistive touchscreen.
  • Support for an XBee 802.15.4 radio module or any other "Bee"-compatible module that operates at 3.3V and talks to a serial UART.
  • Two general-purpose open-collector low-side-switching output transistors for controlling external devices such as relays.
  • Rotary encoder for user input.
  • Temperature sensor (MCP9701) and light sensor (TEMT6000).

Battery power

Now, if you want to use portable power without just being limited to USB use, let’s look at power options.

After you've programmed the board with some code, if you want to use an alternative power source away from your PC, you can either use battery power or you can provide regulated 5.0 V DC power to the USB socket via a standard USB cable - for example by using one of those common 5.0V mains switchmode plugpacks with a "dumb" USB connector for power output.

The battery voltage input must be within the range of about 2.4 - 4.5 V for correct operation. Thou shall not ever exceed 5 volts, into either of the power supply inputs, on this device.

You can use two standard alkaline or NiCd or NiMH cells in series, for a voltage supply of 3.0 V (or 2.4 V if you’re using 1.2 V NiMH cells), or you can use 3.6-4.5 V from a set of three cells in series. The latter will provide an improvement in battery life. The 2.4 V you will get from two NiMH cells is OK, but it is towards the lower end of the operational voltage window.

You can use common “AA” or “AAA” cells, however the larger types such as “C” or “D” cells will provide greater charge capacity and a greater runtime. You could also use a 3.7 V lithium-polymer cell, where a small, lightweight battery with high energy density is desired. (Note that there is no battery holder included with the kit and you can add your own separately if you want to use battery power.)

Make sure that the positive and negative wires from the battery holder are connected to the terminal block on the board with the correct polarity, as marked on the silkscreen, and ensure that charged batteries are inserted into the battery holder with the correct polarity. With the batteries installed and wired up, you should then be able to turn on the power switch on the board, and the power LED should light up. (The on-board power switch has no effect if USB power is connected.) If you’re using a battery holder which has a built-in power switch then this power switch must also be turned on.

There is no battery charging electronics built into the device - to recharge your batteries they must be disconnected and recharged externally.


Semi-permanent solder jumpers

SJ1 is normally closed, this is for automatic reset of the AVR, controlled by the USB UART interface, during programming. Cut it to disable auto-reset.
SJ2 connects the USB shield to ground. This is normally closed and should never normally need to be opened.
SJ3 is normally open. This is for the DFU programming of the ATmega16U2 and should never need to be closed.
SJ4 is normally closed, and this connects the high side of the two low-side-switching open collector output transistors to +5V. Disconnect it if you want to use an external higher-voltage power supply for these circuits.