Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| projekte:epson-stylus-sx100 [2016-06-03 22:41] – [Contact Image Sensor] cracki | projekte:epson-stylus-sx100 [2017-01-17 01:01] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== epson-stylus-sx100 ====== | ====== epson-stylus-sx100 ====== | ||
| - | |||
| - | Beschriftungen: | ||
| Bernd hat einen Epson Stylus SX 100 gedroppt. | Bernd hat einen Epson Stylus SX 100 gedroppt. | ||
| Line 9: | Line 7: | ||
| Uebrig sind: | Uebrig sind: | ||
| - | * Contact Image Sensor mit LEDs | + | * [[projekte: |
| * Schrittmotor (96 Schritte, 18 Ohm, ~0.2-0.3 Ampere) | * Schrittmotor (96 Schritte, 18 Ohm, ~0.2-0.3 Ampere) | ||
| * zwei DC Motoren, vmtl brushed | * zwei DC Motoren, vmtl brushed | ||
| Line 16: | Line 14: | ||
| ===== Contact Image Sensor ===== | ===== Contact Image Sensor ===== | ||
| + | |||
| + | Beschriftungen: | ||
| + | |||
| + | Numerierung: | ||
| + | * Rohm: Pin 1 aussen. | ||
| + | * PCB: Pin 1 innen <- die nehmen wir | ||
| + | |||
| + | ==== Beleuchtung ==== | ||
| Die LEDs brauchen so 2-3 Volt, Strom ~20 mA bringt schon Licht. | Die LEDs brauchen so 2-3 Volt, Strom ~20 mA bringt schon Licht. | ||
| Line 21: | Line 27: | ||
| die TO Pins am PCB sind: V+, Blau, Rot, Gruen. | die TO Pins am PCB sind: V+, Blau, Rot, Gruen. | ||
| - | Numerierung: Flachbandkabel von oben kommend, Connector von innen nach aussen | + | Bei 5V Versorgung sollte mit folgenden Widerständen nach Erde gezogen werden fuer weisses Papier: Rot:50, Grün:50, Blau:220. |
| + | < | ||
| + | Spannung 1 mA: | ||
| ^ + \ - ^ 1 ^ 2 ^ 3 ^ 4 ^ 5 ^ Beschreibung des Pins ^ | ^ + \ - ^ 1 ^ 2 ^ 3 ^ 4 ^ 5 ^ Beschreibung des Pins ^ | ||
| - | | 1 | x | | + | | 1 | x | | | | | N/C (so weit sich erkennen laesst) | |
| - | | 2 | | + | | 2 | | x | | | | LED GND Rot | |
| - | | 3 | | | x | | | + | | 3 | | |
| - | | 4 | | + | | 4 | |
| - | | 5 | | + | | 5 | | R | G | B | x | LED + | |
| + | |||
| + | ==== Datensignale ==== | ||
| + | |||
| + | Spannung 1 mA: | ||
| + | ^ + \ - ^ 6 ^ 7 ^ 8 ^ 9 ^ | ||
| + | | 6 | x | <typo bg:# | ||
| + | | 7 | <typo bg:# | ||
| + | | 8 | <typo bg:# | ||
| + | | 9 | <typo bg:# | ||
| + | | 10 | <typo bg:# | ||
| + | | 11 | <typo bg:# | ||
| + | | 12 | <typo bg:# | ||
| + | |||
| + | ==== Insgesamt ==== | ||
| + | |||
| + | sieht verdammt nach [[http:// | ||
| + | |||
| + | * 6 Startpuls | ||
| + | * 8 Clock | ||
| + | * 10 Vref (sollte auf GND fest) | ||
| + | * wenns hoeher ist, gibts kein gescheites bild mehr | ||
| + | * 11 DPI Mode | ||
| + | * macht auf jeden Fall, wieviele Clocks man pro Zeile rausholen kann | ||
| + | * 0/L: 300 dpi ~2600 clocks | ||
| + | * 1/H: 600 dpi ~5268 clocks | ||
| + | * nach anderen datenblaettern hat man 82 clocks " | ||
| + | * 600 dpi: 5184 pixels | ||
| + | * 300 dpi: 2592 pixels | ||
| + | * 12 Analog Out | ||
| + | * bei steigender Clock gehts scheinbar los (kommt von GND hoch fuer jeden Pixel neu, gefuehlte 100ns hier) | ||
| + | * bei fallender Clock sampeln klingt sinnvoll | ||
| + | |||
| + | ==== Operation ==== | ||
| + | |||
| + | Startpuls wird bei fallender Clock gesampelt. Wenn Startpuls, dann werden die Werte in den Ausgabepuffer geschickt. Dann mit Clock rauscyceln. Belichtungszeit haengt wohl vom Intervall zwischen Startpulsen ab. | ||
| + | |||
| + | Was ich mache (funktioniert, | ||
| + | |||
| + | * Werte -> Shiftregister, | ||
| + | * Puls hoch | ||
| + | * Clock hoch | ||
| + | * warte 500us | ||
| + | * Clock runter | ||
| + | * warte 500us | ||
| + | * Puls runter | ||
| + | * Shiftregister rausholen: | ||
| + | * Clock rauf (Signal geht los) | ||
| + | * warte 1us | ||
| + | * Clock runter (Signal sollte stabil sein, kann man sampeln) | ||
| + | * warte 1us | ||
| + | * so oft wie es pixel gibt | ||
| + | * restliche Belichtungszeit geben | ||
| + | * warte, 0-20 Millisekunden haben geklappt | ||
| + | |||
| + | ==== Arduino ==== | ||
| + | |||
| + | < | ||
| + | #define START 2 | ||
| + | #define CLOCK 3 | ||
| + | #define DPIMODE 4 | ||
| + | |||
| + | bool dpimode = 1; | ||
| + | uint16_t pixels = dpimode ? 5184 : 2592; | ||
| + | |||
| + | uint32_t linetime = 20000; // us | ||
| + | uint32_t sched = 0; | ||
| + | |||
| + | void setup() { | ||
| + | pinMode(START, | ||
| + | pinMode(CLOCK, | ||
| + | pinMode(DPIMODE, | ||
| + | |||
| + | digitalWrite(DPIMODE, | ||
| + | |||
| + | sched = micros(); | ||
| + | } | ||
| + | |||
| + | void loop() { | ||
| + | digitalWrite(START, | ||
| + | digitalWrite(CLOCK, | ||
| + | digitalWrite(CLOCK, | ||
| + | digitalWrite(START, | ||
| + | |||
| + | for (uint16_t counter = 0; counter < 82 + pixels; counter += 1) | ||
| + | { | ||
| + | PORTD |= _BV(PORTD3); | ||
| + | // | ||
| + | PORTD &= ~_BV(PORTD3); | ||
| + | // | ||
| + | } | ||
| + | |||
| + | sched += linetime; | ||
| + | int32_t dt = sched - micros(); | ||
| + | while (dt > 0x4000) | ||
| + | { | ||
| + | delayMicroseconds(0x4000); | ||
| + | dt -= 0x4000; | ||
| + | } | ||
| + | if (dt > 0) | ||
| + | delayMicroseconds(dt); | ||
| + | } | ||
| + | </ | ||
| + | ==== coloring code ==== | ||
| + | < | ||
| + | import re, colorsys | ||
| + | |||
| + | rex = re.compile(' | ||
| + | |||
| + | def color(value, | ||
| + | value = (value - min) / (max - min) | ||
| + | (r,g,b) = [int(v*255) for v in colorsys.hls_to_rgb(value, | ||
| + | return "# | ||
| + | |||
| + | def colorize(match): | ||
| + | value = match.group(1) | ||
| + | return '< | ||
| + | |||
| + | source = open(" | ||
| + | open(" | ||
| + | </ | ||
| + | |||
| + | ==== Bilder ==== | ||
| + | |||
| + | {{projekte: | ||
| + | |||
| + | {{projekte: | ||
| + | |||
| + | {{projekte: | ||
| - | ^ + \ - ^ 6 ^ 7 ^ 8 ^ 9 ^ 10 ^ 11 ^ 12 ^ Beschreibung des Pins ^ | ||
| - | | 6 | x | | | | | | | irgendwas, das einmal duenn ganz durch geht und viele Vias abzweigt | | ||
| - | | 7 | | x | | 1.46 | | | | eine fette Flaeche darunter | | ||
| - | | 8 | | 0.78 | x | | | | | so stiche in vias, die von oben runter kommen | | ||
| - | | 9 | 0.48 | 0.40 | 0.48 | x | 0.48 | 0.48 | 0.47 | fette flaeche zwischen dem durchgeher und den oberen lines | | ||
| - | | 10 | | 0.77 | | | x | | | fette flaeche wo die schrauben durchgehen (aber kein kontakt) | | ||
| - | | 11 | | 0.77 | | | | x | | line ueber der schraubenflaeche | | ||
| - | | 12 | | 0.77 | | | | | x | line nochmal ueber dieser | | ||