SLIDE 1 simple spectro
https:/github.com/hackuarium/simple-spectro https://hackuarium.github.io/simple-spectro http://www.hackuarium.ch
florian@patiny.com luc@patiny.com
Supported by
SLIDE 2
SLIDE 3 DIY biology Do It Together biology and more …
Meet us every Wednesday evening, 7.30pm-10.30pm
@Hackuarium
www.hackuarium.ch
SLIDE 4
SLIDE 5 3D printing Milling Injection molding Breadboard PCB PCBA Microcontroller Data analysis Chemistry Biology Environment
Electronic Mechanic Software Applications Project
SLIDE 6 Agenda
- 1. General overview
- 2. Electronics
- 3. Mechanics
- 4. Programming
- 5. Experiments
SLIDE 7
1
General overview
SLIDE 8 Spectrophotometer ?
I0 I
SLIDE 9 Beer-Lambert law
- A: absorbance
- T: transmittance
- I0: intensity of the light
- I: intensity of the light after the cell
- L: length of the cell
- c: concentration (M)
- 훆: molar attenuation coefficient
A = - log (T) = - log (I / I0) = 훆 L c
I0 I
SLIDE 10 RGB led ?
Available spectra
Type Name R G B W
Show the spectra of the 4 leds: R : red led G : green led B : blue led W : white, represented as a black line Z : background E : experimental A : absorbance T : transmittance
Tracking information
Chart Wavelength (nm) Intensity chart 565 488.25 chart-1 565 6,247.63 chart-2 565 262.75 chart-3 565 6,355.63 Name Comment red pH:1.37 E red pH: 1.50 E red pH: 1.64 E red pH: 1.77 E red pH: 1.87 E red pH: 1.92 E red pH: 1.97 E red pH: 2.00 E red pH: 2 14 E
Spectra
Smooth 8 Normalize Experiment
Save
Name Concentration
Concentration in mM
Comment
Test RGB Acquire
SLIDE 11
SLIDE 12
SLIDE 13
SLIDE 14
2
Electronics
Arduino …
SLIDE 15
Classical approach
SLIDE 16
Arduino platform
SLIDE 17 https://www.adafruit.com/?q=breakout
SLIDE 18
SLIDE 19
A solution : use of shields
SLIDE 20
May become a little bit complex …
SLIDE 21 We tried this approach
- Arduino MEGA
- Extensions board for halloween
decoration
- "This is what is need for my
bioreactor"
SLIDE 22
SLIDE 23
Can we make our own Arduino ?
SLIDE 24
SLIDE 25
Legoino : master board
SLIDE 26
Legoino : extensions
SLIDE 27
SLIDE 28
Arduino Leonardo
SLIDE 29
Arduino platform
SLIDE 30 Microcontroller : ATMEGA32U4
- 32 kb of programmable flash memory
- 2.5 kb SRAM (Static random-access memory)
- 1 kb EEPROM (Electrically Erasable Programmable Read-
Only Memory)
- Operating voltage: 2.7v to 5.5V
- 8 (min 2.7V) / 16 (min 4.5V) MHz
- 26 I/O, 12 x 10bits ADC
- USART, I2C, USB, SPI
- 2 x 16bits Timer / Counter
- 4 x PWM 16 bits, 6 x PWM 11 bits
4 CHF
SLIDE 31 Microcontroller : ATMEGA32U4
Datasheet
SLIDE 32
Making your own PCB
SLIDE 33 www.pcbway.com - www.seedstudio.com
SLIDE 34 PCB production
- $5 for 5 to 10 PCBs 10x10cm
- + shipping … $10 to $25
- Numerous suppliers
- http://www.pcbway.com (currently my preferred one)
- http://www.seedstudio.com
- http://www.elecrow.com
- https://oshpark.com - $5 for 3 per square inch
- You need Gerber Files
SLIDE 35
www.pcbway.com ⚠ combine shipping
SLIDE 36 eagle
https://www.autodesk.com/products/eagle/ Opensource alternative: KiCad
http://kicad-pcb.org/
SLIDE 37
Schematic
SLIDE 38
USB
SLIDE 39
LCD
SLIDE 40
Light to frequency - TSL 237
SLIDE 41 Exercise
- Download the project
- https://github.com/hackuarium/simple-spectro
- In eagle
- Open Schematic: tutorial/eagle/tutorial.sch
- Add 3 leds with corresponding resistors on pins A0, A1 and A2
- Board
- Routing
- Check
- Create Gerber files
- Check Gerber : https://gerber-viewer.easyeda.com/
SLIDE 42
Soldering the PCB
SLIDE 43
SLIDE 44
SLIDE 45
PCBA
Printed Circuit Board Assembly
SLIDE 46 www.elecrow.com
- Free components list
- https://www.elecrow.com/pcb-assembly-p-366.html
- 120 SMD capacitors
- 235 SMD resistors
- Provider: https://lcsc.com/
- In Eagle:
- ‘attr’, add LCSC Part # (or free components)
- ‘run ULP ➡ bom’, export as CSV
- ‘export ➡ mount SMD’ : export .mnb and .mnt
SLIDE 47
www.elecrow.com
SLIDE 48
Through holes components
SLIDE 49
- 1. Solder pins on LCD screen
- 2. Check the screen !!!!
SLIDE 50
1 2 3 4 5
SLIDE 51
6 7
SLIDE 52
3
Mechanics
SLIDE 53 Various strategies
Laser cutting ✔ fast and cheap ✘ limited shapes (2D) 3D printing ✔ any shape ✘ slow ✘ not that cheap Milling ✔ perfect quality ✘ cost ✘ time Molding ✔ cheap for large series ✘ setup cost ✘ time
SLIDE 54
3D printing
SLIDE 55
SLIDE 56
SLIDE 57 You need an STL file
https://github.com/Hackuarium/simple-spectro/tree/master/CAD/open-box
SLIDE 58
SLIDE 59
SLIDE 60 The cost of 3D printing
- Printer 1000 CHF
- Case 50g: 3 CHF
SLIDE 61
SLIDE 62
SLIDE 63
https://www.shapeways.com/
SLIDE 64
Laser cutting
SLIDE 65
SLIDE 66
SLIDE 67
SLIDE 68 The cost of laser cutting
- Machine 2000 CHF
- Plexiglas 3mm: 70 CHF / m2
- https://roehmschweiz.ch/fr/produits/plaques/plexiglas/gs-allround/
- MDF 3mm: 10 CHF / m2
SLIDE 69
SLIDE 70
SLIDE 71
SLIDE 72
Milling
SLIDE 73
SLIDE 74 Aluminum case
- Aluminium milling
- Black anodizing
- Logo laser engraving
- ISO 10303 (STEP file, Standard for
the Exchange of Product model data)
SLIDE 75
https://www.mfg.com
SLIDE 76
pcs
- EUR 1140,00
- 14 calendar-days production time
- full.step
- 50
pcs
- EUR 2245,00
- 16 calendar-days production time
- full.step
- 100 pcs
- EUR 3625,00
- 20 calendar-days production time
SLIDE 77
SLIDE 78
SLIDE 79
Molding
SLIDE 80 Molding
http://www.emold.net/
SLIDE 81 Generating the files
Alternatives to Fusion 360
https://www.autodesk.com/products/fusion-360
SLIDE 82 FreeCAD
- 2D
- 3D
- open-source
- STL file (Standard Triangle
Language)
- https://www.freecadweb.org
SLIDE 83 OpenSCAD
- 2D
- 3D
- open-source
- command line
- http://www.openscad.org
- full integration in FreeCAD
SLIDE 84
OpenSCAD
SLIDE 85 OpenSCAD
https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#minkowski
SLIDE 86 Exercise
- Create a millable box with 4 holes
for the screws
cheatsheet/
SLIDE 87 4
Programming
https://www.arduino.cc/en/Main/Software
SLIDE 88 Arduino: the basics
Install the software:
https://www.arduino.cc/en/Main/Software
SLIDE 89 Arduino IDE (Integrated Development Environment)
Verify Upload New Open Save Serial monitor Tabs
SLIDE 90
Select the right Arduino
SLIDE 91
Select the connected Arduino
SLIDE 92
Arduino IDE: setup and loop
SLIDE 93
Blink
SLIDE 94 Testing the LEDs
Exercise: Create an RGB sequence
SLIDE 95
More advanced
SLIDE 96 Microcontroller : addressing pins
- 3 registers: DDRx, PORTx, and PINx
- DDRx: 0=INPUT, 1=OUTPUT
- PORTx:
- INPUT: pull-up if 1
- OUTPUT: 1: drive pin HIGH, 0, drive pin LOW
- PINx: toggle the pin
SLIDE 97 DDRB: input / output ?
7 6 5 4 3 2 1
DDRB = (1 << DDB4) | (1 << DDB0);
DDR: Data direction register
7 6 5 4 3 2 1
1 bit shift
7 6 5 4 3 2 1
1 1
7 6 5 4 3 2 1
1
| = DDRB =
Initial:
SLIDE 98
Microcontroller : ATMEGA32U4
SLIDE 99 Microcontroller : addressing pins
// pin 0 and 4 of PORT B to output DDRB = (1 << DDB4) | (1 << DDB0); // drive pin 0 and 4 of PORT B to HIGH PORTB = (1 << PB4) | (1 << PB0);
SLIDE 100
Microcontroller : ATMEGA32U4
SLIDE 101
SLIDE 102
SLIDE 103
SLIDE 104
SLIDE 105
SLIDE 106
SLIDE 107
SLIDE 108
SLIDE 109
SLIDE 110
Debug using Serial.println
SLIDE 111 Test all the functionalities
Exercise: Test LCD display
SLIDE 112
Multithread
SLIDE 113 Scalable way of programming
- Tabs
- NilRTOS (multi-thread)
SLIDE 114
SLIDE 115
SLIDE 116 Multithread with Shared parameters
Parameters
getParameter(x) setParameter(x, value) setAndSaveParameter
Parameters accessible from all the Thread and saved in EEPROM.
ThreadLcd
Process allowing to control the simple- spectra from a LCD display
ThreadTemperature ThreadBattery ThreadSerial
General process allowing communication
- ver Serial (Bluetooth, Zigbee, Lora, …)
ThreadAcquisition
Process taking care of the acquisition based
SLIDE 117 A COLOR_1 Red value for sample 1 B COLOR_2 Green value for sample 2 C COLOR_3 Blue value for sample 3 D COLOR_4 UV value for sample 4 E COLOR_5 Not used 5 F BLANK_1 Red value for blank 6 G BLANK_2 Green value for blank 7 H BLANK_3 Blue value for blank 8 I BLANK_4 UV value for blank 9 J BLANK_5 Not used 10 K BEFORE_DELAY Delay before taking blank 11 L FIRST_DELAY Delay between blank and first experiment 12 M INTER_DELAY Delay between experiments 13 N NUMPER_EXP Number of experiments 14 O NEXT_EXP Next experiment, 0 blank and then for kinetic 15 P WAIT Current time to wait 16 Q NUMBER_ACQ number of acquisition of 100ms that will be taken 17 R INVERT_ROTARY invert rotary direction 18 S BATTERY battery voltage (hundredths of volt) 19 T TEMPERATURE temperature (hundredths of degree) 21 V ACTIVE_LEDS as a binary code (red, green, blue, uv, temperature, battery)
SLIDE 118 Connecting to spectro
Serial monitor
SLIDE 119 Arduino IDE (Integrated Development Environment)
- h: help
- s: display all current settings
- K: get current delay
- K5: set current delay to 5s
- d: data
SLIDE 121
Experiments5
SLIDE 122
E131 in Gummy blue sharks
SLIDE 123
Left: known [ ], right: Haribo
SLIDE 124
SLIDE 125
Absorbance versus concentration
SLIDE 126
OD versus time
SLIDE 127 Determine [] of E131
- Mother solution:
- 10mg of E131 in 25mL of water
- Diluted solutions
- 0 mL ➡ 5 mL of mother solution in 20mL of water
- 0, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5, 5.0 mL
Analyse data
SLIDE 128
What’s next ?
SLIDE 129 Hardware
- Electronic
- reduce power consumption (we went from 5mA to 250µA)
- hard reset (to check, now software reboot)
- Mechanics
- Good solution for the screen (glued plexiglass)
- Stability / reproducibility
- https://hackuarium.github.io/simple-spectro/
SLIDE 130 Applications
- determination of pH ?
- kinetic reaction
- bacteria growth versus temperature
- various bacteria
- consortium growth
- mercury water contamination using
quantum dots
SLIDE 131 Carbon quantum dots
- Prof. Eric McLamore, University of Florida
SLIDE 132 Results
- Prof. Eric McLamore, University of Florida
SLIDE 133
SLIDE 134