LAOS I2C Panel v03 » History » Version 3
Anonymous, 2012-07-14 20:57
1 | 1 | Anonymous | h1. LAOS I2C Panel v0.3 |
---|---|---|---|
2 | |||
3 | {{>toc}} |
||
4 | |||
5 | 3 | Anonymous | !>Panel-rev0.3.jpg! |
6 | 1 | Anonymous | |
7 | h2. Basics |
||
8 | |||
9 | We designed a panel with a 2x16 LCD, 4 buttons and a joystick. The heart of the panel is a ATMEGA168-20PU running a small Arduino program. The panel uses I2C communication to the MBED board, but there is also a connection for a standard USB->TTL cable. You can use such a cable to upgrade the program in the Arduino chip. |
||
10 | |||
11 | h2. Functionality |
||
12 | |||
13 | _The functionality is not implemented in this board, but in the program on the MBED. The Arduino only receives data for the screen and sends keys via I2C. The functionality is stated here just to show what it will do_ |
||
14 | |||
15 | While no job is running: |
||
16 | |||
17 | * manual focus, using up and down buttons (for some machines this will mean that the Z-axis is moving, others will move the lens-holder up and down) |
||
18 | * moving the head to a specific location (X-Y axis) |
||
19 | * select the current location and make that the origin (x=0, y=0, z=0) |
||
20 | * select print job |
||
21 | |||
22 | while job is printing: |
||
23 | |||
24 | * pause printing / continue / cancel |
||
25 | |||
26 | h2. Electronics |
||
27 | |||
28 | We designed our own board and software (arduino based) to connect the display board to the mainboard (via I2C). The schematics (in KiCAD) are located ["here":https://tuxic.nl/laos/hardware/panel/]. Most important parts: |
||
29 | |||
30 | ["Full part list is available in SVN":https://tuxic.nl/laos/hardware/panel/pcb/bom.ods] |
||
31 | |||
32 | * "16x2 LCD Display, RS stocknummer 532-6408, € 5,71":https://laoslaser.org/laos/hardware/panel/Datasheets/0900766b806dda16.pdf |
||
33 | * ATMega168P-20PU, RS stocknummer 696-2430 |
||
34 | * 4 pushbuttons |
||
35 | * 1 joystick button |
||
36 | * and of course, the board |
||
37 | |||
38 | "!/images/thumb/f/f3/Panel-rev0.3front.jpg.jpeg/173px-Panel-rev0.3front.jpg.jpeg(Panel-rev0.3front.jpg.jpeg)!":/index.php/File:Panel-rev0.3front.jpg.jpeg"!/images/thumb/c/c6/Panel-rev0.3back.jpg.jpeg/173px-Panel-rev0.3back.jpg.jpeg(Panel-rev0.3back.jpg.jpeg)!":/index.php/File:Panel-rev0.3back.jpg.jpeg"!/images/thumb/d/d7/Panel-rev0.3schema.jpg/137px-Panel-rev0.3schema.jpg(Panel-rev0.3schema.jpg)!":/index.php/File:Panel-rev0.3schema.jpg |
||
39 | |||
40 | h3. Bill of Materials |
||
41 | |||
42 | |_.Number|_.Component|_.RS Part No.|_.RS Price|_.Farnell Part No.|_.Farnell Price|_.Comment| |
||
43 | |1|LCD display, 16x2 characters|532-6408|€ 4,62| | || |
||
44 | |1|ATMega168P-20PU|738-0375|€ 5,22|1636933|€ 4,81|| |
||
45 | |4|Thru hole tactileswitch12x12x7.3mm|378-6763|€ 0,46| | || |
||
46 | |1|PCB Stick switch, 4 dir + centre push|516-316|€ 2,46|1435775|€ 2,47|| |
||
47 | |1|Ceramic resonator THT CSTLS 16.00MHz|526-6154|€ 0,56|1448129|€ 0,46|| |
||
48 | |1|28way low profile DIL socket,0.3in pitch|801-768|€ 0,24| | || |
||
49 | |1|100uF capacitor|711-0703|€ 0,03| | || |
||
50 | |2|100nF capacitor|721-5240|€ 0,07| | || |
||
51 | |1|680R resistor|707-7656|€ 0,02| | || |
||
52 | |1|10K resistor|707-7745|€ 0,02| | || |
||
53 | |1|36 way straight header,7mm top 3mm below|251-8632|€ 0,31| | || |
||
54 | |1|NPN transistor,BC547C|545-2248|€ 0,07| | || |
||
55 | |3|plastic buttoncap black|378-6943|€ 0,11| | || |
||
56 | |1|plastic buttoncap red|378-6937|€ 0,11| | || |
||
57 | |1|Eurocircuits PCB E412106| |€ 7,50| | |Available from LaOS (see [[WebShop]])| |
||
58 | |||
59 | h2. Mechanical construction |
||
60 | |||
61 | * printboard is directly under the display |
||
62 | * i2c through a 4-pin flatcable with pin-header |
||
63 | * 6-pin USB->TTL connector for easy updates on the Arduino |
||
64 | * 4 standard pushbuttons |
||
65 | * 1 3D-printed joystick button |
||
66 | |||
67 | The design files for the frontpanel and buttons can be found here: ["Frontplates":https://tuxic.nl/laos/hardware/panel/frontplates/] |
||
68 | |||
69 | h2. Implementation |
||
70 | |||
71 | The software on the arduino chip is "available in SVN":https://tuxic.nl/laos/hardware/panel/firmware. |
||
72 | |||
73 | The electronics are based on "John Crouchley's ATTiny2313":http://john.crouchley.com/blog/archives/612 implementation. The Arduino (or Ottantotto) electronics come from "Edwin Dertien":http://wiki.edwindertien.nl/doku.php?id=boards:ottantotto:start#pin_description. |
||
74 | |||
75 | Relevant Arduino libraries: |
||
76 | |||
77 | * LCD driver: "http://www.arduino.cc/en/Reference/LiquidCrystal":http://www.arduino.cc/en/Reference/LiquidCrystal |
||
78 | * i2c: "http://www.arduino.cc/en/Reference/Wire":http://www.arduino.cc/en/Reference/Wire |
||
79 | * Keypad: "http://www.arduino.cc/playground/Code/Keypad":http://www.arduino.cc/playground/Code/Keypad |
||
80 | |||
81 | I2C on the Mbed: "http://mbed.org/handbook/I2C":http://mbed.org/handbook/I2C <em>"Have a look at this very enlightning drawing!":http://mbed.org/media/uploads/ColonelPewter/i2c_001004.gif</em> |
||
82 | |||
83 | For debugging, you can use any PC with a home-made I2C adapter: |
||
84 | |||
85 | bc. http://www.instructables.com/id/Worlds-Cheapest-I2C-I-Squared-C-Adapter/ |
||
86 | http://www.paintyourdragon.com/?p=43 |
||
87 | |||
88 | |||
89 | h2. Building your own |
||
90 | |||
91 | To make life easier, we sell premade PCB's and this panel as a kit. See the "WebShop":/index.php/WebShop. |
||
92 | |||
93 | The kit contains: |
||
94 | |||
95 | * PCB |
||
96 | * ATMEGA168-20PU, pre-programmed with the Arduino bootloader and this I2C program (so you can install it even if you do not own a USB->TTL cable). |
||
97 | * LCD |
||
98 | * other electronic parts |
||
99 | * Buttons |
||
100 | * I2C wire to motherboard |
||
101 | |||
102 | Parts it does not contain: |
||
103 | |||
104 | * laser cut panel. You can make one on your laser, maybe? Probably you want one to fit into your machine, anyway. See below for the panel the MiniFabLab made for its HPC LS3020 |
||
105 | * 3D printed joystick button. When I design one I'm really proud of, I might include it. |
||
106 | |||
107 | Feel free to make the panel yourself if you prefer. No need to buy stuff if you have an Arduino lying around with LCD and some buttons! |
||
108 | |||
109 | h2. Soldering |
||
110 | |||
111 | * Solder the foot for the Arduino first, making sure the notch is on the same side as the one on the print. |
||
112 | * Place the two resistors. The print says 680 for Resistor 1, which means 680 ohm. Put another one of 10k Ohm in the place marked R2. |
||
113 | * Solder the two 100nF capacitors |
||
114 | * Solder the 100uF capacitor with the plus in the square hole |
||
115 | * Bend the wires of the BC547C so it's flat on the print |
||
116 | * Place the ceramic filter |
||
117 | * Place a 2-pin header in P7, a 4-pin header for I2C and a 6-pin header in P1 (TTL). |
||
118 | * Now take a 16-pin header and push it with the long side in the board from the back of the board. The long pins will stick out on the top side of the board. On the back is the black plastic of the header. Measure with the display module to see if the pins are long enough to go just through the module. Solder the 16-pin header to the board on the TOP side of the board (where the rest of the components is). |
||
119 | * Place a strong piece of tape on the back side of the board, covering the part of the board that will be under the display module, so that there cannot be any shortcut between the board and the display module. You can use electric shielding tape or gaffer tape. |
||
120 | * Solder the display module on the back side board, with the black blocks of the 16-pin header in between. |
||
121 | * Solder the 4 buttons in the board (not the joystick yet!) with the buttons on the side of the display. This is confusing: the buttons go on the side where it does NOT say button! See photos. |
||
122 | * The joystick has a very small dent in the top metal layer. If you put the joystick in, this dent should be on the right side. Solder it in. |
||
123 | * The holes you have left are for making wire-bridges on a single sided board. You don't need them. |
||
124 | |||
125 | h2. Software installation |
||
126 | |||
127 | h3. Installing a bootloader |
||
128 | |||
129 | These instructions are for ATMEGA168P-PU only! |
||
130 | |||
131 | bc. cd arduino-1.0.1/hardware/arduino/bootloaders/atmega |
||
132 | avrdude -p m168p -c usbasp -F -U flash:w:ATmegaBOOT_168_diecimila.hex -U hfuse:w:0xdd:m -U lfuse:w:0xff:m -U efuse:w:0xf8:m |
||
133 | |||
134 | |||
135 | Note that the Debian version of avrdude does not support m168p yet, you can use the avrdude version shipped with Arduino. |
||
136 | |||
137 | Error message while installing: |
||
138 | |||
139 | bc. avrdude: safemode: efuse changed! Was f8, and is now 0 |
||
140 | Would you like this fuse to be changed back? [y/n] |
||
141 | |||
142 | |||
143 | Answer n ! |
||
144 | |||
145 | h3. Arduino Sketch |
||
146 | |||
147 | Use a USB=>TTL cable to connect the board to your computer. Install "Arduino":http://www.arduino.cc software. Get "lasercutterpanelv0_3.pde from SVN":https://tuxic.nl/laos/hardware/panel/firmware/lasercutterpanelv0_3.pde. To test your panel, change: |
||
148 | |||
149 | bc. #define DEBUG 0 |
||
150 | |||
151 | |||
152 | to |
||
153 | |||
154 | bc. #define DEBUG 1 |
||
155 | |||
156 | |||
157 | Arduino settings: Board: Arduino NG or older with Atmega168 |
||
158 | |||
159 | Upload the file to the board. This will give you a welcome text. After the text has disappeared, all buttons should show a number on the screen. The joystick should show 5 different values for each direction and middle push. |
||
160 | |||
161 | If it works, upload the code again with *DEBUG 0*. The panel is now ready to be connected to the mainboard. |
||
162 | |||
163 | h2. Control Panel on the HPC LS3020 |
||
164 | |||
165 | To accomodate the display you can cut a replacement for the control panel; like the green one on top of this page. The button laser switch was replaced by a toggle for better on/off reference. So the right serial test button could be omitted. Also the lighting switch was removed, now the light is always on. No modifications are required for the cabletree, just connect the wires from the removed switches. The air pump switch was kept as a compressor can be noisy. It is advised to use a shielded cable between the I2C panel and the board. A cutting file (.svg) of this panel is available on "miniFabLab":http://minifablab.nl/uploads/LaOS3020panel.svg. |
||
166 | |||
167 | h2. Design competition |
||
168 | |||
169 | I couldn't find a fitting existing joystick button for the joystick in this design, so I made one on the 3D printer. But I'm not entirely happy with it yet. If you design a better one, please upload it here! |
||
170 | |||
171 | 2 | Anonymous | h2. Enhancements |
172 | 1 | Anonymous | |
173 | Possible enhancements to the display: |
||
174 | |||
175 | * Make (I2C) connector holes slightly larger to be able to mount JST connector (also, some more clearance to micro controller is required) |
||
176 | * larger holes also for USB->TTL cable and display |
||
177 | * move capacitor U4 to a safer place, near micro controller |
||
178 | * holes for R2 are too big and texts for resistors are strange |
||
179 | * mark clearly on the board that the buttons go on the back side! |
||
180 | * Add status LED(s) |
||
181 | * buzzer? |
||
182 | * Rotary encoder for (power) settings |
||
183 | * Graphical touch-screen display? |
||
184 | |||
185 | h2. More |
||
186 | |||
187 | More ideas about I2C panels? See "display-alternatives":/index.php/Display-alternatives. |