Cov txheej txheem:

Kub Sensor rau Arduino Siv rau COVID 19: 12 Cov Kauj Ruam (nrog Duab)
Kub Sensor rau Arduino Siv rau COVID 19: 12 Cov Kauj Ruam (nrog Duab)

Video: Kub Sensor rau Arduino Siv rau COVID 19: 12 Cov Kauj Ruam (nrog Duab)

Video: Kub Sensor rau Arduino Siv rau COVID 19: 12 Cov Kauj Ruam (nrog Duab)
Video: СЕНСОРНЫЙ ПЕЙДЖЕР НА ARDUINO 2024, Kaum ib hlis
Anonim
Kub Sensor rau Arduino Thov rau COVID 19
Kub Sensor rau Arduino Thov rau COVID 19

Qhov ntsuas kub rau Arduino yog lub hauv paus tseem ceeb thaum peb xav ntsuas qhov ntsuas kub ntawm tus txheej txheem ntawm tib neeg lub cev.

Qhov ntsuas kub nrog Arduino yuav tsum muaj kev sib cuag lossis ze kom tau txais thiab ntsuas qib cua sov. Ntawd yog qhov ntsuas cua sov ua haujlwm li cas.

Cov cuab yeej no tau siv los ntsuas lub cev kub ntawm cov neeg mob, vim qhov ntsuas kub yog ib qho ntawm thawj yam uas hloov pauv hauv tib neeg lub cev thaum muaj qhov txawv txav lossis kab mob.

Ib ntawm cov kab mob uas hloov pauv qhov kub ntawm tib neeg lub cev yog COVID 19. Yog li, peb nthuav qhia cov tsos mob tseem ceeb:

Ua pa nkees Ua pa nyuaj (mob hnyav) Ua npaws Ua npaws yog ib tsos mob uas nws tus yam ntxwv tseem ceeb yog ua kom lub cev sov nce ntxiv. Hauv tus kab mob no, peb yuav tsum tau saib xyuas tas li cov tsos mob no.

Yog li, peb yuav tsim txoj haujlwm los tshuaj xyuas qhov kub thiab khaws cov ntaub ntawv no ntawm daim npav nco los ntawm JLCPCB Datalogger siv lub ntsuas kub nrog Arduino.

Yog li, hauv kab lus no koj yuav kawm:

  • JLCPCB Datalogger nrog ntsuas kub nrog Arduino li cas?
  • Ua haujlwm li cas qhov ntsuas kub nrog Arduino.
  • Ua haujlwm li cas DS18B20 qhov ntsuas kub nrog Arduino
  • Siv cov nyees khawm nrog ntau lub luag haujlwm.

Tom ntej no, peb yuav qhia koj li cas koj yuav txhim kho koj li JLCPCB Datalogger siv Arduino qhov ntsuas kub.

Khoom siv

Arduino UAS

JLCPCB Luam Circuit Board

DS18B20 Kub Sensor

Arduino Nano R3

Cov neeg dhia

LCD Zaub 16 x 2

Pushbutton hloov

Kev tiv thaiv 1kR

SD Card Module rau Arduino

Kauj Ruam 1: Kev tsim kho JLCPCB Datalogger Nrog Kub Sensor Nrog Arduino

Kev tsim kho ntawm JLCPCB Datalogger Nrog Kub Sensor Nrog Arduino
Kev tsim kho ntawm JLCPCB Datalogger Nrog Kub Sensor Nrog Arduino

Raws li tau hais yav dhau los, txoj haujlwm suav nrog tsim JLCPCB Datalogger nrog Kub Sensor nrog Arduino, thiab los ntawm cov ntaub ntawv no, peb tuaj yeem saib xyuas qhov ntsuas kub ntawm tus neeg mob.

Yog li, lub Circuit Court tau qhia hauv daim duab saum toj no.

Yog li ntawd, raws li koj tuaj yeem pom, lub voj voog no muaj DS18B20 ntsuas kub nrog Arduino, uas yog lub luag haujlwm ntsuas tus neeg mob qhov ntsuas kub.

Ib qho ntxiv, Arduino Nano yuav yog lub luag haujlwm khaws cov ntaub ntawv no thiab khaws cia rau hauv SD Card Module lub cim xeeb daim npav.

Txhua cov ntaub ntawv yuav raug cawm nrog nws lub sijhawm, uas yuav raug nyeem los ntawm RTC Module DS1307.

Yog li, rau cov ntaub ntawv ntawm qhov ntsuas kub nrog Arduino kom raug cawm, tus neeg siv yuav tsum ua cov txheej txheem los ntawm Cov Ntawv Qhia Tswj nrog 16x2 LCD.

Kauj ruam 2:

Duab
Duab

Txhua lub khawm yog lub luag haujlwm tswj hwm qhov kev xaiv, raws li qhia hauv LCD screen 16x2 hauv daim duab 2.

