├── processing_plot ├── sketch.properties └── processing_plot.pde ├── hardware └── c12666ma_breakout.PDF ├── LICENSE ├── README.md └── arduino_csv_example └── arduino_csv_example.ino /processing_plot/sketch.properties: -------------------------------------------------------------------------------- 1 | mode.id=processing.mode.java.JavaMode 2 | mode=Java 3 | -------------------------------------------------------------------------------- /hardware/c12666ma_breakout.PDF: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/groupgets/c12666ma/HEAD/hardware/c12666ma_breakout.PDF -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015, Pure Engineering 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 18 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 20 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 21 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 22 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | 25 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # c12666ma 2 | For More Information pleave visit this project site 3 | https://groupgets.com/manufacturers/hamamatsu-photonics/products/c12666ma-micro-spectrometer 4 | 5 | Quick How-TO 6 | 7 | Checkout the code I have posed here: 8 | https://github.com/groupgets/c12666ma 9 | 10 | Also get yourself an arduino uno if you don't have one already. 11 | http://www.mouser.com/ProductDetail/Arduino/A000066/?qs=BC3YYPaifMrIue9b%252bHtKQg%3D%3D&kpid=630043477&gclid=CPb12-2phMYCFQeKaQodqpYA8w 12 | 13 | next download the arduino environment. 14 | http://www.arduino.cc/en/Main/Software 15 | 16 | And for visulization you can use processing 17 | https://processing.org/download/?processing 18 | 19 | 20 | put the spectrometer into the breakout board. 21 | alight the breakout board so the 5V and 3.3V and GND pins line up. EOS will be unconnected in the center. 22 | Download the code onto the arduino. 23 | you will have to modify the processing script to open the correct serial port. 24 | 25 | Please if there are any improvements of fixes please submit a push request and it should be accepted. Thanks! 26 | 27 | Important Note 28 | ============ 29 | GroupGets does not provide coding, firmware, or software support of any kind and will not respond to related requests. All software and firmware provided by GroupGets are offered solely as examples or potential starting points. These repositories may be outdated and are not guaranteed to function as intended. 30 | 31 | We do not accept returns or offer replacements due to issues related to software, firmware, or code compatibility. 32 | 33 | The software is provided "AS IS", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and non-infringement. In no event shall the authors or copyright holders be liable for any claim, damages, or other liability, whether in an action of contract, tort, or otherwise, arising from, out of, or in connection with the software or the use or other dealings in the software. 34 | -------------------------------------------------------------------------------- /processing_plot/processing_plot.pde: -------------------------------------------------------------------------------- 1 | import processing.serial.*; 2 | 3 | Serial myPort; 4 | String val; 5 | int[] data; 6 | double[] summed; 7 | int draw_sum=0; 8 | 9 | double find_max(double[] input) 10 | { 11 | double max = 0; 12 | for (int i = 0; i < input.length; i++) 13 | { 14 | if (input[i] > max) 15 | { 16 | max = input[i]; 17 | } 18 | } 19 | return max; 20 | } 21 | 22 | void plotdata() 23 | { 24 | 25 | double summed_max = (find_max(summed))/512; 26 | 27 | background(0); 28 | 29 | if (draw_sum !=0) 30 | { 31 | for (int i=0; i 0) 66 | { 67 | val = myPort.readStringUntil('\n'); // read it and store it in val 68 | if (val != null) 69 | { 70 | data = int(split(val, ',')); 71 | 72 | for (int i = 0; i < data.length; i++) 73 | { 74 | if (i read_time) delayMicroseconds(delay_time - read_time); // Read takes about 135uSec 131 | 132 | digitalWrite(SPEC_CLK, HIGH); 133 | delayMicroseconds(delay_time); 134 | 135 | // Second block of 2 clocks -- idle 136 | digitalWrite(SPEC_CLK, LOW); 137 | delayMicroseconds(delay_time); 138 | digitalWrite(SPEC_CLK, HIGH); 139 | delayMicroseconds(delay_time); 140 | digitalWrite(SPEC_CLK, LOW); 141 | delayMicroseconds(delay_time); 142 | digitalWrite(SPEC_CLK, HIGH); 143 | delayMicroseconds(delay_time); 144 | } 145 | 146 | // Step 6: trailing clock pulses 147 | for (int i = 0; i < SPEC_CHANNELS; i++) { 148 | digitalWrite(SPEC_CLK, LOW); 149 | delayMicroseconds(delay_time); 150 | digitalWrite(SPEC_CLK, HIGH); 151 | delayMicroseconds(delay_time); 152 | } 153 | } 154 | 155 | void print_data() 156 | { 157 | for (int i = 0; i < SPEC_CHANNELS; i++) 158 | { 159 | Serial.print(data[i]); 160 | Serial.print(','); 161 | } 162 | Serial.print("\n"); 163 | } 164 | 165 | void loop() 166 | { 167 | // digitalWrite(LASER_404, HIGH); 168 | // readSpectrometer(); 169 | // digitalWrite(LASER_404, LOW); 170 | // print_data(); 171 | // delay(10); 172 | 173 | // digitalWrite(WHITE_LED, HIGH); 174 | // readSpectrometer(); 175 | // digitalWrite(WHITE_LED, LOW); 176 | // print_data(); 177 | // delay(10); 178 | 179 | readSpectrometer(); 180 | print_data(); 181 | delay(10); 182 | } 183 | --------------------------------------------------------------------------------