Difference between revisions of "Pebble V2.0 Instructions"

From Open Hardware Miniconf
Jump to: navigation, search
(Created page with " // This is very rough, I need to work on it some more but it's a draft to get started. This guide assumes that you already have all the SMD components pre-assembled on your ...")
 
Line 1: Line 1:
  
// This is very rough, I need to work on it some more but it's a draft to get started.
+
'''Getting Started'''
  
This guide assumes that you already have all the SMD components pre-assembled on your board. Check that this is the case; if there are some SMD components that are missing or not
+
Here's a basic guide to assembling a Pebble (v2.0) kit.
assembled already then you should check this with Luke or Jon.
 
  
Your kit should come with the SMD ATmega8U2 pre-assembled on the board and the through-hole 16 MHz crystal next to it pre-soldered on the board, with the ATmega8U2 pre-flashed with its appropriate firmware and the USB ATmega8U2 circuit pre-tested. You should also be supplied with an ATmega328 DIP chip that is pre-flashed with an Arduino Uno compatible bootloader.
+
This guide assumes that you have a kit with all the SMD components pre-assembled on your board. Your kit should come with the ATmega8U2 IC and its associated SMD components pre-assembled on the board and the through-hole 16 MHz crystal next to it pre-soldered on the board, with the ATmega8U2 pre-flashed with its appropriate firmware and the USB interface pre-tested. You should also be supplied with an DIP ATmega328 microcontroller that is pre-flashed with an Arduino Uno compatible bootloader.
 
 
Check the status of the semi-permanent solder-jumper links - SJ1 (reset), SJ2 (USB ground) and SJ4 (+5V low-side drives) should be closed by default, whilst SJ3 (boot) should be open.
 
  
 
Now, let's start assembling some of the through-hole components on the board.
 
Now, let's start assembling some of the through-hole components on the board.
  
We will start by installing the 2-pin screw terminal block for the battery connection. Make sure that the holes where the wires are inserted face out towards the outside edge of the board.
+
'''Kit Assembly (only the through-hole components)'''
  
Now, we will insert and solder the two-pin header which is used to connect or disconnect the USB power bus. We will also insert and solder the inductor - the inductor is a black cylinder with two wires, and it is not polarized.
+
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 face out towards the outside edge of the board. Next, we will insert and solder the two-pin header which is used to connect or disconnect the USB power bus. We will also insert and solder the inductor - the inductor is a black cylinder with two wires, and it is not polarized. Next, let's insert and solder the two 220 uF electrolytic capacitors - remember that these capacitors are polarized and they must be installed with the correct polarity as marked on the board.
  
Next, let's insert and solder the two 220 uF electrolytic capacitors - remember that these capacitors are polarized and they must be oriented with the correct polarity as
+
Next we will insert and solder the 6-pin ISP programming header (which may be optional if in-circuit programming is not required) and we will insert and solder the trimpot which sets the LCD contrast.
marked on the board.
 
  
Next we will insert and solder the 6-pin ISP programming header (which may be optional if in-circuit programming is not required) and we will insert and solder the trimpot which sets the LCD contrast. Make sure that the side of the trimpot where you actually rotate it is facing towards the outside edge of the board.
+
Next, 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".
  
Next, we will also insert and solder the 16-pin female 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".
+
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 indicator notch on the socket corresponds to the silkscreen marking. 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.
  
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 indicator notch on the socket corresponds to the silkscreen marking. 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.
+
Now we can insert and solder the MCP9701 temperature sensor - ''make sure that you don't get the MCP9701 confused with the two similar-looking P2N2222 transistors''. 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.
  
Now we can insert and solder the MCP9701 temperature sensor - make sure that you don't get the MCP9701 confused with the two similar-looking P2N2222 transistors. 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.
+
Now we can insert and solder the two 2.0 mm 10-pin female header sockets for the (optional) XBee module, as well as the 4-pin PCB-mounted screw terminal block for the two general-purpose open-collector transistor outputs.
  
 +
It can be easier to hold the XBee header sockets straight and in position 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.
  
Now we can insert and solder the two 2.0 mm 10-pin female header sockets for the (optional) XBee module, as well as the 4-pin PCB-mounted screw terminal block for the two general-purpose low-side transistor outputs.
+
We can now insert and solder the rotary encoder. Finally, we’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 headers to both the LCD display and the main board, making sure that pin 1 on the Pebble board is connected to pin 1 on the LCD display.
  
We can now insert and solder the rotary encoder. Finally, we’ll need to attach the LCD display. The easiest way to do this is probably to insert the 16-pin pin header strip into the 16-pin female header on the board, and insert the LCD module with the other end of the pin headers passing through the holes on the LCD.
+
'''Testing'''
  