Txhua qhov kev xaiv yog lub luag haujlwm rau kev ua haujlwm hauv cov kab ke, raws li qhia hauv qab no.

  • Kev Xaiv M yog lub luag haujlwm pib ntsuas thiab sau cov ntaub ntawv ntawm Daim Npav Nco.
  • Kev xaiv H yog lub luag haujlwm rau kho cov txheej txheem teev.
  • Kev xaiv O/P yog siv los lees paub cov ntaub ntawv nkag mus rau hauv kab ke lossis ncua kev sau cov ntaub ntawv mus rau daim npav nco.

Txhawm rau nkag siab cov txheej txheem kev tswj hwm, peb yuav muab cov cai hauv qab no thiab tham txog cov txheej txheem kev tswj hwm ib qib zuj zus ntawm JLCPCB Datalogger nrog Kub Sensor nrog Arduino.

#suav nrog // Lub tsev qiv ntawv nrog txhua txoj haujlwm ntawm DS18B20 Sensor

#include #include // Biblioteca I2C do LCD 16x2 #include // Biblioteca de Comunicacao I2C #include // OneWire Library rau DS18B20 Sensor #include #include LiquidCrystal_I2C lcd (0x27, 16, 2); // Configurando o endereco do LCD 16x2 para 0x27 #define ONE_WIRE_BUS 8 // Digital Pin los txuas rau DS18B20 Sensor // Txhais uma instancia ua oneWire rau comunicacao com o sensor OneWire oneWire (ONE_WIRE_BUS); DallasTemperature sensors (& oneWire); DeviceAddress sensor1; Ua ntaub ntawv myFile; #define Buttonmeasure 2 #define Buttonadjusthour 3 #define Buttonok 4 bool ntsuas = 0, hloov kho = 0, ok = 0; bool measure_state = 0, hloov kho lub sijhawm = 0, ok_state = 0; bool measure_process = 0, kho_process = 0; byte actualMin = 0, yav dhau los Min = 0; byte actualHour = 0, yav dhau losHour = 0; byte minUpdate = 0; int pinoSS = 10; // Pin 53 rau Mega / Pin 10 rau UNO int DataTime [7]; void updateHour () {DS1307.getDate (DataTime); yog (DataTime [5]! = minUpdate) {sprintf (zaug, "%02d:%02d", DataTime [4], DataTime [5]); lcd.setCursor (0, 0); lcd.print (""); lcd.setCursor (5, 0); lcd.print (lub sijhawm); minUpdate = DataTime [5]; }} void updateTemp () {DS1307.getDate (DataTime)); yog (DataTime [5]! = minUpdate) {sprintf (zaug, "%02d:%02d", DataTime [4], DataTime [5]); lcd.clear (); lcd.setCursor (5, 0); lcd.print (lub sijhawm); lcd.setCursor (0, 1); lcd.print ("Kub:"); lcd.setCursor (14, 1); sensors.requestTemperatures (); ntab TempSensor = sensors.getTempCByIndex (0); lcd.print (TempSensor); minUpdate = DataTime [5]; }} void teeb () {Serial.begin (9600); DS1307.begin (); sensors.begin (); tus pinMode (pinoSS, OUTPUT); // Tshaj tawm pinoSS como saída Wire.begin (); // Inicializacao da Comunicacao I2C lcd.init (); // Inicializacao ua LCD lcd.backlight (); lcd.setCursor (3, 0); lcd.print ("Temp System"); lcd.setCursor (3, 1); lcd.print ("Datalogger"); ncua (2000); // Localiza e mostra enderecos dos sensores Serial.println ("Localizando sensores DS18B20 …"); Serial.print ("Sensor Localization ua tiav!"); Serial.print (sensors.getDeviceCount (), DEC); Serial.println ("Sensor"); if (SD.begin ()) {// Inicializa o SD Card Serial.println ("SD Card pronto para uso."); // Imprime na tela} else {Serial.println ("Falha na inicialização do SD Card."); rov qab; } DS1307.getDate (DataTime); lcd.clear (); sprintf (sijhawm, "%02d:%02d", DataTime [4], DataTime [5]); lcd.setCursor (5, 0); lcd.print (lub sijhawm); lcd.setCursor (0, 1); lcd.print ("1-M 2-H 3-O/P"); } tsis muaj dab tsi voj () {updateHour (); // Nyeem khawm lub xeev ntsuas = digitalRead (Ntsuas ntsuas); adjusthour = digitalRead (Buttonadjusthour); ok = digitalRead (Buttonok); yog (ntsuas == 0 && ntsuas_state == 1) {ntsuas_state = 0; } yog (ntsuas == 1 && ntsuas_state == 0 && ntsuas_process == 0) {ntsuas_process = 1; ntsuas_state = 1; yog (SD.exists ("temp.txt")) {Serial.println ("Apagou o arquivo anterior!"); SD.remove ("temp.txt"); myFile = SD.open ("temp.txt", FILE_WRITE); // Cria / Abre arquivo.txt Serial.println ("Criou o arquivo!"); } lwm {Serial.println ("Criou o arquivo!"); myFile = SD.open ("temp.txt", FILE_WRITE); // Cria / Abre arquivo.txt myFile.close (); } ncua (500); myFile.print ("Teev:"); myFile.println ("Kub"); DS1307.getDate (DataTime); realMin = yav dhau los Min = DataTime [5]; sprintf (sijhawm, "%02d:%02d", DataTime [4], DataTime [5]); lcd.clear (); lcd.setCursor (5, 0); lcd.print (lub sijhawm); lcd.setCursor (0, 1); lcd.print ("Kub:"); lcd.setCursor (14, 1); sensors.requestTemperatures (); ntab TempSensor = sensors.getTempCByIndex (0); lcd.print (TempSensor); } yog (adjusthour == 0 && adjusthour_state == 1) {adjusthour_state = 0; } yog (adjusthour == 1 && adjusthour_state == 0 && measure_process == 0) {adjust_process = 1; } // ------------------------------------------------------- --- Ntsuas Txheej Txheem --------------------------------------------- -------------- yog (ntsuas_process == 1) {updateTemp (); byte contMin = 0, contHour = 0; DS1307.getDate (DataTime); realMin = DataTime [5]; // ----------------------------------------------------------------------- --------- Suav Minute --------------------------------------- ------------------- yog (actualMin! = previousMin) {contMin ++; yav dhau los Min = realMin; } yog (contMin == 5) {sprintf (sijhawm, "%02d:%02d", DataTime [4], DataTime [5]); sensors.requestTemperatures (); ntab TempSensor = sensors.getTempCByIndex (0); myFile.print (lub sijhawm); myFile.println (TempSensor); contMin = 0; } // ------------------------------------------------------- ------------ Suav Teev Sijhawm ---------------------- ---------------------- yog (actualHour! = previousHour) {contHour ++; yav dhau losHour = actualHour; } yog (contHour == 5) {myFile.close (); lcd.clear (); lcd.setCursor (5, 0); lcd.print ("Tiav lawm"); lcd.setCursor (5, 1); lcd.print ("Txheej Txheem"); cov_process = 0; contHour = 0; } // ------------------------------------------------------- Tus mob kom tsis txhob muaj cov ntaub ntawv teev npe ------------------------------ ---- yog (ok == 1) {myFile.close (); lcd.clear (); lcd.setCursor (6, 0); lcd.print ("Nres"); lcd.setCursor (5, 1); lcd.print ("Txheej Txheem"); cov_process = 0; ncua (2000); lcd.clear (); DS1307.getDate (DataTime); sprintf (sijhawm, "%02d:%02d", DataTime [4], DataTime [5]); lcd.setCursor (5, 0); lcd.print (lub sijhawm); lcd.setCursor (0, 1); lcd.print ("1-M 2-H 3-O/P"); }} // ------------------------------------------------------- ------- Kho Sijhawm ----------------------------------------- ---------------------- // Kho Sij Hawm yog (kho _ kev ua == 1) {lcd.clear (); DS1307.getDate (DataTime); lcd.setCursor (0, 0); lcd.print ("Kho Sijhawm:"); sprintf (sijhawm, "%02d:%02d", DataTime [4], DataTime [5]); lcd.setCursor (5, 1); lcd.print (lub sijhawm); // Teev Sijhawm hloov ua {ntsuas = digitalRead (Buttonmeasure); adjusthour = digitalRead (Buttonadjusthour); ok = digitalRead (Buttonok); yog (ntsuas == 0 && ntsuas_state == 1) {ntsuas_state = 0; } yog (ntsuas == 1 && ntsuas_state == 0) {DataTime [4] ++; yog (DataTime [4]> 23) {DataTime [4] = 0; } ntsuas_state = 1; sprintf (sijhawm, "%02d:%02d", DataTime [4], DataTime [5]); lcd.setCursor (5, 1); lcd.print (lub sijhawm); DS1307.setDate (DataTime [0], DataTime [1], DataTime [2], DataTime [3], DataTime [4], DataTime [5], 00); } yog (adjusthour == 0 && adjusthour_state == 1) {adjusthour_state = 0; } yog (adjusthour == 1 && adjusthour_state == 0) {DataTime [5] ++; yog (DataTime [5]> 59) {DataTime [5] = 0; } sprintf (sijhawm, "%02d:%02d", DataTime [4], DataTime [5]); lcd.setCursor (5, 1); lcd.print (lub sijhawm); DS1307.setDate (DataTime [0], DataTime [1], DataTime [2], DataTime [3], DataTime [4], DataTime [5], 00); adjusthour_state = 1; } yog (ok == 1) {lcd.clear (); DS1307.getDate (DataTime); sprintf (sijhawm, "%02d:%02d", DataTime [4], DataTime [5]); lcd.setCursor (0, 0); lcd.print (lub sijhawm); lcd.setCursor (0, 1); lcd.print ("1-M 2-H 3-O"); cov_process = 0; }} thaum (ok! = 1); } // ------------------------------------------------------- ------- Xaus Kho Sijhawm ---------------------------------------- -----------------------}

Ua ntej, peb txhais txhua lub tsev qiv ntawv rau kev tswj hwm cov qauv thiab tshaj tawm cov kev hloov pauv uas siv thaum ua haujlwm JLCPCB Datalogger nrog ntsuas kub rau Arduino. Txoj cai thaiv tau qhia hauv qab no.

Kauj ruam 3:

#suav nrog // Lub tsev qiv ntawv nrog txhua txoj haujlwm ntawm DS18B20 Sensor

#include #include // Biblioteca I2C do LCD 16x2 #include // Biblioteca de Comunicacao I2C #include // OneWire Library rau DS18B20 Sensor #include #include LiquidCrystal_I2C lcd (0x27, 16, 2); // Configurando o endereco do LCD 16x2 para 0x27 #define ONE_WIRE_BUS 8 // Digital Pin los txuas rau DS18B20 Sensor // Txhais uma instancia ua oneWire rau comunicacao com o sensor OneWire oneWire (ONE_WIRE_BUS); DallasTemperature sensors (& oneWire); DeviceAddress sensor1; Ua ntaub ntawv myFile; #define Buttonmeasure 2 #define Buttonadjusthour 3 #define Buttonok 4 bool ntsuas = 0, hloov kho = 0, ok = 0; bool measure_state = 0, hloov kho lub sijhawm = 0, ok_state = 0; bool measure_process = 0, kho_process = 0; byte actualMin = 0, yav dhau los Min = 0; byte actualHour = 0, yav dhau losHour = 0; byte minUpdate = 0; int pinoSS = 10; // Pin 53 rau Mega / Pin 10 rau UNO int DataTime [7];

