simple spectro https:/github.com/hackuarium/simple-spectro - - PowerPoint PPT Presentation

simple spectro
SMART_READER_LITE
LIVE PREVIEW

simple spectro https:/github.com/hackuarium/simple-spectro - - PowerPoint PPT Presentation

simple spectro https:/github.com/hackuarium/simple-spectro https://hackuarium.github.io/simple-spectro http://www.hackuarium.ch Supported by oceane@patiny.com florian@patiny.com luc@patiny.com DIY biology Do It Together biology and more


slide-1
SLIDE 1

simple spectro

https:/github.com/hackuarium/simple-spectro https://hackuarium.github.io/simple-spectro http://www.hackuarium.ch

  • ceane@patiny.com

florian@patiny.com luc@patiny.com

Supported by

slide-2
SLIDE 2
slide-3
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 4
slide-5
SLIDE 5

3D printing Milling Injection molding Breadboard PCB PCBA Microcontroller Data analysis Chemistry Biology Environment

Electronic Mechanic Software Applications Project

slide-6
SLIDE 6

Agenda

  • 1. General overview
  • 2. Electronics
  • 3. Mechanics
  • 4. Programming
  • 5. Experiments
slide-7
SLIDE 7

1

General overview

slide-8
SLIDE 8

Spectrophotometer ?

I0 I

slide-9
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
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

  • Filter

Smooth 8 Normalize Experiment

Save

Name Concentration

Concentration in mM

Comment

Test RGB Acquire

slide-11
SLIDE 11
slide-12
SLIDE 12
slide-13
SLIDE 13
slide-14
SLIDE 14

2

Electronics

Arduino …

slide-15
SLIDE 15

Classical approach

slide-16
SLIDE 16

Arduino platform

slide-17
SLIDE 17

https://www.adafruit.com/?q=breakout

slide-18
SLIDE 18
slide-19
SLIDE 19

A solution : use of shields

slide-20
SLIDE 20

May become a little bit complex …

slide-21
SLIDE 21

We tried this approach

  • Arduino MEGA
  • Extensions board for halloween

decoration

  • "This is what is need for my

bioreactor"

slide-22
SLIDE 22
slide-23
SLIDE 23

Can we make our own Arduino ?

slide-24
SLIDE 24
slide-25
SLIDE 25

Legoino : master board

slide-26
SLIDE 26

Legoino : extensions

slide-27
SLIDE 27
slide-28
SLIDE 28

Arduino Leonardo

slide-29
SLIDE 29

Arduino platform

slide-30
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
SLIDE 31

Microcontroller : ATMEGA32U4

Datasheet

slide-32
SLIDE 32

Making your own PCB

slide-33
SLIDE 33

www.pcbway.com - www.seedstudio.com

slide-34
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
SLIDE 35

www.pcbway.com ⚠ combine shipping

slide-36
SLIDE 36

eagle

https://www.autodesk.com/products/eagle/ Opensource alternative: KiCad
 http://kicad-pcb.org/

slide-37
SLIDE 37

Schematic

slide-38
SLIDE 38

USB

slide-39
SLIDE 39

LCD

slide-40
SLIDE 40

Light to frequency - TSL 237

slide-41
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
SLIDE 42

Soldering the PCB

slide-43
SLIDE 43
slide-44
SLIDE 44
slide-45
SLIDE 45

PCBA

Printed Circuit Board Assembly

slide-46
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
SLIDE 47

www.elecrow.com

slide-48
SLIDE 48

Through holes components

slide-49
SLIDE 49
  • 1. Solder pins on LCD screen
  • 2. Check the screen !!!!
slide-50
SLIDE 50

1 2 3 4 5

slide-51
SLIDE 51

6 7

slide-52
SLIDE 52

3

Mechanics

slide-53
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
SLIDE 54

3D printing

slide-55
SLIDE 55
slide-56
SLIDE 56
slide-57
SLIDE 57

You need an STL file

https://github.com/Hackuarium/simple-spectro/tree/master/CAD/open-box

slide-58
SLIDE 58
slide-59
SLIDE 59
slide-60
SLIDE 60

The cost of 3D printing

  • Printer 1000 CHF
  • Case 50g: 3 CHF
slide-61
SLIDE 61
slide-62
SLIDE 62
slide-63
SLIDE 63

