Вместо приобретения дорогой паяльной станции за $500, GreatScott взял контроллер Arduino и собрал свою собственную паяльную станцию (паяльник и жало он всё же купил готовые), которая обошлась он ему всего в $100 долларов.
Скетч:
#include <SPI.h>
#include <Wire.h>
#include <max6675.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#define OLED_MOSI 11
#define OLED_CLK 13
#define OLED_DC 8
#define OLED_CS 10
#define OLED_RESET 9
#define thermoDO 11
#define thermoCS 12
#define thermoCLK 13
#define potentiometer A3
#define zerocrossing 2
#define triac 7
#define input 5
float temperature;
int pottemperature;
int counter;
Adafruit_SSD1306 display(OLED_MOSI, OLED_CLK, OLED_DC, OLED_RESET, OLED_CS);
MAX6675 thermocouple(thermoCLK, thermoCS, thermoDO);
void setup() {
display.begin(SSD1306_SWITCHCAPVCC);
pinMode(potentiometer, INPUT);
pinMode(zerocrossing, INPUT_PULLUP);
pinMode(triac, OUTPUT);
digitalWrite(triac, LOW);
display.setTextSize(2);
display.setTextColor(WHITE);
counter = 0;
temperature = thermocouple.readCelsius();
updatedisplay();
attachInterrupt(0, zero, RISING);
}
void loop() {
}
void zero() {
counter++;
if (counter < 40) {
if (temperature <= pottemperature) {
digitalWrite(triac, HIGH);
}
else {
digitalWrite(triac, LOW);
}
}
if (counter == 40) {
digitalWrite(triac, LOW);
detachInterrupt(0);
temperature = thermocouple.readCelsius();
updatedisplay();
counter = 0;
attachInterrupt(0, zero, RISING);
}
}
void updatedisplay() {
pottemperature = analogRead(potentiometer);
pottemperature = map(pottemperature, 0, 1023, 0, 400);
display.clearDisplay();
display.setCursor(0, 0);
display.print("SET:");
display.print(pottemperature);
display.setCursor(0, 20);
display.print("TMP:");
display.print(int(temperature));
display.display();
}
Ссылки
DIY Arduino Soldering Station
По теме
Самодельный робот-пайщик
Контроль температуры воды в газовой колонке при помощи Arduino
Простой ЧПУ под управлением Arduino
Автомат для нарезания провода
Arduino
Arduino, термины, начало работы
КМБ для начинающих ардуинщиков
Состав стартера (точка входа для начинающих ардуинщиков)
