Cooler based on ESP8266

Works done? Proud of it? Show off here! Let's see what you've built can help inspire others.

Cooler based on ESP8266

Postby Mars » Tue Oct 19, 2021 5:17 pm

In terms of device selection, this application needs to use a temperature sensor to detect the environmental temperature change. An esp8266 is used as the main control, a stepping motor, and an LED indicator. The most important is the stone TFT LCD screen, which is used to communicate with the MCU.

Device list

1. DS18B20*1;
2. Esp8266 module * 1;
3. LED lamp * 3;
4. Stepper motor * 1;
5. Stone TFT LCD screen * 1.

GUI design

STONE-LCD-Arduino-ESP8266-Cooler (2).jpg


Connection

STONE-LCD-Arduino-ESP8266-Cooler (3).jpg
Mars
Novice
 
Posts: 28
Joined: Tue Jun 22, 2021 11:10 am

Re: Cooler based on ESP8266

Postby Mars » Tue Oct 19, 2021 5:19 pm

Code sharing

CODE: SELECT_ALL_CODE
if(dataflag == true)
  {
    if(datalen == 13)
    {
        memset(RecievedTemp, 0 , 13);
        for(cout_i = 0; cout_i < 13; cout_i ++)
        {
          RecievedTemp[cout_i] = Serial.read();
        }
        Serial.write(RecievedTemp, 13);
        memset(RecievedTemp, 0 , 13);
        dataflag = false;
    }       
  }
  else if(datalen == 9)
  {
    memset(RecievedTemp, 0 , 9);
    for(cout_i = 0; cout_i < 9; cout_i ++)
    {
      RecievedTemp[cout_i] = Serial.read();
    }
      Serial.write(RecievedTemp, 9);
    switch(RecievedTemp[5])
    {
    case 0x39://temp
      if(HeadStepper.isRunning() == true)
      {

        HeadStepper.stop();   
      }
    StepperStart = false;
//    TempStartStop = true;
    Temperatue = RecievedTemp[8];
      break;
    case 0x2B://temp start
      TempStartStop = true;
      StepperStart = false;
//        HeadStepper_Setting_Run(speed_str[0], 5);
    break;
    case 0x2A://temp stop
      if(HeadStepper.isRunning() == true)
      {
        HeadStepper.stop(); 
      }
      TempStartStop = false;
      StepperStart = false;
//      terstop = true;
    break;
    case 0x2E://mode gear
        if(HeadStepper.isRunning() == true)
      {
        HeadStepper.stop(); 
      }
        settingbuf[0] = speed_str[RecievedTemp[8]];
        if(RecievedTemp[8] == 3)
      {
      digitalWrite(ledPin_1, LOW);   // turn the LED on (HIGH is the voltage level)
      digitalWrite(ledPin_2, HIGH);   // turn the LED on (HIGH is the voltage level)
      digitalWrite(ledPin_3, HIGH);   // turn the LED on (HIGH is the voltage level)
      }
      else if(RecievedTemp[8] == 2)
      {
      digitalWrite(ledPin_1, LOW);   // turn the LED on (HIGH is the voltage level)
      digitalWrite(ledPin_2, LOW);   // turn the LED on (HIGH is the voltage level)
      digitalWrite(ledPin_3, HIGH);   // turn the LED on (HIGH is the voltage level)
      }
      else
      {
      digitalWrite(ledPin_1, LOW);   // turn the LED on (HIGH is the voltage level)
      digitalWrite(ledPin_2, LOW);   // turn the LED on (HIGH is the voltage level)
      digitalWrite(ledPin_3, LOW);   // turn the LED on (HIGH is the voltage level)
      }
      break;
    case 0x34://mode timing
      if(HeadStepper.isRunning() == true)
      {
        HeadStepper.stop(); 
      }
     
        settingbuf[1] = RecievedTemp[8];
        break;
    case 0x2C://mode start
      if(settingbuf[1] == 0)
      {
        settingbuf[1] = 5;
      }
      TempStartStop = false;
      StepperStart = true;
      HeadStepper_Setting_Run(settingbuf[0], settingbuf[1]);
        break;
    case 0x2D://mode stop
      if(HeadStepper.isRunning() == true)
      {
        TempStartStop = false;
        StepperStart = false;
        HeadStepper.stop();   
      }
        break;
    default:
        break;
    }
   }


Video demo

https://www.youtube.com/watch?v=j---SAvTO40
Mars
Novice
 
Posts: 28
Joined: Tue Jun 22, 2021 11:10 am

Re: Cooler based on ESP8266

Postby DerekRoy » Fri Mar 18, 2022 7:51 pm

Atta boy!
Dr
DerekRoy
Fledgling
 
Posts: 1
Joined: Fri Mar 18, 2022 7:50 pm


Return to Project Showcase

Who is online

Users browsing this forum: No registered users and 0 guests

cron