2019-02-20 13:34:54 +01:00
# Dual magnetic stir controller
## Overview
This is the Arduino sketch to build a double magnetic stirrer based on 2 fans, a 1602 LCD display, a KY-040 encoder and an Arduino (e.g. Uno, Leonardo, Pro Micro).
< p align = "center" >
< img src = "https://github.com/micworg/stir/blob/master/images/stir.jpg" width = 500 >
< / p >
In order to put the stirrer into operation you have to change the settings in stir.ino according to your setup.
## Overview of Functions
All functions are controlled by the KY-040 encoder:
* **Press briefly:** change between menu, stirrer 1 and stirrer 2
* **Turn when menu is selected**: change between menu items (SPEED, BOOST, BTIME, CATCH, CTIME)
* **Long press when menu is selected**: Lock all functions (unlock also by long press)
* **When a stirrer is selected**:
* **SPEED**: turn sets speed, long press switches stirrer on or off.
* **BOOST**: turn sets boost speed, long press activates/deactivates the boost function (running time is shown in the display).
* **BTIME**: turn sets the boost time in minutes.
* **CATCH**: turn activates/deactivates the fishing function
2019-02-20 16:47:53 +01:00
* **CTIME**: turn sets the interval in minutes for the fish catching function
2019-02-20 13:34:54 +01:00
## Display Indicators:
* **Bottom Left**: Menu
* **Bottom centre/right**: Displays the set values for the stirrers depending on the selected menu item.
* **Top Center/Right**: Displays the current stirrer speed (or 'OFF' or 'CAT' (Fishing)).
* **Top left**: shows the remaining time of the boost function.
2019-02-20 16:47:53 +01:00
## Settings (in stir.ino)
2019-02-20 13:34:54 +01:00
2019-02-20 16:47:53 +01:00
|Value|Description|
|:----|:----------|
|SPEEDINC|increment of speed values when turning the encoder|
2019-02-20 16:53:02 +01:00
|FANMIN|fan minimum speed (should be a value at which the fan runs safely)|
|FANMAX|maximum speed of the fan (it is important that this is the real maximum value of the fan)|
2019-02-20 16:47:53 +01:00
|RINTERVAL|regulation interval (ms)|
2019-02-20 16:53:02 +01:00
|RDELAY|extra regulation delay when value changes (ms)|
|CATCHSTOP|stop interval for stir fish catch function (ms)|
2019-02-20 16:47:53 +01:00
|PWM0, PWN1|PWM output pins|
|I0, I1|interrupts for rpm measurement (2 and 3 for Leonardo and ProMicro / 0 and 1 for Uno)|
|CLK, DT, SW|pins for KY-040 encoder|
2019-02-20 13:34:54 +01:00
2019-02-20 16:47:53 +01:00
## Schematics
2019-02-20 13:34:54 +01:00
< p align = "center" >
< img src = "https://github.com/micworg/stir/blob/master/images/schematic_leonardo.png" width = 500 >
2019-02-20 16:25:19 +01:00
< img src = "https://github.com/micworg/stir/blob/master/images/schematic_promicro.png" width = 500 >
2019-02-20 13:34:54 +01:00
< img src = "https://github.com/micworg/stir/blob/master/images/schematic_uno.png" width = 500 >
< / p >