User Tools

Site Tools


tutorials:products:iotp

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
tutorials:products:iotp [2012/05/28 21:26]
pburgess [Use it!]
tutorials:products:iotp [2016/01/28 18:05] (current)
Line 1: Line 1:
-==== “Internet of Things” Printer Assembly Instructions ​====+====== Moved! ======
  
-In the future, everything will be connected ​to the internet. And all restaurants will be Taco Bell! +This tutorial has moved to [[http://learn.adafruit.com/​internet-of-things-printer|http://​learn.adafruit.com/​internet-of-things-printer]]
- +
-The "​Internet of Things"​ refers to the idea of pervasive, ambient connections between physical objects and the virtual world. If every modest sensor or output device could share information via the internet, what new paradigms will arise? Our little printer is one such experiment. What value can be culled from the internet without a browser interface, or even a computer screen for that matter? +
- +
-==== Parts List ==== +
-The Internet of Things Printer Project Pack includes the following items: +
-  * [[https://​www.adafruit.com/​products/​597|Mini Thermal Receipt Printer]]. +
-  * [[https://​www.adafruit.com/​products/​599|50'​ roll of thermal paper]]. +
-  * [[https://​www.adafruit.com/​products/​482|Metal on/off toggle button with green LED]]. +
-  * [[https://​www.adafruit.com/​products/​610|Panel-mount DC barrel jack]]. +
-  * [[https://​www.adafruit.com/​products/​276|5V 2A DC switching power supply]]. +
-  * Break-away strip male header (single piece similar to [[https://​www.adafruit.com/​products/​400|product ID #400]]). +
-  * A short length of ribbon cable. +
-  * Seven (7) laser-cut acrylic pieces. +
-  * Eleven (11) 1/2" #4-40 machine screws. +
-  * Twelve (12) #4-40 steel nuts. +
-  * Not shown: a short length of heat-shrink tube. +
- +
-{{ :​tutorials:​products:​iotp:​kit-parts.jpg?​nolink&​ |}} +
- +
-Because many users already have Arduino hardware, **the kit does not include microcontroller and/or network boards**. You will need to additionally purchase or bring: +
-  * an [[http://www.adafruit.com/​products/​418|Arduino Ethernet]] board and a USB-to-serial programming adapter such as the [[https://​www.adafruit.com/​products/​284|FTDI Friend]] or [[https://​www.adafruit.com/​products/​70|TTL-232 Cable]]. +
--or- +
-  * an [[http://​www.adafruit.com/​products/​50|Arduino Uno]] board and [[http://​www.adafruit.com/​products/​201|Ethernet Shield]]. +
-Directions are provided for both. In either case, you will also need: +
-  * Cables for USB programming and Ethernet. +
- +
-{{ :​tutorials:​products:​iotp:​board-selection.jpg?​nolink&​ |}} +
- +
-Not included with the kit, the following tools are needed: +
-  * Soldering iron and solder. +
-  * Small Phillips screwdriver. +
-  * Optional: tape, pliers. +
-  * Not shown: wire cutters and strippers, lighter or heat gun for heat-shrink. +
- +
-{{ :​tutorials:​products:​iotp:​other-tools.jpg?​nolink&​ |}} +
-==== Preparation ==== +
-  * If using the Arduino Ethernet (board, not shield), gently remove the 6-pin 90-degree male programming header from its socket. +
-  * If using the Arduino Uno + Ethernet Shield, remove the Ethernet Shield if it's currently installed. +
-  * Peel the backing paper off the acrylic parts. This may create a static charge, so building the kit with a grounding mat or wrist strap is recommended. +
-  * If using Ethernet Shield, there'​s an extra cutout on the back piece of the acrylic case that can be snapped off using finger pressure or pliers. If sharp points remain, trim with wire cutters or a file. If using the Arduino Ethernet, leave this cutout in place. +
- +
-{{ :​tutorials:​products:​iotp:​cutout.jpg?​nolink&​ |}} +
- +
-  * Note the unique Ethernet MAC address on the board — usually a white sticker on the bottom. You will need this later, so write it down or snap a photo. +
- +
-{{ :​tutorials:​products:​iotp:​mac-addr.jpg?​nolink&​ |}} +
- +
-==== Assembly ==== +
- +
-=== 1: Prepare pin headers === +
-  * Using pliers or wire cutters, snap off three sections of pin header: two, three and five pins. +
-{{ :​tutorials:​products:​iotp:​headers.jpg?​nolink&​ |}} +
-  * If using an Arduino Uno with Ethernet Shield, the threeand five-pin headers should be bent at 90 degrees to allow clearance inside the case. This can be done with a firm grip and pliers, or you may want to use a bench vise. The 2-pin header can be left straight. You do not need to bend headers if using an Arduino Ethernet board. +
-{{ :​tutorials:​products:​iotp:​header-bent.jpg?​nolink&​ |}} +
- +
-=== 2: Prepare ribbon cable, power button === +
-  * Peel away five strands from the ribbon cable. Here we'll be using the brown, red, orange, yellow and green conductors. Save the other wires, they'​ll be used in a later step. +
-  * Strip about 1/4" (6mm) of insulation from these five wires. +
-  * Twist the ends of the orange and red wires together. +
-{{ :​tutorials:​products:​iotp:​ribbon.jpg?​nolink&​ |}} +
-  * The power button has five solder legs. Looking at the back of the button, turn it so that the legs are toward the bottom, forming a "​smile"​ arrangement. Then use the following guide to solder the wires to the legs shown. Note that the **second leg is not connected**,​ and the **fourth leg is joined to both the orange and red wires**. +
-{{ :​tutorials:​products:​iotp:​power-button.jpg?​nolink&​ |}} +
-  * Locate the top piece to the acrylic case (it has a large rectangular cutout for the thermal ​printer, and a smaller circular cutout for the power button). Feed the ribbon cable through the round hole, then secure the power button with the included nut. (This acrylic piece is symmetrical — there is no "​top"​ or "​bottom,"​ so you can insert the button through either side.) +
-{{ :​tutorials:​products:​iotp:​threaded.jpg?​nolink& ​|}} +
-  * The wires of the ribbon cable can now be separated — but leave about 2 inches (toward the power button) intact for sturdiness. Peel apart the remaining length of the green, yellow and orange wires. The red and brown wires can be left mostly together — peel apart about 2 inches near the end. +
- +
-=== 3: Install DC power jack === +
-  * Locate the back piece of the acrylic case (with the Adafruit logo) and insert the DC power jack from the outside, then secure it from the inside with the included nylon nut. +
-{{ :​tutorials:​products:​iotp:​dc-jack-outside.jpg?​nolink&​ |}} +
-  * Peel away two more strands from the unused section of ribbon cable. Here we'll use black and white. Strip about 1/4" of insulation and twist these together. +
-  * Solder the black and white wires to the **outer** of the two smaller legs on the DC jack. The inner of these two legs is **not connected**. +
-  * Solder the yellow wire (from the power switch) to the large center leg on the DC jack. **The top and back case pieces are now conjoined by this wire and cannot be separated — be careful to always move these two parts together.** +
-{{ :​tutorials:​products:​iotp:​dc-jack-inside.jpg?​nolink&​ |}} +
- +
-=== 4: Solder row headers === +
- +
-  * Strip about 1/2" (13mm) of insulation from all of the unconnected wire ends, and twist each to prevent fraying. +
-{{ :​tutorials:​products:​iotp:​stripped.jpg?​nolink&​ |}} +
-  * The wires are then soldered to the row headers. Pinch the tip of a wire against the header'​s plastic support and wrap the wire around the pin. Solder in place, then use wire cutters to snip off the starting bit of wire. +
-{{ :​tutorials:​products:​iotp:​header-solder.jpg?​nolink&​ |}} +
-  * The 5-pin header has only a single green wire connected. This is normal. Use the following photo and wiring diagram for reference:​ +
-{{ :​tutorials:​products:​iotp:​header-trio.jpg?​nolink&​ |}} +
- +
-{{ :​tutorials:​products:​iotp:​diagram.png?​nolink&​ |}} +
- +
-**Important:​** the solder connections to the black and orange wires should be covered with heat-shrink tube. They'​re shown bare in the images above to identify the connections more clearly, but really do need protection. Slide a bit of heat-shrink tube over each wire first, solder the wires to the headers, then heat with a lighter or heat gun to secure the tubing. +
- +
-{{ :​tutorials:​products:​iotp:​insulation.jpg?​nolink&​ |}} +
- +
-Don't plug the headers into anything just yet. We'll refer back to this diagram later. +
- +
-=== 5: Install printer in top plate === +
- +
-  * Slide the thermal printer through the large cutout in the top piece of the case: +
- +
-{{ :​tutorials:​products:​iotp:​printer-insert.jpg?​nolink&​ |}} +
- +
-  * Secure the printer using the two plastic wedges. Screw down __gently__ so as not to crack the acrylic. +
- +
-{{ :​tutorials:​products:​iotp:​printer-wedges.jpg?​nolink&​ |}} +
- +
-  * Connect the power and serial cables into the back of the printer. Note the functions of each wire as labeled on the printer — we'll refer back to these later. +
- +
-{{ :​tutorials:​products:​iotp:​printer-wires.jpg?​nolink&​ |}} +
- +
-=== 6: Attach board to bottom plate === +
- +
-This varies slightly between the Arduino Ethernet and the Uno + Ethernet Shield. In either case, **only three of the four mounting holes are used, but it's different for each board type.** +
- +
-**For Arduino Ethernet Board:** +
-  * **The mounting hole near the DC power jack is NOT used!** +
-  * Insert a screw in the mounting hole near the Ethernet jack and secure it in place with a nut. +
-{{ :​tutorials:​products:​iotp:​ethernet-screw.jpg?​nolink&​ |}} +
-  * Insert screws in the remaining two holes near the microSD card slot. **Do NOT secure these with nuts yet.** +
-  * Place board on bottom plate by feeding the three screws through the corresponding holes. +
-  * Secure the three screws with nuts. +
-  * The 6-pin programming header can now be reinstalled. +
- +
-__Only__ the screw near the Ethernet jack has the extra "​standoff"​ nut — the others pass straight through. Once installed, the board will be very slightly canted. This is normal and won't show once finished, and does not adversely affect operation. +
- +
-**For Arduino Uno + Shield:** +
-  * **The mounting hole nearest the USB connector is NOT used!** +
-  * Insert three screws in the remaining holes — one near the DC power jack, and in the remaining two holes at the far end of the board. +
-  * Place board on plate by feeding the three screws through the corresponding holes. +
-  * Secure the three screws with nuts. +
-  * The Ethernet shield can now be installed on top of the board. +
-With this board combination,​ you will have an extra unused nut when finished. Once installed, the board will be very slightly canted. This is normal and won't show once finished, and does not adversely affect operation. +
- +
-{{ :​tutorials:​products:​iotp:​screws.jpg?​nolink&​ |}} +
- +
-=== 7: Join first case side === +
- +
-  * Identify the two acrylic side pieces. These are interchangeable;​ there is no right or left, but there //is// a specific orientation:​ +
-{{ :​tutorials:​products:​iotp:​sides.jpg?​nolink&​ |}} +
-  * Identify the "​middle"​ acrylic piece. This is the only piece not spoken for yet. It has a small round bite out of one end, and a large square bite out of the other (these are the top and bottom, respectively). +
-  * The case is assembled using "​T-slot"​ construction. Holding the middle piece, insert a nut into the cross part of a "​T"​. Place one of the side pieces, using the alignment slot toward the front, over the corresponding tab on the middle piece, then insert a screw into the hole that's aligned with the nut. If this is a dexterity challenge, the nut can also be held with tape: +
-{{ :​tutorials:​products:​iotp:​t-slot.jpg?​nolink&​ |}} +
-  * Make sure the tops of the two pieces are correctly oriented. Insert a second nut and screw, and just finger-tighten for now. +
-{{ :​tutorials:​products:​iotp:​first-join.jpg?​nolink&​ |}} +
- +
-=== 8: Join case back and second case side === +
- +
-  * Things start to get tricky now — the back and top pieces of the case are joined by a wire at this point, so the two can't be separated very far. Work slowly and methodically to make sure you don't break the wire or get anything tangled. +
-  * Connect the back piece to the first side using the same T-slot technique:​ +
-{{ :​tutorials:​products:​iotp:​back-installed.jpg?​nolink&​ |}} +
-  * **Route the yellow wire under the bottom of the case,** then install the second side using two more screws and nuts. Just finger-tight for now, and it's okay if the box isn't perfectly square at this stage. +
-{{ :​tutorials:​products:​iotp:​second-side.jpg?​nolink&​ |}} +
- +
-=== 9: Install case top === +
- +
-  * Route the two cables from the printer (power and serial) down through the middle of the box. +
-  * On **one side** of the case, loosen the two **lower** screws just a couple of turns. Then loosen, //but do not completely remove,// the two **upper** screws on the same side. The tip of the screw should be flush with the face of the nut. The side piece can then pivot upward slightly. +
-{{ :​tutorials:​products:​iotp:​loosen-screws.jpg?​nolink&​ |}} +
-  * On the opposite side of the case, insert the top piece into the two alignment slots. +
-  * Pivot the loose side piece upward, press the case top into place, then re-tighten the four side screws (finger-tight is sufficient for now). +
-{{ :​tutorials:​products:​iotp:​top-insert.jpg?​nolink&​ |}} +
- +
-=== 10: Connect wires and install case bottom === +
- +
-  * Connect 3-pin header to Arduino power pins. Two wires — white and brown — connect to GND, while the red wire connects to 5V. +
-  * Connect 5-pin header to Arduino pins 3 through 7. The single green wire should go to pin 3, and there will now be bare protruding pins. +
-  * Press the serial socket (3 wires) from the printer onto the protruding pins 5, 6 and 7. The green wire should go to pin 5, yellow wire to pin 6, and black wire to pin 7. Pin 4 (reserved for the SD card socket) is not used…here we've clipped off the exposed pin to avoid installing the printer socket in the wrong position: +
-{{ :​tutorials:​products:​iotp:​5pin.jpg?​nolink&​ |}} +
-  * Connect 2-pin header to the power socket (2 wires) from the printer. Orange connects to red, and black to black. Because this connection doesn'​t go to a fixed socket, it could shift around inside the case and come in contact with exposed metal. Danger! **It is vitally important to cover this exposed header with a bit of tape, heat-shrink tube, or a dollop of Sugru. Go do that if you haven'​t already.** +
-{{ :​tutorials:​products:​iotp:​insulate.jpg?​nolink&​ |}} +
-  * The case bottom is installed similarly to the top, just inverted. Loosen the two upper screws on one side a couple of turns, and the two corresponding lower screws to where the tip is flush with the nut, allowing the side to pivot slightly outward. You might want to loosen the screws on //both// sides of the case. Stuffing the wires into the case makes this perhaps the most fussy step of the whole kit, and the extra wiggle room can be helpful. +
-{{ :​tutorials:​products:​iotp:​bottom-install.jpg?​nolink&​ |}} +
-  * Once the bottom is in place, finger-tighten all the side screws. +
- +
-=== 11: Install front face === +
- +
-  * One last time with the screw-loosening trick…this time around with the front of the case, enough to insert the tabs from the white acrylic front piece into the circular holes in the side pieces. There are only two tabs here…it acts as a hinge. +
-{{ :​tutorials:​products:​iotp:​hinge.jpg?​nolink&​ |}} +
-  * Be sure to orient the "​@"​ sign the correct way: +
-{{ :​tutorials:​products:​iotp:​at-sign.jpg?​nolink&​ |}} +
-  * Finally, all 8 case screws can be tightened. Finger-tight plus about 1/8 turn should suffice…not //too// tight or the acrylic could crack! +
-==== Download ==== +
- +
-In addition to the [[http://arduino.cc/​en/​Main/​Software|Arduino IDE software itself]] (if not already installed), two downloads are required: +
-  - First, retrieve the thermal printer Arduino library [[https://​github.com/​adafruit/​Adafruit-Thermal-Printer-Library|from our repository on GitHub]]. Click the DOWNLOAD ZIP button near the upper left, extract the archive and then rename the uncompressed folder to ''​Thermal''​. Confirm that this folder contains the files ''​Thermal.cpp''​ and ''​Thermal.h''​ and the ''​examples''​ folder.{{ :​tutorials:​products:​iotp:​git.png?​nolink&​ |}} +
-  - Second, download the Adafruit "Tweet Receipt"​ code [[https://​github.com/adafruit/​Adafruit-Tweet-Receipt|from its own repository]],​ extract the archive and then rename the uncompressed folder to ''​Gutenbird''​. Confirm that this folder contains the file ''​Gutenbird.ino''​. **This code is reliant on Arduino 1.0 features and will not work with Arduino 0023 or earlier.** +
-Place the ''​Thermal''​ folder inside your Arduino ''​Libraries''​ folder. You may need to create this folder if it does not yet exist. In Windows, this would be ''​(home folder)\My Documents\Arduino\Libraries''​ and for Mac or Linux is ''​(home folder)/​Documents/​Arduino/​Libraries''​ [[http://​www.ladyada.net/​library/​arduino/​libraries.html|We also have a tutorial on library installation]]. +
- +
-Place the ''​Gutenbird''​ folder inside your Arduino sketch folder. +
- +
-After installing both the library and sketch, restart the Arduino IDE. You should now be able to access the Twitter sketch by navigating through the menus: File->​Sketchbook->​Gutenbird +
- +
-==== Program the Arduino ==== +
- +
-  * You'll want to edit the Gutenbird sketch to match your particular network setup. First, edit the Ethernet MAC address to match the value you previously wrote down from the sticker on your Arduino Ethernet board or shield. +
-{{ :​tutorials:​products:​iotp:​code-changes.png?​nolink&​ |}} +
-  * The code uses DHCP (which dynamically assigns an IP address) by default. If your network doesn'​t use DHCP, or if you just want to provide a fallback address in case of a problem, edit the ''​IPAddress''​ value in the code. +
-  * As written, the sketch will search for Tweets originating from Adafruit, but you can change this to any search string supported by the Twitter Search API. Refer to the SEARCH OPERATORS section of the [[https://​dev.twitter.com/​docs/​using-search|Twitter Developers Documentation]] for guidance. +
-  * If using the Arduino Ethernet board, flip up the front face of the enclosure and connect an FTDI Friend or other USB-to-serial adapter to the programming header on the board. If using an Arduino Uno, use the USB port on the back of the box. +
-{{ :​tutorials:​products:​iotp:​front-flap.jpg?​nolink&​ |}} +
-  * Select your board type and serial port from the Arduino IDE //Tools// menu, build the sketch and upload to the board. USB can now be disconnected;​ the box will operate standalone. +
-==== Use it! ==== +
- +
-  * Attach Ethernet and power cables to the back of the unit. The other ends should be connected to your network router and the included DC power adapter, respectively. +
-  * Install a roll of thermal receipt paper in the printer. This is accessed by pulling up the lever to the left side of the paper slot. Install the paper to unroll "​underhand"​ as it passes up through the slot. +
-{{ :​tutorials:​products:​iotp:​paper_cables.jpg?​nolink&​ |}} +
-  * Press the power button on top — it's somewhat recessed and you'll need to press it in with a fingertip. If everything is working correctly, the green power light should pulse, then shine steadily during network access, and then the most recent Adafruit Tweet will be printed. +
-  * Once per minute, the printer will contact the Twitter server and print any new Tweets. +
- +
-=== Other IoT Printer Software === +
- +
-  * The [[http://​newsinternational.github.com/​iot-assistant/​|Internet of Things Assistant]] is a self-hosted Ruby on Rails-based application that turns your IoT Printer into a handy assistant that will print out snippets of information you tell it to at a certain time of day. For example you could set it to print your unread emails, calendar, and recent tweets at 8am. +
- +
-=== Troubleshooting === +
- +
-  * If the unit does not appear to be working, first open the front flap and check for any LED power indicator on the Arduino board. If there'​s no light, the power supply might not be plugged in, or there may be an electrical short in your wiring. Reverse the assembly steps to open the box and check all your wiring. +
-  * If the green status light comes on but Tweets are never printed, connect a USB cable and use the Serial Monitor in the Arduino IDE (set the line speed to 57600 baud). The sketch will show its current status at each stage of its operation. Most likely, the network settings will need to be edited. +
-  * It might also be a simple paper issue. Open the printer top latch and confirm that thermal paper is loaded and properly fed out the top. +
-  * If you turn on green button while holding down the little black button next to the printer'​s green LED it will do a small print test, that can help determine if you're having printing issues as well +
-  * "Help! My printer just prints gibberish!"​ Your printer may have been factory configured for a different baud rate. Try the following:​ +
- +
-    *  Hold down the button on top of the printer while turning it on. A test page should print showing the font table and some diagnostic information. Look for the line that reads '​BAUDRATE':​ +
- +
-{{ :​tutorials:​products:​thermalprinter:​test-baud.jpg?​nolink&​ |}} +
- +
-    * Most printers arrive from the factory set for 19200 baud, but a few may be set to 9600. This will //not// negatively impact the performance of your unit! The speed of the paper through the printer is already much less than this and you will not see any difference…it'​s strictly a data protocol issue of getting the microcontroller and printer communicating. So, if you do have a 9600 baud printer, you'll need to edit the library file ''​Adafruit_Thermal.cpp'',​ changing this line: +
- +
-  _printer->​begin(19200);​ +
- +
-    * to this: +
- +
-  _printer->​begin(9600);​ +
- +
-    * Recompile and upload the sketch to the Arduino board, and the output should now be legible.+
/home/ladyada/public_html/wiki/data/attic/tutorials/products/iotp.1338240383.txt.gz · Last modified: 2016/01/28 18:05 (external edit)