Sie sind auf Seite 1von 3

A.

ADC DI KONVERSI KE TEGANGAN


LCD1
LM016L

VDD
VSS

VEE

RW
RS

D0
D1
D2
D3
D4
D5
D6
D7
E
1
2
3

4
5
6

7
8
9
10
11
12
13
14
13
12

10
11

9
8

7
6
5
4
3
2
1
0
DUINO1

PB4/MISO

PB0/ICP1/CLKO
AREF

TX PD1/TXD
RX PD0/RXD
PD7/AIN1
~ PD6/AIN0
PD5/T1

~ PD3/INT1
PD2/INT0
PB5/SCK

~PB3/MOSI/OC2A
~ PB2/SS/OC1B
~ PB1/OC1A

PD4/T0/XCK
ARDUINO UNO R3

~
DIGITAL (~PWM)

ATMEGA328P-PU
1121

microcontrolandos.blogspot.com

PC4/ADC4/SDA
PC5/ADC5/SCL
ANALOG IN PC0/ADC0
PC1/ADC1
PC2/ADC2
PC3/ADC3
RESET

A0
A1
A2
A3
A4
A5

RV1
53%

1k

PROGRAM :

#include <LiquidCrystal.h>
LiquidCrystal lcd(12,11,5,4,3,2);

int sensorPin = 0;
int ledPin = 13;
float sensorValue = 0;

void setup() {
pinMode(ledPin,OUTPUT);
lcd.begin(16,2);
Serial.begin(9600);

}
void loop () {
sensorValue = analogRead(sensorPin);
float Tegangan = sensorValue * (5.0 / 1023.0);
Serial.println(Tegangan);
lcd.setCursor(0,0);
lcd.print ("VOLT:");
lcd.setCursor(5,1);
lcd.print (Tegangan);
delay(1000);
}

֯
B. SENSOR SUHU LM 35
LCD1
LM016L

D1
LED-GREEN

VDD
VSS

VEE

RW
RS

D0
D1
D2
D3
D4
D5
D6
D7
Q1

E
1
2
3

4
5
6

7
8
9
10
11
12
13
14
R1
10k
BUZ1
NPN

BUZZER

13
12

10
11

9
8

7
6
5
4
3
2
1
0
+12v
DUINO1

PB4/MISO

PB0/ICP1/CLKO
AREF

TX PD1/TXD
RX PD0/RXD
PD7/AIN1
~ PD6/AIN0
PD5/T1

~ PD3/INT1
PD2/INT0
PB5/SCK

~PB3/MOSI/OC2A
~ PB2/SS/OC1B
~ PB1/OC1A

PD4/T0/XCK
ARDUINO UNO R3

~
DIGITAL (~PWM)

ATMEGA328P-PU
1121

microcontrolandos.blogspot.com

PC4/ADC4/SDA
PC5/ADC5/SCL
ANALOG IN

PC0/ADC0
PC1/ADC1
PC2/ADC2
PC3/ADC3
1 U1

RESET
36.0

A0
A1
A2
A3
A4
A5
2
VOUT

3 LM35

PROGRAM :
#include <LiquidCrystal.h>
LiquidCrystal lcd(12,11,5,4,3,2);

int potPin = 0;
int LED = 6;
int BUZ = 7;
long val = 0;
float temperature = 0;

void setup() {
pinMode(LED,OUTPUT);
pinMode(BUZ,OUTPUT);
lcd.begin(16,2);
}
void loop ()
{
val = analogRead(potPin);
temperature = ((5.0 * val * 100.0)/1024.0);
lcd.setCursor(0,0);
lcd.print("TEMP:");
lcd.setCursor(0,1);
lcd.print((long)temperature);
lcd.print("deg.C");
delay(1000);
if(temperature > 35)
{
digitalWrite(LED,HIGH);
digitalWrite(BUZ,HIGH);
}
else if ((temperature = 35)&&(temperature > 34))
{
digitalWrite(LED,LOW);
digitalWrite(BUZ,LOW);
}
delay(1000);
}