Cov txheej txheem:

DIY Arduino Digital Thermometer: 5 Kauj Ruam
DIY Arduino Digital Thermometer: 5 Kauj Ruam

Video: DIY Arduino Digital Thermometer: 5 Kauj Ruam

Video: DIY Arduino Digital Thermometer: 5 Kauj Ruam
Video: Amazing arduino project 2024, Kaum ib hlis
Anonim
DIY Arduino Digital Thermometer
DIY Arduino Digital Thermometer

Nyob zoo sawv daws! Ntawm no, kuv yuav qhia koj yuav ua li cas ntsuas lub ntsuas cua digital yooj yim siv Arduino.

Kauj Ruam 1: Qhov Yuav Tsum Tau

Yam Yuav Tsum Tau
Yam Yuav Tsum Tau

Cov hauv qab no yuav xav tau rau txoj haujlwm no:

1) Arduino Nano.

2) Nokia 5110 LCD zaub.

3) LM- 35 ntsuas kub.

4) Jumper xov hlau.

5) Arduino lub tswv yim thiab u8glib lub tsev qiv ntawv (Rub tawm los ntawm Git-hub.

Kauj Ruam 2: Txuas lub LCD mus rau Arduino

Txuas lub LCD mus rau Arduino
Txuas lub LCD mus rau Arduino

Txuas cov Arduino pins hauv qab no mus rau LCD:

CLK = 8, DIN = 4, CE = 7, DC = 5, RST = 6

Txuas tus BL thiab Vcc tus pin ntawm LCD mus rau 3.3v ntawm Arduino

Koj tuaj yeem siv cov tshuaj tiv thaiv yog tias koj xav tau, tab sis hauv kuv qhov xwm txheej, txuas LCD ncaj qha rau Arduino pins tsis muaj qhov sib txawv

Kauj Ruam 3: Lm-35

Lwj -35
Lwj -35

Lm-35 yog tus ntsuas kub ntsuas tus nqi qis uas tuaj yeem siv nrog Arduino

goo.gl/images/AymubD

Txheeb xyuas daim duab Lm-35 pinout los ntawm no

Txuas tus pin tso tawm ntawm Lm-35 mus rau tus pin A0 ntawm Arduino

Txuas 5v thiab gnd pins ib yam nkaus

Kauj ruam 4: Code:

#suav nrog "U8glib.h"

int ib = 0;

ploj x;.

ob m; os.

ob s; ua.

// Npaj los ntawm Sourya Choudhury

// Credits-Henry's Bench tutorials for lcd tutorial.

U8GLIB_PCD8544 u8g (8, 4, 7, 5, 6);

// CLK = 8, DIN = 4, CE = 7, DC = 5, RST = 6

void kws sau ntawv ()

{

x = analogRead (a);

m = x/1024.0*5000;

s = m/10;

u8g.setFont (u8g_font_profont12);

u8g.setPrintPos (0, 15);

u8g.print (s);

u8g.drawStr (35, 15, "*C");

ncua (100);

yog tias (s> 30)

{

u8g.drawStr (15, 35, "So Kub !!");

}

lwm yog (s20)

{

u8g.drawStr (15, 35, "Zoo heev !!");

}

lwm tus

{

u8g.drawStr (15, 35, "Txaus !!");

}

}

void teeb tsa ()

{

Serial.begin (9600);

pinMode (a, INPUT);

}

void lub voj ()

{

u8g.firstPage ();

ua {

tus kws sau ntawv ();

} thaum (u8g.nextPage ());

}

Pom zoo: