Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
projekte:epson-stylus-sx100 [2016-06-03 22:34] – [Contact Image Sensor] crackiprojekte:epson-stylus-sx100 [2016-06-14 22:56] – [epson-stylus-sx100] cracki
Line 1: Line 1:
 ====== epson-stylus-sx100 ====== ====== epson-stylus-sx100 ======
- 
-Beschriftungen: FC11B913F56 F KTH0351-2 
  
 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:contact_image_sensor|Contact Image Sensor]] mit LEDs
   * 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: FC11B913F56 F KTH0351-2
 +
 +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.
  
-Flachbandkabel (von oben kommend)+Bei 5V Versorgung sollte mit folgenden Widerständen nach Erde gezogen werden fuer weisses Papier: Rot:50, Grün:50, Blau:220. 
-^  Bedeutung + 
- 1 | N/C (so weit sich erkennen laesst) | +<pagebreak> 
- 2 | LED Rot | +Spannung 1 mA
- 3 | LED Gruen | +^ + \ - ^   2 ^  3 ^  4 ^  5 ^ Beschreibung des Pins 
- 4 | LED Blau | +    |  x |    |    |    |    | N/C (so weit sich erkennen laesst) | 
- 5 | LED VCC +    |    |  x |    |    |    | LED GND Rot | 
- 6 | irgendwas, das einmal duenn ganz durch geht und viele Vias abzweigt +    |    |    |  x |    |    | LED GND Gruen | 
- 7 | eine fette Flaeche darunter +    |    |    |    |  x |    | LED GND Blau | 
- 8 | so stiche in vias, die von oben runter kommen +    |    |  R |  G |  B |  x | LED 
- 9 | fette flaeche zwischen dem durchgeher und den oberen lines + 
-| 10 | fette flaeche wo die schrauben durchgehen (aber kein kontakt) | +==== Datensignale ==== 
-| 11 | line ueber der schraubenflaeche + 
-| 12 | line nochmal ueber dieser |+Spannung 1 mA: 
 +^ + \ - ^    6 ^    7 ^    8 ^    9 ^   10 ^   11 ^   12 ^ Vias ^ Geometrie  ^ relativ ^ Vermutung ^ Beschreibung des Pins ^ 
 +|     6 |    x | <typo bg:#ffe0b2>0.61</typo> | <typo bg:#bdb2ff>1.85</typo> | <typo bg:#b2f1ff>1.51</typo> | <typo bg:#bdb2ff>1.85</typo> | <typo bg:#bdb2ff>1.85</typo> | <typo bg:#bdb2ff>1.85</typo> | 1    | dünn               | Startpuls | zwischen oberer Flaeche und Schrauben 
 +    7 | <typo bg:#b2ffcc>1.22</typo> |    x | <typo bg:#b2ffe6>1.34</typo> | <typo bg:#caffb2>0.99</typo> | <typo bg:#b2ffe6>1.34</typo> | <typo bg:#b2ffe6>1.34</typo> | <typo bg:#b2ffe4>1.33</typo> | 2    | breit      | oben    | 3V3       
 +    8 | <typo bg:#bdb2ff>1.85</typo> | <typo bg:#ffe0b2>0.61</typo> |    x | <typo bg:#b2f1ff>1.51</typo> | <typo bg:#bdb2ff>1.85</typo> | <typo bg:#bdb2ff>1.85</typo> | <typo bg:#b6b2ff>1.82</typo> | 1    | dünn               | Clock     von unten hochstechend 
 +    9 | <typo bg:#ffb4b2>0.41</typo> | <typo bg:#ffb2bd>0.35</typo> | <typo bg:#ffb4b2>0.41</typo> |    x | <typo bg:#ffb4b2>0.41</typo> | <typo bg:#ffb4b2>0.41</typo> | <typo bg:#ffb2b2>0.40</typo> | 3-5  | breitestes | unten   | GND       | ueber #8 
 +   10 | <typo bg:#bbb2ff>1.84</typo> | <typo bg:#ffe0b2>0.61</typo> | <typo bg:#bbb2ff>1.84</typo> | <typo bg:#b2f4ff>1.50</typo> |    x | <typo bg:#bbb2ff>1.84</typo> | <typo bg:#b9b2ff>1.83</typo> | 1    | breit      | mitte   | Vref      | driftet langsam, wenn Versorgung angeklemmt (andere pins sind nah an GND) | 
 +   11 | <typo bg:#bdb2ff>1.85</typo> | <typo bg:#ffe0b2>0.61</typo> | <typo bg:#bdb2ff>1.85</typo> | <typo bg:#b2f1ff>1.51</typo> | <typo bg:#bdb2ff>1.85</typo> |    x | <typo bg:#bdb2ff>1.85</typo> | 1    | dünn               | 300/600 dpi | unter der Mittleren Flaeche, ueber #12 
 +   12 | <typo bg:#bbb2ff>1.84</typo> | <typo bg:#ffe0b2>0.61</typo> | <typo bg:#bbb2ff>1.84</typo> | <typo bg:#b2f4ff>1.50</typo> | <typo bg:#b9b2ff>1.83</typo> | <typo bg:#bbb2ff>1.84</typo> |    x | 1    | dünn               | Aout       ueber der unteren Flaeche, unter #11 | 
 + 
 +==== Insgesamt ==== 
 + 
 +sieht verdammt nach [[http://rohmfs.rohm.com/en/products/databook/datasheet/module/contact_image_sensor/flatbed/lsh3008-ca10a.pdf]] aus 
 + 
 +  * 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 "output period", dann kommen die pixel (inkl. vorne und hinten dummypixeln) 
 +    * 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, kann man bestimmt noch reduzieren): 
 + 
 +  * Werte -> Shiftregister, neue Belichtung starten: 
 +    * 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 ==== 
 + 
 +<code> 
 +#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, OUTPUT); 
 +  pinMode(CLOCK, OUTPUT); 
 +  pinMode(DPIMODE, OUTPUT); 
 + 
 +  digitalWrite(DPIMODE, dpimode); 
 + 
 +  sched = micros(); 
 +
 + 
 +void loop() { 
 +  digitalWrite(START, HIGH); 
 +  digitalWrite(CLOCK, HIGH); 
 +  digitalWrite(CLOCK, LOW); 
 +  digitalWrite(START, LOW); 
 + 
 +  for (uint16_t counter = 0; counter < 82 + pixels; counter += 1) 
 +  { 
 +    PORTD |= _BV(PORTD3); 
 +    //delayMicroseconds(1); 
 +    PORTD &= ~_BV(PORTD3); 
 +    //delayMicroseconds(1); 
 +  } 
 + 
 +  sched += linetime; 
 +  int32_t dt = sched - micros(); 
 +  while (dt > 0x4000) 
 +  { 
 +    delayMicroseconds(0x4000); 
 +    dt -= 0x4000; 
 +  } 
 +  if (dt > 0) 
 +    delayMicroseconds(dt); 
 +
 +</code> 
 +==== coloring code ==== 
 +<code> 
 +import re, colorsys 
 + 
 +rex = re.compile('(?:<span[^>]*>)?([0-9].[0-9]{2})(?:</span>)?'
 + 
 +def color(value, min, max): 
 +    value = (value - min) / (max - min) 
 +    (r,g,b) = [int(v*255) for v in colorsys.hls_to_rgb(value, 0.85, 1.0)] 
 +    return "#{:02x}{:02x}{:02x}".format(r,g,b) 
 + 
 +def colorize(match): 
 +    value = match.group(1) 
 +    return '<typo bg:{1}>{0}</typo>'.format(value, color(float(value), 0.4, 2.5)) 
 + 
 +source = open("foo.txt").read() 
 +open("foo.txt", "w").write(rex.sub(colorize, source)) 
 +</code> 
 + 
 +==== Bilder ==== 
 + 
 +{{projekte:sx100:img_20160604_004626.jpg?500|}} 
 + 
 +{{projekte:sx100:img_20160604_004801.jpg?500|}}
  
-^ + \ - ^  1 ^  2 ^  3 ^  4 ^  5 ^ +{{projekte:sx100:img_20160604_004821.jpg?500|}}
-|   1 | x | | | | | +
-|   2 | | x | | | | +
-|   3 | | | x | | | +
-|   4 | | | | x | | +
-|   5 | | Rot | Grün | Blau | x |+
  
-^ + \ - ^  6 ^  7 ^  8 ^  9 ^  10 ^  11 ^  12 ^ 
-|   6 | x | | | | | | | 
-|   7 | | x | | 1.46 | | | | 
-|   8 | |0.78 | x | | | | | 
-|   9 | 0.48 | 0.40 | 0.48 | x | 0.48 | 0.48 | 0.47 | 
-|  10 | | 0.77 | | | x | | | 
-|  11 | | 0.77 | | | | x | | 
-|  12 | | 0.77 | | | | | x | 
  
Navigation



You are not allowed to add pages