Welcome to namasudra.blogspot.com. Glad to see you here!
Showing posts with label Arduino. Show all posts

Friday, March 15, 2019

Make your own Relay Module

This is a simple Relay Module that we can make cheaply at home. This module can be used with any microcontroller that runs on 5V. In the diagram below we have used Arduino, but can be replaced with any other microcontroller.

Part List:
  1. 5V Relay
  2. Transistor: BC 548
  3. Resistor: 10K
  4. Diode: IN4001
  5. Capacitors: 100uF 10V and 0.1uF
Circuit Diagram:

Monday, June 13, 2016

Wiring a 16x2 LCD display with Arduino

The schematic below shows how to wire a 16x2 LCD display with an Arduino board. We can use any LCD display that is compatible with the Hitachi HD44780 driver. Besides the Arduino board and LCD panel, we will also need a 10K potentiometer to adjust the contrast of the characters on the LCD screen.

Part List:
  1. Arduino Board
  2. 16x2 character LCD display
  3. 10K potentiometer
Wiring:


The Code:

#include <LiquidCrystal.h>

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

void setup(){
    lcd.begin(16, 2);
    lcd.print("Elapsed Time:");
}

void loop(){ 
    // Counting begins from 0
    // (0,1) means 1st character of 2nd line
    lcd.setCursor(0, 1);
    lcd.print(millis()/1000);
    lcd.print(" sec");
}

Digital Thermometer using LM35 Temperature Sensor

Here we are using Arduino Board and LM35 temperature sensor to make a Digital Thermometer. This project can be further extended to a stand-alone device by incorporating a 16x2 character LCD display. To know about how to use LCD displays, refer to Wiring a 16x2 LCD display with Arduino. But for simplicity and understanding purpose we will be using the serial console to get the output here.

Below is the wiring:


The code:

float temperature;
int sensorPin = 0;

void setup(){

    Serial.begin(9600);
}

void loop(){

    temperature = analogRead(sensorPin);
    temperature = temperature * 0.488;

    Serial.print(temperature);
    Serial.println(" C");
    delay(1000);
}