Project

General

Profile

LAOS I2C Panel v03 » History » Version 24

KalleP, 2013-11-01 08:54

1 1 Anonymous
h1. LAOS I2C Panel v0.3
2
3
{{>toc}}
4
5 3 Anonymous
!>Panel-rev0.3.jpg!
6 1 Anonymous
7 23 jaap
%{color:red}This page documents version 0.3 of the I2C panel. The newer version, 0.4, is documented here: [[LAOS I2C Panel v0.4]]!%
8 6 Anonymous
9 1 Anonymous
h2. Basics
10
11
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.
12 17 peter
All the source files of this project are available in the i2c panel project on Github: https://github.com/LaosLaser/AddOns
13 1 Anonymous
14
h2. Functionality
15
16 19 KalleP
The user interface functionality is not implemented in this board, but in the program on the MBED. The on board ATMEGA with Arduino code only receives data for displaying on the screen and sends key press codes via I2C, basically this works as a tiny terminal. The functionality as stated here is just to show what the main LaOS controller board uses it for.
17 1 Anonymous
18
While no job is running:
19
20 19 KalleP
* 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)
21
* Moving the head to a specific location (jog in the X and Y axis)
22
* Select the current location and make that the origin (x=0, y=0, z=0)
23
* Select print job
24 1 Anonymous
25 19 KalleP
While a job is printing:
26 1 Anonymous
27 19 KalleP
* Pause current job
28
* Resume paused job
29
* Cancel current job
30 1 Anonymous
31
h2. Electronics
32
33 19 KalleP
We designed our own board and software (Arduino based) to connect the display board to the mainboard (via I2C interface). The schematics (in KiCAD) are located ["here":https://github.com/LaosLaser/AddOns]. 
34 18 jaap
35 19 KalleP
Most important parts:
36
37 1 Anonymous
"Full part list is available in GIT":https://github.com/LaosLaser/AddOns/raw/master/i2c-panel/pcb/bom.ods
38 18 jaap
39 19 KalleP
* 16x2 LCD Display, RS stocknummer 532-6408
40 1 Anonymous
* ATMega168P-20PU, RS stocknummer 696-2430
41 19 KalleP
* 4 Pushbuttons
42
* 1 Joystick button
43
* and of course, the PCB
44 4 Anonymous
45 1 Anonymous
!173px-Panel-rev0.3front.jpg!
46
47
h3. Bill of Materials
48
49
|_.Number|_.Component|_.RS Part No.|_.RS Price|_.Farnell Part No.|_.Farnell Price|_.Comment|
50
|1|LCD display, 16x2 characters|532-6408|€ 4,62| | ||
51
|1|ATMega168P-20PU|738-0375|€ 5,22|1636933|€ 4,81||
52
|4|Thru hole tactileswitch12x12x7.3mm|378-6763|€ 0,46| | ||
53
|1|PCB Stick switch, 4 dir + centre push|516-316|€ 2,46|1435775|€ 2,47||
54
|1|Ceramic resonator THT CSTLS 16.00MHz|526-6154|€ 0,56|1448129|€ 0,46||
55
|1|28way low profile DIL socket,0.3in pitch|801-768|€ 0,24| | ||
56
|1|100uF capacitor|711-0703|€ 0,03| | ||
57
|2|100nF capacitor|721-5240|€ 0,07| | ||
58
|1|680R resistor|707-7656|€ 0,02| | ||
59
|1|10K resistor|707-7745|€ 0,02| | ||
60
|1|36 way straight header,7mm top 3mm below|251-8632|€ 0,31| | ||
61
|1|NPN transistor,BC547C|545-2248|€ 0,07| | ||
62
|3|plastic buttoncap black|378-6943|€ 0,11| | ||
63
|1|plastic buttoncap red|378-6937|€ 0,11| | ||
64 22 jaap
|1|Eurocircuits PCB E412106| |€ 7,50| | |Available from LaOS (see "WebShop":http://tuxic.nl/webshop )|
65 1 Anonymous
66
h2. Mechanical construction
67
68 19 KalleP
* PCB is positioned directly under the display
69
* I2C communication is through a 4-pin flatcable with pin-header
70
* A 6-pin (USB->TTL) connector is available for easy updates of the Arduino
71 1 Anonymous
* 4 standard pushbuttons
72 19 KalleP
* 1 Joystick button (with 3D printed key cap)
73 18 jaap
74 19 KalleP
The design files for a frontpanel and buttons can be found here: ["Frontplates":https://github.com/LaosLaser/AddOns/tree/master/i2c-panel/frontplates]
75 1 Anonymous
76
h2. Implementation
77 15 peter
78 19 KalleP
The Arduino software on the ATMEGA chip is "available on github":https://github.com/LaosLaser/AddOns/raw/master/i2c-panel/firmware/lasercutterpanelv0_3.pde.
79 1 Anonymous
80
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.
81
82
Relevant Arduino libraries:
83
84
* LCD driver: "http://www.arduino.cc/en/Reference/LiquidCrystal":http://www.arduino.cc/en/Reference/LiquidCrystal
85
* i2c: "http://www.arduino.cc/en/Reference/Wire":http://www.arduino.cc/en/Reference/Wire
86
* Keypad: "http://www.arduino.cc/playground/Code/Keypad":http://www.arduino.cc/playground/Code/Keypad
87
88
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>
89 5 Anonymous
90 1 Anonymous
For debugging, you can use any PC with a home-made I2C adapter:
91
92
p(((. http://www.instructables.com/id/Worlds-Cheapest-I2C-I-Squared-C-Adapter/
93
http://www.paintyourdragon.com/?p=43
94
95
96
h2. Building your own
97
98 22 jaap
To make life easier, we sell premade PCB's and this panel as a kit. See the "WebShop":http://tuxic.nl/webshop.
99 1 Anonymous
100
The kit contains:
101
102
* PCB
103
* 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-&gt;TTL cable).
104
* LCD
105
* other electronic parts
106
* Buttons
107
* I2C wire to motherboard
108
109
Parts it does not contain:
110
111 19 KalleP
* 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
112
* 3D Printed joystick button. When I design one I'm really proud of, I might include it.
113 1 Anonymous
114 19 KalleP
Feel free to make the user interface panel yourself if you prefer. No need to buy stuff if you have an Arduino lying around with LCD and some buttons!
115 1 Anonymous
116
h2. Soldering
117
118 19 KalleP
* Solder the socket for the Atmel IC first, making sure the notch is on the same side as the one on the silkscreen legend.
119
* Place the two resistors. The print says 680 (Ohm) for R1. Put the other one of 10k Ohm in the place marked R2.
120 1 Anonymous
* Solder the two 100nF capacitors
121 19 KalleP
* Solder the 100uF electrolytic capacitor with the plus (longer) wire in the hole with square solder pad
122
* Bend the wires of the BC547C so it lies flat on the print and solder in place
123
* Solder the 3 pin ceramic resonator
124 1 Anonymous
* Place a 2-pin header in P7, a 4-pin header for I2C and a 6-pin header in P1 (TTL).
125 19 KalleP
* Now take a 16-pin header and push it with the longer pin ends in the PCB from the bottom (solder) side of the board. The long pins will stick out on the top side of the board. The black plastic of the header in now on the bottom of the PCB. 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 (component) side.
126
* Place a strong piece of tape on the bottom side of the board, covering the part of the board that will be under the display module, so that there cannot be any shortcircuit between the board and the display module. You can use electric shielding tape or gaffer tape.
127
* Solder the display module on the back side board, with the black strip of the 16-pin header in between.
128
* Solder the 4 buttons to the board (not the joystick yet!) with the buttons on the side of the display (solder side). This is confusing: the buttons go on the side where it does NOT say button! See photos.
129 12 pieterb
* 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.
130
* The holes you have left are for making wire-bridges on a single sided board. You don't need them.
131 11 pieterb
132 12 pieterb
Back panel
133
!I2CPanelBack-rev0.3.JPG!
134
135 24 KalleP
Front Panel showing dent in joystick.  Note also the middle pins are closer together at the LCD end of the switch when mounted on this PCB.
136 12 pieterb
!I2CPanelFront-rev0.3.JPG!
137
138 11 pieterb
Showing connection on the I2C Panel side
139 1 Anonymous
!I2CPanelBankConnector-rev0.3.JPG!
140
141
Showing connection on the Main Board side
142
!IC2PanelConnectedToMainBoard-rev0.3.jpg!
143
 
144
145 5 Anonymous
h2. Software installation
146 1 Anonymous
147
h3. Installing a bootloader
148
149
These instructions are for ATMEGA168P-PU only!
150
151
    cd arduino-1.0.1/hardware/arduino/bootloaders/atmega
152
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
153 5 Anonymous
154 1 Anonymous
155
Note that the Debian version of avrdude does not support m168p yet, you can use the avrdude version shipped with Arduino.
156
157
Error message while installing:
158
159
    avrdude: safemode: efuse changed! Was f8, and is now 0
160
Would you like this fuse to be changed back? [y/n]
161 15 peter
162
163
Answer n !
164 1 Anonymous
165 5 Anonymous
h3. Arduino Sketch
166 1 Anonymous
167
Use a USB=&gt;TTL cable to connect the board to your computer. Install "Arduino":http://www.arduino.cc software. Get "lasercutterpanelv0&#95;3.pde from GIT": https://github.com/LaosLaser/AddOns/raw/master/i2c-panel/firmware/lasercutterpanelv0_3.pde
168
169
To test your panel, change:
170
171
    #define DEBUG 0 
172
173
174
to
175
176
    #define DEBUG 1
177
178
179
Arduino settings: Board: Arduino NG or older with Atmega168
180
181 7 bartb
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.
182
183
If it works, upload the code again with *DEBUG 0*. The panel is now ready to be connected to the mainboard.
184
185
h2. Control Panel on the HPC LS3020
186
187 1 Anonymous
188
To accomodate the display you can cut a replacement for the control panel. 
189
190
!greenpanel-bart.jpg!
191
192 2 Anonymous
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.
193 1 Anonymous
194
h2. Design competition
195
196
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!
197
198
h2. Enhancements
199
200
Possible enhancements to the display:
201
202
* Make (I2C) connector holes slightly larger to be able to mount JST connector (also, some more clearance to micro controller is required)
203 19 KalleP
* Larger holes also for USB-&gt;TTL cable, display and switches
204
* Move capacitor U4 to a safer place, near micro controller
205
* Holes for R2 are too big and texts for resistors are strange
206
* Mark clearly on the board that the buttons go on the back side!
207 1 Anonymous
* Add status LED(s)
208 19 KalleP
* Buzzer?
209 1 Anonymous
* Rotary encoder for (power) settings
210
* Graphical touch-screen display?
211
212
h2. More
213
214
For links on previous versions and to get started on designing your own display, see the [[Display-alternatives]] page.