0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

タニーさんの机で大惨事、水中ポンプで大洪水発生!!

Posted at

ミカさんやシノさんに触発されたタニーさん

TLP-A100やTLP-Pシリーズを使ってミカさんやシノさんが回路を組んでいるのを見て、自分もやってみたくなったタニーさん。回路を組んで上手く動いたは良いものの、机の上が大変な大洪水になってしまいました。詳しくは動画を観てください。

参考

ESP32-WROOM-32DとMAX6675を組み合わせてK型熱電対の値をSPI経由で取得してみた。

回路

ACアダプタ -> TLP-A100.Type-C.INPUT
TLP-A100.VBUS.OUTPUT -> TLP-P050.VIN
TLP-A100.VBUS.GND -> TLP-P050.GND
TLP-P050.VOUT -> Pump.Posi
TLP-P050.GND -> Pump.Nega
TLP-A100.Type-C.OUTPUT -> ESP32.MicroUSB
TLP-A100.MicroUSB -> PC

ESP32.PIN18 -> MAX6675.SCK
ESP32.PIN19 -> MAX6675.SO
ESP32.PIN05 -> MAX6675.CS
ESP32.PIN17 -> TLP-P050.EN

使用部品

TLP-A100
TLP-P050
水中ポンプ
適用 MAX6675モジュール Kタイプ 熱電対センサー
waves ESP32 DevKitC V4 ESP-WROOM-32 ESP-32 WiFi BLE (5個セット)

プログラム

熱電対の温度が70℃を超えるとポンプが動作する仕組みです。

#include "max6675.h"
 
int thermoDO = 19;
int thermoCS = 5;
int thermoCLK = 18;
const int PIN_PUMP = 17;
byte bPUMP;

MAX6675 thermocouple(thermoCLK, thermoCS, thermoDO);
 
void setup()
{
  Serial.begin(9600);
  Serial.println("MAX6675 test");
  delay(500);
  bPUMP = LOW;
  pinMode( PIN_PUMP, OUTPUT );
  digitalWrite( PIN_PUMP, LOW );
}
 
void loop()
{
  // basic readout test, just print the current temp
  
  Serial.print("C = ");
  Serial.println(thermocouple.readCelsius());
//  Serial.print("F = ");
//  Serial.println(thermocouple.readFahrenheit());
  if ( thermocouple.readCelsius() > 70.0 ){
    if ( bPUMP == LOW ){
      bPUMP = HIGH;
      digitalWrite( PIN_PUMP, HIGH );
    }
  }else{
    if ( bPUMP == HIGH ){
      bPUMP = LOW;
      digitalWrite( PIN_PUMP, LOW );
    }
  }
  delay(1000);
}

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?