aboutsummaryrefslogtreecommitdiff
path: root/README.md
blob: 885d86830ecc940c14c860513ab74d828baa8ff5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
This is the firmware for the ThermoHybaid MBS 0.2G MBLK001 issue 2 (short HBMBSG02) thermo-cycler replacement controller board.

This is the firmware for the thermo-cycler
This firmware template is designed for development boards based around [STM32 F1 series micro-controller](http://www.st.com/web/en/catalog/mmc/FM141/SC1169/SS1031).

project
=======

summary
-------

I bought a HBMBSG02 thermo-cycler, with unknown defect, and wanted to use to make PCR tests.

technology
----------

I replaced the controller board with custom electronics to be able to operate it again.

HBMBSG02
========

The device did power up.
After a couple of seconds it shut down the fan and probably waits for further instructions.
No defect was visible.
I did not get any software to operate it, or check for errors.
This is a rather old device, from 2003.
The manufacturer did not reply to my request for any software or further documentation.

There are two RJ11 ports, for RS-485 communication.
No traffic has been seen during boot up (this probably uses a master slave protocol since the devices can be chained).
I did not get any reply after sending random bytes.

The device is made out of the following parts.

MBLK002
-------

The heating (and cooling) bed for 8x12 PCR tubes.
Made of black anodized aluminium.

lid
---

there is a heated lid with two connectors.

temperature sensor, 12 kOhm NTC thermistor, 3-pin (pin 1 has notch):
1. thermistor lead 1
2. thermistor lead 2
3. chassis
connected to MBLK005.

heating element, 150 Ohm resistor, 2-pin connector.
connected to MBLK078.
this is power by AC 220V, controller by main board.
I don't recommend to have is on at full power for too long.
The heating mat gets hot very fast.
I even blew to inline fuse (196 °C) although I only tried to heat it up to 94 °C.
I replaced the fuse.

MBLK005
-------

this board provides power to the controller board and lid.

power + heater, 2x2 connector:
1. red, 12V (13-77 V)
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

1x2 connector to lid heater, controller by BTA06 triac.

it also allows to select between 110 V and 220 V, and provides AC power to the TEC power supply.

MBLK041
-------

RS485 adapter board.
it provides 2 interconnected RJ11 ports.
this allows to chain thermocyclers.

1x4 connector, to main board:
1. yellow, RS-485-2 A (9/Y on MAX489)
2. green, RS-485-2 B (10/Z on MAX489)
3. brown, RS-485-1 A (12/A on MAX489)
4. orange, RS-485-1 B (11/B on MAX489)

A4-246
------

power supply for the TECs (e.g. peltier elements) though yellow/orange cables.
I think this provides a programmable constant current to operate the TECs efficiently.

2x5 IDC connector to main board:
1. IC2 anode
2. IC2 cathode with R23
3. IC4 anode through R24
4. IC4 anode
5. IC6 collector
6. IC6 emitter
7. IC3 anode
8. IC3 cathode through R15
9. IC5 anode through R25
10. IC5 cathode

by applying any combination on ID2-5 I was not able to have it output power.
IC6 is active when IC5 gets power, but that's the only reaction I got.

test points:
- T3-8 -- TP9 -- TR4 -- TP8
- TP8: 38 kHz @ 1V
- TP9: 38 kHz @ 60V
- TP10: ground
- TP11: PWM 38 kHz @ 13V
- TP12: 6V
- TP13: 16.6V

A4-250
------

H-bridge module mounted on A4-246

PL2 connection:
1. ground
2. orange wire (H-bridge output)
3. yellow wire (H-bridge output)
4. VCC (6V)

PL5:
5. IC3 collector
7. VCC
8. ground
9. ground
10. IC6 anode
12. IC5 collector
13. IC2 emitter (pulled down)
14. IC4 emmiter (pulled down)

front panel
-----------

1x5 connector, to main board:
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
---

1x2 connector, to main board:
1. red: 12V
2. black: ground

MBLK019/MBLK020
---------------

controls which TECs get power, and how.

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

1x6 conenctor, to TEC and power supply.

MBLK009
-------

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

2x7 IDC connector:
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)

1x6 conenctor to TECs:
- 1 -- free standing 93 °C fuse -- fuse in heat sink -- 2x top TECs in series -- 2
- 2 -- 2x middle-top TECs in series -- 3
- 4 -- 2x middle-bottom TECs in series -- 5
- 5 -- 2x bottom TECs in series -- 6

when 3 is + and 1 is -, the top half bed heats up.
when 6 is + and 4 is -, the bottom half bed heats up.

MBLK005
-------

this is the main controller board.
it is connected to all other parts through individual connectors, or the card edge connector.

the 2.4V rechargeable battery was empty and leaking, with spades corroded.
changing the battery did not change anything: the thermo-cycle goes to sleep after power up.
I don't know it it hold the calibration data in SRAM and the reason why the device has been sold as defective.

This is replaced by a custom controller board for which this firmware is.

board
=====

The MBLK005-replacement board uses a [blue pill](https://wiki.cuvoodoo.info/doku.php?id=stm32f1xx#blue_pill), based on a STM32F103C8T6.

peripherals
===========

additional peripherals to operate the thermo cycler:

SSD1306 OLED screen to show the detailed state:
1. GND
2. VDD
3. SCK
4. SDA

24V 12A power supply replacing the A4-246.
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.
12V is not enough to heat the TECs rapidly up to 94 °C.

connections
===========

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

DS18B20 1-Wire temperature sensor, 1x3:
1. OWD, PB8
2. ground
3. 3.3V

code
====

dependencies
------------

The source code uses the [libopencm3](http://libopencm3.org/) library.
The projects is already a git submodules.
It will be initialized when compiling the firmware.
Alternatively you can run once: `git submodule init` and `git submodule update`.

firmware
--------

To compile the firmware run `rake`.

documentation
-------------

To generate doxygen documentation run `rake doc`.

flash
-----

There are two firmware images: `bootloader` and `application`.
The `bootloader` image allows to flash the `application` over USB using the DFU protocol.
The `bootloader` is started first and immediately jumps to the `application` if it is valid and the DFU mode is not forced (i.e. by pressing the user button on the board or requesting a DFU detach in the `application`).
The `application` image is the main application and is implemented in `application.c`.
It is up to the application to advertise USB DFU support (i.e. as does the provided USB CDC ACM example).

The `bootloader` image will be flashed using SWD (Serial Wire Debug).
For that you need an SWD adapter.
The `Makefile` uses a ST-Link V2 programmer along OpenOCD software (default), or Black Magic Probe.
To flash the `booltoader` using SWD run `rake flash_booloader`.
If the development board uses the CKS32 chip STM32 alternative, use `CPUTAPID=0x2ba01477 rake flash_booloader`.

Once the `bootloader` is flashed it is possible to flash the `application` over USB using the DFU protocol by running `rake flash`.
To force the bootloader to start the DFU mode press the user button or short a pin, depending on the board.
It is also possible to flash the `application` image using SWD by running `rake flash_application`.

debug
-----

SWD also allows to debug the code running on the micro-controller using GDB.
To start the debugging session run `rake debug`.

USB
---

The firmware offers serial communication over USART1 and USB (using the CDC ACM device class).