Make sure that the LCD is in the correct orientation and that pin 1 on the LCD display corresponds to pin 1 on the board, and then solder the pin header onto the LCD module’s pads.
+
''Note: Once we’ve actually got the hardware, Luke/Jon/Andy etc. will perform some initial testing, and we’ll write a more simple, streamlined guide for miniconf use."
  
For future use, if the position of the LCD is not convenient, you might wish to construct a cable to move it away from the board.
+
Insert a 0.1” shorting jumper (a little plastic thing, like the ones on older computer motherboards) onto the USB power header, and plug the Pebble into your computer with a mini-USB cable.
  
Now, we’re ready for some testing.
+
''Note: Oh, that’s a good idea. Maybe we can provide mini-USB cables with the boards like Freetronics usually does. Maybe there's not enough time to get them though. Or at least tell participants to bring one in advance.''
  
Testing
+
At this stage we won’t connect any batteries, and we won’t insert the AVR chip into its socket, and we won’t insert an XBee module, and we won’t connect any kind of shield.
  
Note: Once we’ve actually got the hardware, Luke/Jon/Andy etc. will perform some initial testing, and we’ll write a more simple, streamlined guide for miniconf use.
+
As soon as you have connected the USB power, the power LED on the board should be illuminated and it should stay illuminated at all times. If it does not, then something is wrong. The first thing to check is that the USB power disconnection jumper is actually installed on its pair of pins.
  
Insert a 0.1” shorting jumper (a little plastic thing, like the ones on older computer motherboards) onto the USB power header, and plug the Pebble into your computer with a mini-USB cable.
+
At this stage, you should be able to talk to the ATmega8U2 USB-interface microcontroller from within the computer’s operating system. By default it’s programmed as a USB-to-serial bridge, just like an Arduino Uno.
 +
 
 +
Try inserting a little piece of wire to connect pin 0 and pin 1 on the Arduino shield header, then opening a serial terminal program* and talking to the serial device. This simply creates a loop-back for the serial port, so you should be able to type in a string and see it echo back.
 +
 
 +
(* If you don't really know what you're doing, just use the serial terminal built into the Arduino IDE.)
 +
 
 +
Now, if everything is good so far we can insert the ATmega328 microcontroller into its IC socket, ''making sure that it is inserted the right way around''.
 +
 
 +
We should now be able to upload Arduino programs into the microcontroller using the Arduino IDE. Remember to select “Arduino Uno” as the target hardware type, and to select the appropriate serial port device.
 +
 
 +
'''Hardware Features'''
  
(Yes, jumper shunts were included on the BOM.)
+
- Arduino Uno compatible, with ATmega328 and ATmega8U2 carrying the appropriate bootloaders
  
Note: Oh, that’s a good idea. Maybe we can provide mini-USB cables with the boards like Freetronics usually does.
+
- Boost-converter power supply for portable battery operation at voltages between 2.4-5.0 volts.
  
At this stage we won’t connect any batteries, and we won’t insert the AVR chip into its socket, and we won’t insert an XBee module, and we won’t connect any kind of shield.
+
- RGB LED with each of the 3 dies independently programmable, including PWM capability
  
 +
- Standard HD44780 20x4 alphanumeric LCD display
  
As soon as you have connected the USB power, the power LED on the board should be illuminated and it should stay illuminated at all times. If it does not, then something is wrong. The first thing to check is that the USB power disconnection jumper is actually installed on its pair of pins.
+
- Support for a low cost Nintendo DS style resistive touchscreen
  
At this stage, you should be able to talk to the ATmega8U2 USB-interface microcontroller from within the computer’s operating system. By default it’s programmed as a USB-to-serial bridge, just like an Arduino Uno.
+
- Support for an XBee digital radio modem or any other "Bee"-compatible module that operates at 3.3V and talks to a serial UART.
  
Try inserting a little piece of wire to connect pin 0 and pin 1 on the Arduino shield header, then opening a terminal program and talking to the serial device. This simply creates a loop-back for the serial port, so you should be able to type in a string and see it echo back.
+
- Two general-purpose open-collector low-side-switching output transistors for controlling external devices such as relays or small speakers
  
Now, if everything is good so far we can insert the ATmega328 microcontroller into its IC socket, making sure that it is inserted the right way around.
+
- Rotary encoder for user input
  
We should now be able to upload Arduino programs into the microcontroller using the Arduino IDE. Remember to select “Arduino Uno” as the target hardware type, and to select the appropriate serial device.
+
- Temperature sensor (MCP9701) and light sensor (TEMT6000)
  
Batteries:
+
'''Battery power'''
  
 
Now, if you want to use portable power without just being limited to USB use, let’s look at power options.
 
Now, if you want to use portable power without just being limited to USB use, let’s look at power options.
Line 71: Line 79:
  
 
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.
 
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.
 
  
 