https://www.shapeways.com/

slide-64
SLIDE 64

Laser cutting

slide-65
SLIDE 65
slide-66
SLIDE 66
slide-67
SLIDE 67
slide-68
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 69
slide-70
SLIDE 70
slide-71
SLIDE 71
slide-72
SLIDE 72

Milling

slide-73
SLIDE 73
slide-74
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
SLIDE 75

https://www.mfg.com

slide-76
SLIDE 76
  • full.step
  • 20

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 77
slide-78
SLIDE 78
slide-79
SLIDE 79

Molding

slide-80
SLIDE 80

Molding

http://www.emold.net/

slide-81
SLIDE 81

Generating the files

Alternatives to Fusion 360

https://www.autodesk.com/products/fusion-360

slide-82
SLIDE 82

FreeCAD

  • 2D
  • 3D
  • open-source
  • STL file (Standard Triangle

Language)

  • https://www.freecadweb.org
slide-83
SLIDE 83

OpenSCAD

  • 2D
  • 3D
  • open-source
  • command line
  • http://www.openscad.org
  • full integration in FreeCAD
slide-84
SLIDE 84

OpenSCAD

slide-85
SLIDE 85

OpenSCAD

https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#minkowski

slide-86
SLIDE 86

Exercise

  • Create a millable box with 4 holes

for the screws

  • http://www.openscad.org/

cheatsheet/

slide-87
SLIDE 87

4

Programming

https://www.arduino.cc/en/Main/Software

slide-88
SLIDE 88

Arduino: the basics

Install the software:

https://www.arduino.cc/en/Main/Software

slide-89
SLIDE 89

Arduino IDE (Integrated Development Environment)

Verify Upload New Open Save Serial monitor Tabs

slide-90
SLIDE 90

Select the right Arduino

slide-91
SLIDE 91

Select the connected Arduino

slide-92
SLIDE 92

Arduino IDE: setup and loop

slide-93
SLIDE 93

Blink

slide-94
SLIDE 94

Testing the LEDs

Exercise: Create an RGB sequence

slide-95
SLIDE 95

More advanced

slide-96
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
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

  • r

7 6 5 4 3 2 1

1 1

7 6 5 4 3 2 1

1

| = DDRB =

Initial:

slide-98
SLIDE 98

Microcontroller : ATMEGA32U4

slide-99
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
SLIDE 100

Microcontroller : ATMEGA32U4

slide-101
SLIDE 101
slide-102
SLIDE 102
slide-103
SLIDE 103
slide-104
SLIDE 104
slide-105
SLIDE 105
slide-106
SLIDE 106
slide-107
SLIDE 107
slide-108
SLIDE 108
slide-109
SLIDE 109
slide-110
SLIDE 110

Debug using Serial.println

slide-111
SLIDE 111

Test all the functionalities

Exercise: Test LCD display

slide-112
SLIDE 112

Multithread

slide-113
SLIDE 113

Scalable way of programming

  • Tabs
  • NilRTOS (multi-thread)
slide-114
SLIDE 114
slide-115
SLIDE 115
slide-116
SLIDE 116

Multithread with Shared parameters

Parameters

getParameter(x) setParameter(x, value) setAndSaveParameter

  • A
  • B
  • C

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

  • n the parameters
slide-117
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
SLIDE 118

Connecting to spectro

Serial monitor

slide-119
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-120
SLIDE 120

Plot data

slide-121
SLIDE 121

Experiments5

slide-122
SLIDE 122

E131 in Gummy blue sharks

slide-123
SLIDE 123

Left: known [ ], right: Haribo

slide-124
SLIDE 124
slide-125
SLIDE 125

Absorbance versus concentration

slide-126
SLIDE 126

OD versus time

slide-127
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
SLIDE 128

What’s next ?

slide-129
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
SLIDE 130

Applications

  • determination of pH ?
  • kinetic reaction
  • bacteria growth versus temperature
  • various bacteria
  • consortium growth
  • mercury water contamination using

quantum dots

slide-131
SLIDE 131

Carbon quantum dots

  • Prof. Eric McLamore, University of Florida
slide-132
SLIDE 132

Results

  • Prof. Eric McLamore, University of Florida
slide-133
SLIDE 133
slide-134
SLIDE 134