Bitirme projesi

abdllhackl

Üye
Katılım
17 Aralık 2022
Mesajlar
30
Merhabalar kolay gelsin herkese,
Benim bitirme projem var bunun için arduino ile bir sistem yapmam gerekiyor. Malzemeleri aldım fakat Arduino dan çok anlamadığım için kod yazmama yardım lazım.
Sistem şu şekilde,
Sıcaklık ve nem için üst değerleri butonlarla kendimiz ayarlayacağız, sıcaklık veya nem üst değeri geçtiğinde sistemdeki 2 motor sağa dönecek, alt değere geldiğinde sola dönecek.
Malzemeler Arduino UNO, LCD sheild, step motor, DHT11 ve kablolar falan.
Yardıma ihtiyacım var şimdiden çok teşekkür ederim
 
Önce kendi yapabildiklerini koyarsan ve yapamadıklarını söylersen daha iyi yardım alabilirsin. Böyle sanki bir projeyi sıfırdan forumdakilere yaptırmaya çalışıyormuş gibi gözükürsün ve pek kimse yardıma yanaşmak istemez. Bu arada bu üniversite bitirme projesi mi ve hangi bölümdesin?
 
Forumdakilere yaptırmaya çalışmak değil. Arduino kullanmayı basit düzeyde biliyorum sadece. Bu proje için kod yazabilecek kadar bilmiyorum. Bu yüzden yardım istedim. Bı arkadaşımın yardımıyla bi kod yazdık ama exit status 1 hatası veriyor. Yazdığımız kodu ekliyorum alta.
Kod:
#include <LiquidCrystal.h> // include the library for the LCD
#include <DHT.h> // include the library for the DHT11 temperature sensor
#include <Stepper.h> // include the library for the stepper motor

// set up the LCD's number of columns and rows:
const int numRows = 2;
const int numCols = 16;

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

// set up the DHT11 temperature sensor
#define DHTTYPE DHT11 // specify the type of DHT sensor
#define DHTPIN 9 // specify the pin the DHT sensor is connected to
DHT dht(DHTPIN, DHTTYPE); // create a DHT instance

// set up the stepper motor
const int stepsPerRevolution = 200; // specify the number of steps per revolution
Stepper stepper(stepsPerRevolution, 8, 9, 10, 11); // create a Stepper instance and specify the pins the motor is connected to

void setup() {
  // set up the LCD's number of rows and columns
  lcd.begin(numCols, numRows);

  // initialize the DHT11 sensor
  dht.begin();

  // set the speed of the stepper motor in steps per second
  stepper.setSpeed(60);
}

void loop() {
  // read the input from the LCD button shield
  int buttonInput = readButtonInput();

  // read the temperature and humidity from the DHT11 sensor
  float temperature = dht.readTemperature(); // read the temperature in Celsius
  float humidity = dht.readHumidity(); // read the humidity in percent

  // compare the temperature from the sensor with the input from the button shield
  if (temperature > buttonInput) {
    // run the stepper motor if the temperature is higher
    stepper.step(stepsPerRevolution); // rotate the motor one revolution
  } else {
    stepper.step(stepsPerRevolution);
    // do something else if the temperature is not higher
  }
}

// function to read the input from the LCD button shield
int readButtonInput() {
  // read the input from the button shield
  int buttonInput = analogRead(A0);

  // map the input to a value between 0 and 100
  buttonInput = map(buttonInput, 0, 1023, 0, 100);

  // return the mapped value
  return buttonInput;
}
 
Son düzenleme:
Önce kendi yapabildiklerini koyarsan ve yapamadıklarını söylersen daha iyi yardım alabilirsin. Böyle sanki bir projeyi sıfırdan forumdakilere yaptırmaya çalışıyormuş gibi gözükürsün ve pek kimse yardıma yanaşmak istemez. Bu arada bu üniversite bitirme projesi mi ve hangi bölümdesin?
Bu arada evet bitirme projesi makine mühendisliği bölümü
 
C++:
#include <LiquidCrystal.h> // include the library for the LCD
#include <DHT.h> // include the library for the DHT11 temperature sensor
#include <Stepper.h> // include the library for the stepper motor

// set up the LCD's number of columns and rows:
const int numRows = 2;
const int numCols = 16;

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

// set up the DHT11 temperature sensor
#define DHTTYPE DHT11 // specify the type of DHT sensor
#define DHTPIN 9 // specify the pin the DHT sensor is connected to
DHT dht(DHTPIN, DHTTYPE); // create a DHT instance

// set up the stepper motor
const int stepsPerRevolution = 200; // specify the number of steps per revolution
Stepper stepper(stepsPerRevolution, 8, 9, 10, 11); // create a Stepper instance and specify the pins the motor is connected to

void setup() {
  // set up the LCD's number of rows and columns
  lcd.begin(numCols, numRows);

  // initialize the DHT11 sensor
  dht.begin();

  // set the speed of the stepper motor in steps per second
  stepper.setSpeed(60);
}

void loop() {
  // read the input from the LCD button shield
  int buttonInput = readButtonInput();

  // read the temperature and humidity from the DHT11 sensor
  float temperature = dht.readTemperature(); // read the temperature in Celsius
  float humidity = dht.readHumidity(); // read the humidity in percent

  // compare the temperature from the sensor with the input from the button shield
  if (temperature > buttonInput) {
    // run the stepper motor if the temperature is higher
    stepper.step(stepsPerRevolution); // rotate the motor one revolution
  } else {
    // do something else if the temperature is not higher
  }
}

// function to read the input from the LCD button shield
int readButtonInput() {
  // read the input from the button shield
  int buttonInput = analogRead(A0);

  // map the input to a value between 0 and 100
  buttonInput = map(buttonInput, 0, 1023, 0, 100);

  // return the mapped value
  return buttonInput;
}

Program kodunu "Kod" butonuna basarak eklersen daha iyi anlaşılır.

1671310610932.png


Burada ilk önce kontrol etmen gereken pin bağlantıları doğru mu. Mesela DHT 9 numaralı pine bağlı diyor. Gerçekte öyle mi? LCD display pinleri de tanımlanmış, gerçek LCD bu pinlere bağlı mı? Step motor aynı şekilde. Bunları teyit et önce.
 
C++:
#include <LiquidCrystal.h> // include the library for the LCD
#include <DHT.h> // include the library for the DHT11 temperature sensor
#include <Stepper.h> // include the library for the stepper motor

// set up the LCD's number of columns and rows:
const int numRows = 2;
const int numCols = 16;

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

// set up the DHT11 temperature sensor
#define DHTTYPE DHT11 // specify the type of DHT sensor
#define DHTPIN 9 // specify the pin the DHT sensor is connected to
DHT dht(DHTPIN, DHTTYPE); // create a DHT instance

// set up the stepper motor
const int stepsPerRevolution = 200; // specify the number of steps per revolution
Stepper stepper(stepsPerRevolution, 8, 9, 10, 11); // create a Stepper instance and specify the pins the motor is connected to

void setup() {
  // set up the LCD's number of rows and columns
  lcd.begin(numCols, numRows);

  // initialize the DHT11 sensor
  dht.begin();

  // set the speed of the stepper motor in steps per second
  stepper.setSpeed(60);
}

void loop() {
  // read the input from the LCD button shield
  int buttonInput = readButtonInput();

  // read the temperature and humidity from the DHT11 sensor
  float temperature = dht.readTemperature(); // read the temperature in Celsius
  float humidity = dht.readHumidity(); // read the humidity in percent

  // compare the temperature from the sensor with the input from the button shield
  if (temperature > buttonInput) {
    // run the stepper motor if the temperature is higher
    stepper.step(stepsPerRevolution); // rotate the motor one revolution
  } else {
    // do something else if the temperature is not higher
  }
}

// function to read the input from the LCD button shield
int readButtonInput() {
  // read the input from the button shield
  int buttonInput = analogRead(A0);

  // map the input to a value between 0 and 100
  buttonInput = map(buttonInput, 0, 1023, 0, 100);

  // return the mapped value
  return buttonInput;
}

Program kodunu "Kod" butonuna basarak eklersen daha iyi anlaşılır.

21121 eklentisine bak

Burada ilk önce kontrol etmen gereken pin bağlantıları doğru mu. Mesela DHT 9 numaralı pine bağlı diyor. Gerçekte öyle mi? LCD display pinleri de tanımlanmış, gerçek LCD bu pinlere bağlı mı? Step motor aynı şekilde. Bunları teyit et önce
Hocam bilmiyodum kod kısmına basmam gerektiğini kusura bakmayın.
O an bilgisayar kullanma imkanım kısıtlı olduğu için önce kodu atıp sonra kabloları bağlarım diye düşündüm. Daha önceki yaptığım bağlantıdan ötürü LCD sheild direkt uno kartın üzerine takılı diğer bileşenler takılı değildi bundan kaynaklı olabilir mi? Yani önce bileşenleri montaj edip sonra mı yazılımı yazmak gerekiyor?
 
Kodda her bir çevre biriminin hangi pine bağlı olduğu tanımlanmış. Gerçek devrenin de bu durumu yansıtıyor olması lazım. Yoksa devre çalışmaz, hatta birşeyler de bozulabilir.
 
Kodda her bir çevre biriminin hangi pine bağlı olduğu tanımlanmış. Gerçek devrenin de bu durumu yansıtıyor olması lazım. Yoksa devre çalışmaz, hatta birşeyler de bozulabilir.
Devre çalışmaz onu biliyorum da önce kodu atıp sonra çevre birimlerini pinlere taksak olmuyor mu? Ben kodu atamıyorum hata alıyorum
 
Zaten doğrusu önce kodu atıp sonra enerjiyi kesip pinlere bağlantı yapmak. Hangi hatayı aldığının ekran çıktısını koy.
 
Hocam bilgisayara şimdi ulaşabildim o yüzden biraz geç dönüş yaptım kusura bakmayın. Hata bu şekilde
Ekran görüntüsü 2022-12-20 222629.png
 
Bir kütüphane kurman gerekiyor. Ama benim kullandığım bir kütüphane değil, sana adım adım ne yapman gerektiğini söyleyemem. Biraz araştırman lazım.
 
Sol üstte mavi trimpot var. Muhtemelen ekran parlaklığını ayarlıyor. Onu biraz çevirir misin? Bakalım mantıklı bir şey gelecek mi ekrana.
Hocam o en sonda nerdeyse daha önce dht11 ile lcd sheild yaptım denemek için onda ekranda net bi şekilde sıcaklık ve nem gözüküyordu
 
Hocam o en sonda nerdeyse daha önce dht11 ile lcd sheild yaptım denemek için onda ekranda net bi şekilde sıcaklık ve nem gözüküyordu
O zaman daha önceki kullandığın ekran kodları ile şuanki kodlarını karşılaştır. Nerede hata olduğunu bulmaya çalış.
 
hepsini denedim hocam kitlendim kaldım çıkamıyorum işin içinden
Daha önce çalıştırdığın kodu ve şuan kullandığın kodu atar mısın. Karşılaştıralım. Bu arada kablo bağlantılarını kontrol et. Jumper kablolar, gevşek breadboard pinleri her zaman sorun oluşturmaya müsait.
 
Kod:
#include <LiquidCrystal.h> // include the library for the LCD
#include <DHT.h> // include the library for the DHT11 temperature sensor
#include <Stepper.h> // include the library for the stepper motor

// set up the LCD's number of columns and rows:
const int numRows = 2;
const int numCols = 16;

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(8, 9, 4, 5, 6, 7);

// set up the DHT11 temperature sensor
#define DHTTYPE DHT11 // specify the type of DHT sensor
#define DHTPIN A0 // specify the pin the DHT sensor is connected to
DHT dht(DHTPIN, DHTTYPE); // create a DHT instance

// set up the stepper motor
const int stepsPerRevolution = 200; // specify the number of steps per revolution
Stepper stepper(stepsPerRevolution, 0, 1, 2, 3); // create a Stepper instance and specify the pins the motor is connected to

void setup() {
  lcd.begin(16, 2);
 lcd.setCursor(0,0);
 lcd.print(" Sicaklik Olcer");
 delay(1000);
 lcd.clear();

 Serial.begin(9600);
 delay(100);

  // initialize the DHT11 sensor
  dht.begin();

  // set the speed of the stepper motor in steps per second
  stepper.setSpeed(600);
}

void loop() {
 
  // read the input from the LCD button shield
  int buttonInput = readButtonInput();

  // read the temperature and humidity from the DHT11 sensor
  float temp = dht.readTemperature(); // read the temperature in Celsius
  float humi = dht.readHumidity(); // read the humidity in percent
 
 
 lcd.setCursor(9,2);
 
  lcd.setCursor(0,0);
  lcd.print("Sicaklik:");
  lcd.setCursor(9,0);
  lcd.print(temp);
  lcd.setCursor(12,0);
  lcd.print("'C");

  lcd.setCursor(0,2);
  lcd.print("Nem:");
  lcd.setCursor(5,2);
  lcd.print(humi);
  lcd.setCursor(8,2);
  lcd.print("%");

  delay (100);

  // compare the temperature from the sensor with the input from the button shield
  if (temp > buttonInput) {
    // run the stepper motor if the temperature is higher
    stepper.step(stepsPerRevolution); // rotate the motor one revolution
  } else {
    // do something else if the temperature is not higher
  }
}

// function to read the input from the LCD button shield
int readButtonInput() {
  // read the input from the button shield
  int buttonInput = analogRead(A1);

  // map the input to a value between 0 and 100
  buttonInput = map(buttonInput, 0, 1023, 0, 100);

  // return the mapped value
  return buttonInput;
}
Hocam en güncel durum bu şuanda. Elimdeki iki kodu bir şekilde birleştirdim. Sorun şurda lcd shield butonlarından değer giremiyorum bu değeri girip ekranda görebilirsem sıcaklık değerine göre motoru çalıştırabilirim gibi geliyor bana.
 

Çevrimiçi üyeler

Forum istatistikleri

Konular
5,833
Mesajlar
99,481
Üyeler
2,477
Son üye
krmz

Son kaynaklar

Son profil mesajları

gruptaki arkadaşlara selamlar. sıteyi bu gün fark ettim. Asansör için 2x7 segment LCD gösterge üretmek istiyorum. acaba bu sayfadaki arkadaşlardan destek alabilirmiyim. LCD nin mantık açılımı ektedir.
deneyci wrote on TA3UIS's profile.
Selam.
Amatör telsiz lisansı nasıl alınıyor?
Lisansı olmayanı forumlarına almıyorlar. :)
Bilgi alamıyoruz.
cemalettin keçeci wrote on HaydarBaris's profile.
barış kardeşim bende bu sene akıllı denizaltı projesine girdim ve sensörleri arastırıyorum tam olarak hangi sensör ve markaları kullandınız yardımcı olabilir misin?
m.white wrote on Altair's profile.
İyi akşamlar.Arabanız ne marka ve sorunu nedir.Ben araba tamircisi değilim ama tamirden anlarım.
* En mühim ve feyizli vazifelerimiz millî eğitim işleridir. Millî eğitim işlerinde mutlaka muzaffer olmak lâzımdır. Bir milletin hakikî kurtuluşu ancak bu suretle olur. (1922)
Back
Top