There is no battery charging electronics built into the device - to recharge your batteries they must be disconnected and recharged externally.
 
There is no battery charging electronics built into the device - to recharge your batteries they must be disconnected and recharged externally.
Line 77: Line 84:
 
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.
 
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.
  
Example battery holder, I need to nick a picture of one and insert it:
+
"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"
http://search.digikey.com/us/en/products/BC2AAW/BC2AAW-ND/2190080
 
  
 
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.
 
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.
Line 87: Line 93:
  
 
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.
 
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'''
 +
 +
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 bootloader 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.

Revision as of 10:18, 21 December 2011

Getting Started

Here's a basic guide to assembling a Pebble (v2.0) kit.

This guide assumes that you have a kit with all the SMD components pre-assembled on your board. Your kit should come with the ATmega8U2 IC and its associated SMD components pre-assembled on the board and the through-hole 16 MHz crystal next to it pre-soldered on the board, with the ATmega8U2 pre-flashed with its appropriate firmware and the USB interface pre-tested. You should also be supplied with an DIP ATmega328 microcontroller that is pre-flashed with an Arduino Uno compatible bootloader.

Now, let's start assembling some of the through-hole components on the board.

Kit Assembly (only the through-hole components)

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 face out towards the outside edge of the board. Next, we will insert and solder the two-pin header which is used to connect or disconnect the USB power bus. We will also insert and solder the inductor - the inductor is a black cylinder with two wires, and it is not polarized. Next, let's insert and solder the two 220 uF electrolytic capacitors - remember that these capacitors are polarized and they must be installed with the correct polarity as marked on the board.

Next we will insert and solder the 6-pin ISP programming header (which may be optional if in-circuit programming is not required) and we will insert and solder the trimpot which sets the LCD contrast.

Next, 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".

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 indicator notch on the socket corresponds to the silkscreen marking. 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.

Now we can insert and solder the MCP9701 temperature sensor - make sure that you don't get the MCP9701 confused with the two similar-looking P2N2222 transistors. 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.

Now we can insert and solder the two 2.0 mm 10-pin female header sockets for the (optional) XBee module, as well as the 4-pin PCB-mounted screw terminal block for the two general-purpose open-collector transistor outputs.

It can be easier to hold the XBee header sockets straight and in position 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.

We can now insert and solder the rotary encoder. Finally, we’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 headers to both the LCD display and the main board, making sure that pin 1 on the Pebble board is connected to pin 1 on the LCD display.

Testing

Note: Once we’ve actually got the hardware, Luke/Jon/Andy etc. will perform some initial testing, and we’ll write a more simple, streamlined guide for miniconf use."

Insert a 0.1” shorting jumper (a little plastic thing, like the ones on older computer motherboards) onto the USB power header, and plug the Pebble into your computer with a mini-USB cable.

Note: Oh, that’s a good idea. Maybe we can provide mini-USB cables with the boards like Freetronics usually does. Maybe there's not enough time to get them though. Or at least tell participants to bring one in advance.

At this stage we won’t connect any batteries, and we won’t insert the AVR chip into its socket, and we won’t insert an XBee module, and we won’t connect any kind of shield.

As soon as you have connected the USB power, the power LED on the board should be illuminated and it should stay illuminated at all times. If it does not, then something is wrong. The first thing to check is that the USB power disconnection jumper is actually installed on its pair of pins.

At this stage, you should be able to talk to the ATmega8U2 USB-interface microcontroller from within the computer’s operating system. By default it’s programmed as a USB-to-serial bridge, just like an Arduino Uno.

Try inserting a little piece of wire to connect pin 0 and pin 1 on the Arduino shield header, then opening a serial terminal program* and talking to the serial device. This simply creates a loop-back for the serial port, so you should be able to type in a string and see it echo back.

(* If you don't really know what you're doing, just use the serial terminal built into the Arduino IDE.)

Now, if everything is good so far we can insert the ATmega328 microcontroller into its IC socket, making sure that it is inserted the right way around.

We should now be able to upload Arduino programs into the microcontroller using the Arduino IDE. Remember to select “Arduino Uno” as the target hardware type, and to select the appropriate serial port device.

Hardware Features

- Arduino Uno compatible, with ATmega328 and ATmega8U2 carrying the appropriate bootloaders

- Boost-converter power supply for portable battery operation at voltages between 2.4-5.0 volts.

- RGB LED with each of the 3 dies independently programmable, including PWM capability

- Standard HD44780 20x4 alphanumeric LCD display

- Support for a low cost Nintendo DS style resistive touchscreen

- Support for an XBee digital radio modem 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 or small speakers

- 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.

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.

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.

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

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.

"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"

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.

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

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 bootloader 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.