Hauv qab no, peb muaj qhov tsis ua haujlwm teeb tsa. Lub luag haujlwm no yog siv los teeb tsa tus pin thiab kev pib ntaus ntawv, raws li qhia hauv qab no.

void teeb tsa ()

{Serial.begin (9600); DS1307.begin (); sensors.begin (); tus pinMode (pinoSS, OUTPUT); // Tshaj tawm pinoSS como saída Wire.begin (); // Inicializacao da Comunicacao I2C lcd.init (); // Inicializacao ua LCD lcd.backlight (); lcd.setCursor (3, 0); lcd.print ("Temp System"); lcd.setCursor (3, 1); lcd.print ("Datalogger"); ncua (2000); // Localiza e mostra enderecos dos sensores Serial.println ("Localizando sensores DS18B20 …"); Serial.print ("Sensor Localization ua tiav!"); Serial.print (sensors.getDeviceCount (), DEC); Serial.println ("Sensor"); if (SD.begin ()) {// Inicializa o SD Card Serial.println ("SD Card pronto para uso."); // Imprime na tela} else {Serial.println ("Falha na inicialização do SD Card."); rov qab; } DS1307.getDate (DataTime); lcd.clear (); sprintf (sijhawm, "%02d:%02d", DataTime [4], DataTime [5]); lcd.setCursor (5, 0); lcd.print (lub sijhawm); lcd.setCursor (0, 1); lcd.print ("1-M 2-H 3-O/P"); }

Ua ntej, kev sib tham hauv xov tooj, lub sijhawm tiag tiag thiab ntsuas kub rau Arduino DS18B20 tau pib ua. Lub vijtsam no tau qhia hauv daim duab 1.

Kauj ruam 4:

Tom qab ntawd, lub kaw lus nyeem cov xuaj moos thiab hloov kho tus nqi los ntawm kev hu xov tooj hloov tshiab. Yog li, txoj haujlwm no muaj lub hom phiaj nthuav qhia tus nqi teev txhua feeb. Txoj haujlwm muaj nuj nqi thaiv tau qhia hauv qab no.

void updateHour ()

{DS1307.getDate (DataTime); yog (DataTime [5]! = minUpdate) {sprintf (zaug, "%02d:%02d", DataTime [4], DataTime [5]); lcd.setCursor (0, 0); lcd.print (""); lcd.setCursor (5, 0); lcd.print (lub sijhawm); minUpdate = DataTime [5]; }}

Kauj ruam 5:

Duab
Duab

Ntxiv rau kev hloov kho cov sijhawm, tus neeg siv tuaj yeem xaiv ib qho ntawm peb lub khawm los tshuaj xyuas tus neeg mob nrog ntsuas kub nrog Arduino. Lub Circuit Court tau qhia hauv daim duab saum toj no.

Kauj Ruam 6: JLCPCB Datalogger Control Menu

JLCPCB Datalogger Tswj Cov Ntawv Qhia
JLCPCB Datalogger Tswj Cov Ntawv Qhia

Ua ntej tshaj, tus neeg siv yuav tsum tshawb xyuas thiab kho cov txheej txheem teev. Cov txheej txheem no tau ua thaum khawm thib ob raug nias.

Thaum lub pob nyem, lub vijtsam hauv qab no yuav tsum tshwm, uas tau qhia hauv daim duab saum toj no.

Kauj ruam 7:

Duab
Duab

Los ntawm lub vijtsam no, tus neeg siv yuav tuaj yeem nkag mus rau teev thiab feeb qhov tseem ceeb los ntawm cov nyees khawm txuas nrog digital pins 2 thiab 3 ntawm Arduino. Cov nyees khawm tau qhia hauv daim duab saum toj no.

Cov cai rau kev tswj hwm cov sijhawm teev tseg hauv qab no.

yog (adjusthour == 0 && adjusthour_state == 1)

{adjusthour_state = 0; } yog (adjusthour == 1 && adjusthour_state == 0 && measure_process == 0) {adjust_process = 1; }

Thaum cov xuab moos 'khawm tau nias thiab ntsuas kev ntsuas sib txawv tau teeb tsa rau 0, qhov xwm txheej yuav muaj tseeb thiab qhov hloov pauv _ kev ua haujlwm sib txawv yuav raug teeb tsa rau 1. Cov ntsuas_ cov txheej txheem sib txawv tau siv los qhia tias lub kaw lus saib xyuas qhov kub thiab txias. Thaum nws tus nqi yog 0, lub kaw lus yuav tso cai rau tus neeg siv nkag mus rau lub sijhawm teev cov ntawv qhia zaub mov. Yog li ntawd, tom qab kho qhov hloov pauv tau txais tus nqi ntawm 1, lub kaw lus yuav nkag mus rau lub sijhawm hloov kho. Txoj cai thaiv no tau qhia hauv qab no.

// ----------------------------------------------------------------------- ----- Kho Sijhawm ------------------------------------------- ----------------------- Ua Tsaug Ntau

// Kho Sij Hawm yog (kho_process == 1) {lcd.clear (); DS1307.getDate (DataTime); lcd.setCursor (0, 0); lcd.print ("Kho Sijhawm:"); sprintf (sijhawm, "%02d:%02d", DataTime [4], DataTime [5]); lcd.setCursor (5, 1); lcd.print (lub sijhawm); // Teev Sijhawm hloov ua {ntsuas = digitalRead (Buttonmeasure); adjusthour = digitalRead (Buttonadjusthour); ok = digitalRead (Buttonok); yog (ntsuas == 0 && ntsuas_state == 1) {ntsuas_state = 0; } yog (ntsuas == 1 && ntsuas_state == 0) {DataTime [4] ++; yog (DataTime [4]> 23) {DataTime [4] = 0; } ntsuas_state = 1; sprintf (sijhawm, "%02d:%02d", DataTime [4], DataTime [5]); lcd.setCursor (5, 1); lcd.print (lub sijhawm); DS1307.setDate (DataTime [0], DataTime [1], DataTime [2], DataTime [3], DataTime [4], DataTime [5], 00); } yog (adjusthour == 0 && adjusthour_state == 1) {adjusthour_state = 0; } yog (adjusthour == 1 && adjusthour_state == 0) {DataTime [5] ++; yog (DataTime [5]> 59) {DataTime [5] = 0; } sprintf (sijhawm, "%02d:%02d", DataTime [4], DataTime [5]); lcd.setCursor (5, 1); lcd.print (lub sijhawm); DS1307.setDate (DataTime [0], DataTime [1], DataTime [2], DataTime [3], DataTime [4], DataTime [5], 00); adjusthour_state = 1; } yog (ok == 1) {lcd.clear (); DS1307.getDate (DataTime); sprintf (sijhawm, "%02d:%02d", DataTime [4], DataTime [5]); lcd.setCursor (0, 0); lcd.print (lub sijhawm); lcd.setCursor (0, 1); lcd.print ("1-M 2-H 3-O"); cov_process = 0; }} thaum (ok! = 1); }

Hauv qhov xwm txheej no, lub kaw lus yuav nthuav tawm cov lus pom hauv Daim Duab 4 thiab tom qab ntawd tos rau qhov txiaj ntsig los kho sab hauv thaum lub sijhawm ua haujlwm. Thaum kho cov xuab moos, cov nyees khawm no muaj lawv cov haujlwm hloov pauv, uas yog, lawv muaj ntau txoj haujlwm.

Qhov no tso cai rau koj siv lub pob rau ntau dua ib qho haujlwm thiab txo qhov nyuaj ntawm cov kab ke.

Ua li no, tus neeg siv yuav hloov kho tus nqi ntawm cov teev thiab feeb thiab tom qab ntawd khaws cov ntaub ntawv hauv kab ke thaum nias lub pob Ok.

Raws li koj tuaj yeem pom, lub kaw lus yuav nyeem 3 khawm, raws li qhia hauv qab no.

ntsuas = digitalRead (Ntsuas ntsuas);

adjusthour = digitalRead (Buttonadjusthour); ok = digitalRead (Buttonok);

Nco ntsoov tias lub ntsuas ntsuas (Buttonmeasure) tau hloov pauv nws txoj haujlwm. Tam sim no nws yuav raug siv los kho cov nqi teev, raws li qhia hauv qab no. Ob qhov xwm txheej hauv qab no zoo ib yam thiab tau siv los kho cov teev thiab feeb, raws li qhia saum toj no.

yog (ntsuas == 0 && ntsuas_state == 1)

{ntsuas_state = 0; } yog (ntsuas == 1 && ntsuas_state == 0) {DataTime [4] ++; yog (DataTime [4]> 23) {DataTime [4] = 0; } ntsuas_state = 1; sprintf (sijhawm, "%02d:%02d", DataTime [4], DataTime [5]); lcd.setCursor (5, 1); lcd.print (lub sijhawm); DS1307.setDate (DataTime [0], DataTime [1], DataTime [2], DataTime [3], DataTime [4], DataTime [5], 00); } yog (adjusthour == 0 && adjusthour_state == 1) {adjusthour_state = 0; } yog (adjusthour == 1 && adjusthour_state == 0) {DataTime [5] ++; yog (DataTime [5]> 59) {DataTime [5] = 0; } sprintf (sijhawm, "%02d:%02d", DataTime [4], DataTime [5]); lcd.setCursor (5, 1); lcd.print (lub sijhawm); DS1307.setDate (DataTime [0], DataTime [1], DataTime [2], DataTime [3], DataTime [4], DataTime [5], 00); adjusthour_state = 1; }

Yog li ntawd, txhua lub sijhawm ib ntawm ob lub khawm raug nias, tus nqi ntawm txoj haujlwm 4 thiab 5 ntawm DataTime vector yuav raug hloov pauv thiab thib ob, cov txiaj ntsig no yuav raug cawm hauv DS1307 nco.

Tom qab hloov kho, tus neeg siv yuav tsum nyem rau ntawm Ok khawm, kom ua tiav cov txheej txheem. Thaum qhov xwm txheej no tshwm sim, lub kaw lus yuav ua raws cov kab hauv qab no.

yog (ok == 1)

{lcd.clear (); DS1307.getDate (DataTime); sprintf (sijhawm, "%02d:%02d", DataTime [4], DataTime [5]); lcd.setCursor (0, 0); lcd.print (lub sijhawm); lcd.setCursor (0, 1); lcd.print ("1-M 2-H 3-O"); cov_process = 0; }

Nws yuav nkag mus rau qhov xwm txheej saum toj no thiab nthuav tawm cov lus teev thiab Cov Ntawv Qhia Xaiv rau tus neeg siv.

Thaum kawg, tus neeg siv yuav tsum pib txheej txheem kev saib xyuas tus neeg mob los ntawm qhov ntsuas kub nrog Arduino JLCPCB Datalogger.

Txhawm rau ua qhov no, tus neeg siv yuav tsum nias lub pob ntsuas, uas txuas nrog tus lej digital 2.

Tom qab ntawd, lub kaw lus yuav ua qhov nyeem nrog ntsuas kub rau Arduino thiab txuag nws ntawm daim npav nco. Cheeb tsam thaj tsam tau qhia hauv daim duab saum toj no.

Kauj ruam 8:

Duab
Duab

Yog li ntawd, thaum lub pob nyem, ib feem ntawm cov cai hauv qab no yuav ua tiav.

yog (ntsuas == 0 && ntsuas_state == 1)

{ntsuas_state = 0; } yog (ntsuas == 1 && ntsuas_state == 0 && ntsuas_process == 0) {ntsuas_process = 1; ntsuas_state = 1; yog (SD.exists ("temp.txt")) {Serial.println ("Apagou o arquivo anterior!"); SD.remove ("temp.txt"); myFile = SD.open ("temp.txt", FILE_WRITE); // Cria / Abre arquivo.txt Serial.println ("Criou o arquivo!"); } lwm {Serial.println ("Criou o arquivo!"); myFile = SD.open ("temp.txt", FILE_WRITE); // Cria / Abre arquivo.txt myFile.close (); } ncua (500); myFile.print ("Teev:"); myFile.println ("Kub"); DS1307.getDate (DataTime); realMin = yav dhau los Min = DataTime [5]; sprintf (sijhawm, "%02d:%02d", DataTime [4], DataTime [5]); lcd.clear (); lcd.setCursor (5, 0); lcd.print (lub sijhawm); lcd.setCursor (0, 1); lcd.print ("Kub:"); lcd.setCursor (14, 1); sensors.requestTemperatures (); ntab TempSensor = sensors.getTempCByIndex (0); lcd.print (TempSensor); }

Hauv cov cai ib feem saum toj no, lub kaw lus yuav muab tus nqi 1 rau qhov ntsuas _ kev ua haujlwm sib txawv. Nws yog lub luag haujlwm tso cai rau khaws cov ntaub ntawv ntawm SD Card.

Ib qho ntxiv, lub kaw lus yuav tshuaj xyuas seb puas muaj cov ntawv sau nrog cov ntaub ntawv teev cia muaj nyob lossis tsis yog. Yog tias muaj cov ntaub ntawv, lub kaw lus yuav tshem tawm thiab tsim ib qho tshiab los khaws cov ntaub ntawv.

Tom qab ntawd, nws yuav tsim ob kab ntawv: ib qho rau teev thiab ib qho rau qhov ntsuas kub hauv cov ntawv.

Tom qab ntawd, nws yuav tso saib cov teev thiab ntsuas kub ntawm lub vijtsam LCD, raws li qhia hauv daim duab saum toj no.

Tom qab ntawd, txoj cai ntws yuav ua rau cov haujlwm hauv qab no thaiv.

yog (ntsuas_process == 1)

{updateTemp (); byte contMin = 0, contHour = 0; DS1307.getDate (DataTime); realMin = DataTime [5]; // ----------------------------------------------------------------------- --------- Suav Minute --------------------------------------- ------------------- yog (actualMin! = previousMin) {contMin ++; yav dhau los Min = realMin; } yog (contMin == 5) {sprintf (sijhawm, "%02d:%02d", DataTime [4], DataTime [5]); sensors.requestTemperatures (); ntab TempSensor = sensors.getTempCByIndex (0); myFile.print (lub sijhawm); myFile.println (TempSensor); contMin = 0; } // ------------------------------------------------------- ------------ Suav Teev Sijhawm ---------------------- ---------------------- yog (actualHour! = previousHour) {contHour ++; yav dhau losHour = actualHour; } yog (contHour == 5) {myFile.close (); lcd.clear (); lcd.setCursor (5, 0); lcd.print ("Tiav lawm"); lcd.setCursor (5, 1); lcd.print ("Txheej Txheem"); cov_process = 0; contHour = 0; } // ---------------------------------------------- Cov xwm txheej kom nres lub datalogger -----

Ua ntej tshaj, qhov updateTemp () muaj nuj nqi yuav ua tiav. Nws zoo ib yam li qhov hloov tshiabHour () muaj nuj nqi; txawm li cas los xij, nws qhia qhov ntsuas kub txhua 1 feeb.

Tom qab ntawd, lub kaw lus yuav sau cov ntaub ntawv sijhawm los ntawm Lub Sijhawm Tiag thiab khaws cov feeb tam sim no hauv qhov hloov pauv tam sim no.

Tom qab ntawd, nws yuav tshuaj xyuas yog qhov hloov pauv me me tau hloov pauv, raws li qhov xwm txheej tau hais hauv qab no

yog (actualMin! = yav dhau losMin)

{contMin ++; yav dhau los Min = realMin; }

Yog li, yog tias qhov hloov pauv feeb tam sim no txawv ntawm tus nqi yav dhau los, nws txhais tau tias kev hloov pauv tus nqi tau tshwm sim. yuav muab rau qhov sib txawv yav dhau losMin, khaws nws cov txiaj ntsig yav dhau los.

Yog li ntawd, thaum tus nqi ntawm qhov suav no sib npaug rau 5, nws txhais tau tias 5 feeb dhau los thiab lub kaw lus yuav tsum ntsuas qhov ntsuas kub tshiab thiab txuag teev thiab ntsuas kub hauv SD Card cov ntaub ntawv teev cia.

yog (contMin == 5)

{sprintf (sijhawm, "%02d:%02d", DataTime [4], DataTime [5]); sensors.requestTemperatures (); ntab TempSensor = sensors.getTempCByIndex (0); myFile.print (lub sijhawm); myFile.println (TempSensor); contMin = 0; }

Ua li no, cov txheej txheem no yuav rov ua dua mus txog qhov muaj txiaj ntsig ntawm 5 teev ntawm kev saib xyuas tus neeg mob qhov kub thiab txias nrog qhov ntsuas kub nrog Arduino.

Txoj cai ib feem tau qhia hauv qab no thiab zoo ib yam li suav feeb, uas tau nthuav tawm saum toj no.

// ------------------------------------------------------- ----------- Suav Teev Sijhawm ---------------------- ----------------------- Ua Tsaug Ntau

yog (actualHour! = yav dhau losHour) {contHour ++; yav dhau losHour = actualHour; } yog (contHour == 5) {myFile.close (); lcd.clear (); lcd.setCursor (5, 0); lcd.print ("Tiav lawm"); lcd.setCursor (5, 1); lcd.print ("Txheej Txheem"); cov_process = 0; contHour = 0; }

Tom qab mus txog 5 teev ntawm kev tshuaj xyuas, lub kaw lus yuav kaw cov ntaub ntawv teev tseg thiab nthuav tawm cov lus "Ua tiav" rau tus neeg siv.

Ib qho ntxiv, tus neeg siv tuaj yeem nias lub khawm Ok/Pause thiaj li yuav tsum kaw cov ntaub ntawv. Thaum qhov no tshwm sim, cov cai hauv qab no yuav raug ua.

// ---------------------------------------------- Kev mob rau tsum tsum datalogger ------------------------------------------------------ ---

yog (ok == 1) {myFile.close (); lcd.clear (); lcd.setCursor (6, 0); lcd.print ("Nres"); lcd.setCursor (5, 1); lcd.print ("Txheej Txheem"); cov_process = 0; ncua (2000); lcd.clear (); DS1307.getDate (DataTime); sprintf (sijhawm, "%02d:%02d", DataTime [4], DataTime [5]); lcd.setCursor (5, 0); lcd.print (lub sijhawm); lcd.setCursor (0, 1); lcd.print ("1-M 2-H 3-O/P"); }

Kauj ruam 9:

Duab
Duab

Tom qab ntawd, lub kaw lus yuav kaw cov ntawv thiab nthuav tawm cov lus "Nres Cov Txheej Txheem", raws li qhia hauv daim duab 8.

Kauj ruam 10:

Duab
Duab

Tom qab ntawd, lub kaw lus yuav luam tawm lub sijhawm tshuaj ntsuam thiab cov ntawv qhia zaub mov xaiv, raws li qhia hauv daim duab 9.

Kauj Ruam 11: Nkag Mus Rau SD Card Cov Qauv Cov Ntaub Ntawv Nrog Arduino

Nkag Mus Rau SD Card Cov Qauv Cov Ntaub Ntawv Nrog Arduino
Nkag Mus Rau SD Card Cov Qauv Cov Ntaub Ntawv Nrog Arduino

Tom qab txheej txheem tshuaj xyuas JLCPCB Datalogger nrog lub ntsuas kub nrog Arduino, nws yog qhov tsim nyog kom tshem daim npav nco thiab nkag mus saib cov ntaub ntawv ntawm lub computer.

Txhawm rau saib thiab txheeb xyuas cov ntaub ntawv nrog qhov ua tau zoo dua, xa tawm / luam tag nrho cov ntaub ntawv ntawm cov ntawv xa mus rau Excel. Tom qab ntawd, koj tuaj yeem npaj cov phiaj xwm thiab txheeb xyuas cov txiaj ntsig tau.

Kauj Ruam 12: Xaus

JLCPCB Datalogger nrog lub ntsuas kub nrog Arduino tso cai rau peb, ntxiv rau ntsuas qhov ntsuas kub, txhawm rau sau cov ntaub ntawv ntawm tus neeg mob tus cwj pwm ntsuas kub ib ntus.

Nrog cov ntaub ntawv khaws tseg no, nws muaj peev xwm txheeb xyuas thiab nkag siab tias qhov kub ntawm tus neeg mob kis los ntawm COVID 19 coj tus cwj pwm li cas.

Ib qho ntxiv, nws tuaj yeem ntsuas qhov ntsuas kub thiab cuam tshuam nws qhov txiaj ntsig nrog kev thov qee yam tshuaj.

Yog li ntawd, los ntawm cov ntaub ntawv no, JLCPCB Datalogger nrog ntsuas kub rau Arduino lub hom phiaj los pab kws kho mob thiab kws saib xyuas neeg mob hauv kev kawm txog tus neeg mob tus cwj pwm.

Thaum kawg, peb ua tsaug rau lub tuam txhab JLCPCB rau kev txhawb nqa txoj haujlwm ntawm txoj haujlwm thiab vam tias koj tuaj yeem siv nws

Txhua cov ntaub ntawv tuaj yeem rub tawm thiab siv tau dawb los ntawm ib tus neeg siv.

Pom zoo: