application: working WIP firmware to control thermocycler
This commit is contained in:
parent
36456ba45f
commit
eb55880296
182
README.md
182
README.md
|
@ -42,14 +42,188 @@ To set BOOT0 to 1, apply 3.3 V on R11, between the resistor and the reference de
|
||||||
The red LED should stay off while the green LED is on.
|
The red LED should stay off while the green LED is on.
|
||||||
Now you can remove the read protection (and erase flash), run `rake remove_protection` while a SWD adapter is connected.
|
Now you can remove the read protection (and erase flash), run `rake remove_protection` while a SWD adapter is connected.
|
||||||
|
|
||||||
|
ST 339 is a quad voltage comparator.
|
||||||
|
I don't know what it compares.
|
||||||
|
|
||||||
|
LN 393 is a dual comparator.
|
||||||
|
I don't know what it compares.
|
||||||
|
|
||||||
|
there is also an external reference (REF1).
|
||||||
|
this is probably for the MAX1247 (only the MAX1246 has an internal voltage reference).
|
||||||
|
|
||||||
|
MAX1247 is a 4-channel 12-bit ADC.
|
||||||
|
it is used to measure the temperatures.
|
||||||
|
|
||||||
|
there are four 2.2 kOhm thermistors.
|
||||||
|
one side is connected to REF1, the other to a MAX1247 channel.
|
||||||
|
- TH4: on the sink, connected to CH2 through R8 (2702), and COM through R4
|
||||||
|
- TH3: in the tube, connected to CH3 through R7 (2702), and COM through R3
|
||||||
|
- in the top of the tub heating bed, connected to CH0
|
||||||
|
- in the bottom of the tub heating bed, connected to CH1
|
||||||
|
|
||||||
|
heating block MBLK-008:
|
||||||
|
01. NC
|
||||||
|
02. VCC
|
||||||
|
03. LN393 OUTPUT-A
|
||||||
|
04. MAX1247 DIN
|
||||||
|
05. MAX1247 DOUT
|
||||||
|
06. MAX1247 SCLK
|
||||||
|
07. MAX1247 nCS
|
||||||
|
08. ST339 OUTPUT-3
|
||||||
|
09. LK1 jumper (missing), other side connected to ground
|
||||||
|
10. LK2 jumper (missing), other side connected to ground
|
||||||
|
11. LK3 jumper (present), other side connected to ground
|
||||||
|
12. LK4 jumper (present), other side connected to ground
|
||||||
|
13. ground
|
||||||
|
14. LN393 OUTPUT-A through 10 kOhm resistor (not sure what this is used for, probably not just to pull)
|
||||||
|
|
||||||
|
heated lid, 12 kOhm NTC thermistor, 3-pin (pin 1 has notch):
|
||||||
|
1. thermistor lead 1
|
||||||
|
2. thermistor lead 2
|
||||||
|
3. chassis
|
||||||
|
|
||||||
|
thermocouple (e.g. peltier elements) controller board, MBLK019, 2x3 pin plug (IDC numbering):
|
||||||
|
1. red, VCC
|
||||||
|
2. red/green, sink to control IC/TR 2/6
|
||||||
|
3. red/black, sink to control IC/TR 1/4
|
||||||
|
4. red/blue, connected to pin 6
|
||||||
|
5. red/brown, sink to control IC/TR 3/5
|
||||||
|
6. black, connected to pin 4
|
||||||
|
|
||||||
|
front control panel, 1x5 connector:
|
||||||
|
1. ground
|
||||||
|
2. play/pause indicator, green LED anode
|
||||||
|
3. play/pause indicator, orange LED anode
|
||||||
|
4. power indicator, red LED
|
||||||
|
5. play/pause button, connected to ground when pressed
|
||||||
|
|
||||||
|
fan:
|
||||||
|
1. red: 12V
|
||||||
|
2. black: ground
|
||||||
|
|
||||||
|
MBLK-078, power + heater, 2x2 connector:
|
||||||
|
1. red, 12V
|
||||||
|
2. black, ground
|
||||||
|
3. yellow/red, optocoupler anode for triac controlling the lid heater
|
||||||
|
4. yellow/black, optocoupler cathode for triac controlling the lid heater
|
||||||
|
|
||||||
|
SSD1306 OLED screen:
|
||||||
|
1. GND
|
||||||
|
2. VDD
|
||||||
|
3. SCK
|
||||||
|
4. SDA
|
||||||
|
|
||||||
|
power for thermocouples
|
||||||
|
-----------------------
|
||||||
|
|
||||||
|
use a 12V xA power supply.
|
||||||
|
ideally it would be an adjustable constant current supply (probably what the original power supply was), but using PWM on constant voltage is good enough for thermocouples, even if less efficient.
|
||||||
|
|
||||||
|
I created a custom board with:
|
||||||
|
- 2 relays to act as h-bridge, allowing to invert the voltage on the thermocouples
|
||||||
|
- 1 power MOSFET, to PWM the power
|
||||||
|
- 1 optocoupler, to control the MOSFET
|
||||||
|
- an IDC 2x5 connector, to re-use to cable
|
||||||
|
|
||||||
|
relay 1:
|
||||||
|
- COM: thermocouple yellow
|
||||||
|
- NC: OUT
|
||||||
|
- NO: 12V dedicated power supply
|
||||||
|
- VCC: 5V
|
||||||
|
- GND: ground
|
||||||
|
- IN: IDC pin 3,4
|
||||||
|
|
||||||
|
relay 2:
|
||||||
|
- COM: thermocouple orange
|
||||||
|
- NC: OUT
|
||||||
|
- NO: 12V dedicated power supply
|
||||||
|
- VCC: 5V
|
||||||
|
- GND: ground
|
||||||
|
- IN: IDC pin 5,6
|
||||||
|
|
||||||
|
power nMOS (FQP30N06L, 60V 32A):
|
||||||
|
- gate: PC817 optocoupler source, pulled low (100 kOhm to ground)
|
||||||
|
- drain: OUT from relay
|
||||||
|
- source: ground
|
||||||
|
|
||||||
|
IDC 2x5 connector:
|
||||||
|
- 1,2: 5V to power the relays and optocoupler
|
||||||
|
- 3,4: input to relay 1, active low (when sinking)
|
||||||
|
- 5,6: input to relay 2, active low (when sinking)
|
||||||
|
- 7,8: input optocoupler controlling MOSFET, active low (when sinking)
|
||||||
|
- 9,10: ground
|
||||||
|
|
||||||
|
PC817 optocoupler:
|
||||||
|
- source: power nMOS gate
|
||||||
|
- drain: 12V dedicated power supply
|
||||||
|
- anode: 5V though 330 Ohm
|
||||||
|
- cathode: IDC pin 7,8
|
||||||
|
|
||||||
connections
|
connections
|
||||||
===========
|
===========
|
||||||
|
|
||||||
Connect the peripherals the following way (STM32F10X signal; STM32F10X pin; peripheral pin; peripheral signal; comment):
|
|
||||||
|
|
||||||
- *list board to peripheral pin connections*
|
|
||||||
|
|
||||||
All pins are configured using `define`s in the corresponding source code.
|
All pins are configured using `define`s in the corresponding source code.
|
||||||
|
Connect the peripherals the following way.
|
||||||
|
|
||||||
|
heating block MBLK-008 CO IDC 7x2:
|
||||||
|
01. NC
|
||||||
|
02. 3.3V
|
||||||
|
03. PB3
|
||||||
|
04. PB15 SPI2_MOSI
|
||||||
|
05. PB14 SPI2_MISO
|
||||||
|
06. PB13 SPI2_SCK
|
||||||
|
07. PB12 SPI2_NSS
|
||||||
|
08. PB4
|
||||||
|
09. PB5
|
||||||
|
10. PC14
|
||||||
|
11. PC15
|
||||||
|
12. PB1
|
||||||
|
13. ground
|
||||||
|
|
||||||
|
heated lid, 12 kOhm NTC thermistor, 3-pin (pin 1 has notch):
|
||||||
|
1. PA0/ADC1_CH0, pulled up to 5.0V by 10 kOhm resistor
|
||||||
|
2. ground
|
||||||
|
3. earth
|
||||||
|
|
||||||
|
thermocouple controller board, MBLK019, 2x3 IDC connector:
|
||||||
|
1. 3.3 V
|
||||||
|
2. PA1
|
||||||
|
3. PA2
|
||||||
|
4. PA3
|
||||||
|
5. PA4
|
||||||
|
6. ground
|
||||||
|
|
||||||
|
front panel:
|
||||||
|
1. ground
|
||||||
|
2. PA5, with 330 Ohm inline resistor
|
||||||
|
3. PA6, with 330 Ohm inline resistor
|
||||||
|
4. PA7, with 330 Ohm inline resistor
|
||||||
|
5. PB0
|
||||||
|
|
||||||
|
fan:
|
||||||
|
1. 12V front board power supply
|
||||||
|
2. power nMOS drain
|
||||||
|
power nMOS source. ground
|
||||||
|
power nMOS gate. PA15, pulled up externally to 5V
|
||||||
|
|
||||||
|
MBLK-078, power + heater, 2x2 connector:
|
||||||
|
1. LM7805 in
|
||||||
|
2. ground
|
||||||
|
3. 5V though 330 Ohm
|
||||||
|
4. PA10
|
||||||
|
|
||||||
|
SSD1306 OLED screen:
|
||||||
|
1. ground
|
||||||
|
2. 3.3 V
|
||||||
|
3. PB6/I2C1_SCL, pulled up to 3.3V by external 10 kOhm resistor
|
||||||
|
4. PB7/I2C1_SDA, pulled up to 3.3V by external 10 kOhm resistor
|
||||||
|
|
||||||
|
thermocouple power supply control board. IDC 2x5:
|
||||||
|
- 1,2: 5V
|
||||||
|
- 3,4: PB10
|
||||||
|
- 5,6: PB11
|
||||||
|
- 7,8: PB9
|
||||||
|
- 9,10: ground
|
||||||
|
|
||||||
code
|
code
|
||||||
====
|
====
|
||||||
|
|
871
application.c
871
application.c
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue