কিভাবে একটি তাপমাত্রা সেন্সরকে(LM35) আরডুইনোর সঙ্গে সংযুক্ত করা যায়
এই ওয়ার্কশপে আমরা দেখব কীভাবে একটি তাপমাত্রা সেন্সরকে আরডুইনোর সঙ্গে সংযুক্ত করা যায়। এখানে আমরা LM35 সেন্সর ব্যবহার করছি, যা ব্যবহার করা খুব সহজ এবং এর আউটপুটও সহজে রিড করা যায়। সেন্সরের আউটপুট আরডুইনোর এনালগ পিন A1-এ সংযুক্ত করা হয়েছে। আমরা একটি LCD ব্যবহার করছি পরিবেশের প্রকৃত তাপমাত্রা প্রদর্শনের জন্য। পূর্ববর্তী ওয়ার্কশপে আমরা ইতিমধ্যে LCD ইন্টারফেসিং নিয়ে আলোচনা করেছি, তাই এই অংশটি আজ আমরা এড়িয়ে যাচ্ছি।
যন্ত্রাংশের নাম | পরিমাণ |
---|---|
Arduino Uno | 1টি |
LM35 তাপমাত্রা সেন্সর | 1টি |
16x2 LCD (I2C বা সাধারণ) | 1টি |
ব্রেডবোর্ড | 1টি |
জাম্পার তার | কিছু |
USB কেবল (Arduino এর জন্য) | 1টি |
................................................................................................................................................।
Code:
#include <LiquidCrystal.h> // include the library code:
LiquidCrystal lcd(2, 3, 4,5 , 6, 7); // initialize the LCD with the numbers of the interface pins
float temp = 0;
int temp1=0;
void setup() {
lcd.begin(16, 2); // set up the LCD's number of columns and rows:
lcd.print("mahabub's note"); // Print a message to the LCD.
}
void loop()
{
lcd.setCursor(6, 1); // set the cursor to column 6, line 1
temp= analogRead(1); //returns: 0-1023
temp1= (temp*500)/1023;
lcd.print(temp1);
lcd.setCursor(9, 1);
lcd.print("C");
delay(100);
}
#include <LiquidCrystal.h> // include the library code:
LiquidCrystal lcd(2, 3, 4,5 , 6, 7); // initialize the LCD with the numbers of the interface pins
float temp = 0;
int temp1=0;
void setup() {
lcd.begin(16, 2); // set up the LCD's number of columns and rows:
lcd.print("mahabub's note"); // Print a message to the LCD.
}
void loop()
{
lcd.setCursor(6, 1); // set the cursor to column 6, line 1
temp= analogRead(1); //returns: 0-1023
temp1= (temp*500)/1023;
lcd.print(temp1);
lcd.setCursor(9, 1);
lcd.print("C");
delay(100);
}
.........................................................................................................................................................
এই প্রজেক্টটি নতুনদের জন্য খুব উপযোগী, কারণ এটি সহজে Arduino, সেন্সর ও LCD ডিসপ্লের কাজ শেখায়। আপনি চাইলে এই প্রজেক্টকে আরও উন্নত করে WiFi দিয়ে তাপমাত্রা অনলাইনে পাঠাতে পারেন বা তাপমাত্রা নির্দিষ্ট মান অতিক্রম করলে অ্যালার্ম দিতে পারেন।
No comments:
Post a Comment