Thursday 6 February 2020

Correct program to control a lamp with using Raspberry Pi

Correct program to control a lamp with using Raspberry Pi 

Circuit Diagram:-


Correct Program:-

import RPi.GPIO as GPIO
import time

# PIN connected to IN1
relay_pin = 23

# Set mode BCM
GPIO.setmode(GPIO.BCM)

#Type of PIN - output
GPIO.setup(relay_pin,GPIO.OUT)

try:
        while True:
                #set low
                print ("Setting low - LAMP ON")
                GPIO.output (relay_pin,GPIO.LOW)
                time.sleep(2)
                #set high
                print ("Setting high - LAMP OFF")
                GPIO.output (relay_pin, GPIO.HIGH)
                time.sleep(2)
except KeyboardInterrupt:
        GPIO.cleanup()




Monday 3 February 2020

Today we will see how to connect raspberry pi with laptop using Ethernet cable


Today we will see how to connect raspberry pi with laptop using Ethernet cable

Step 1

Open the connected wifi network and
Share the internet connection as shown now

Step 2

Power up the raspberry pi and find out the ip address of raspberry pi as shown
If you have the ip address already detected you no need to worry
If the ip address is not found you need to go to cmd and find it out
In my case already i have an detected ip address will show you how to do

Step 3

You need to disconnect the raspberry pi and using card reader you should add a ssh file
From command window
Echo>"the boot device letter" for eg d:\ssh
Echo>d:\ssh

Step 4

Add ssh file , download and install advanced ip scanner and check whether the raspberrian is shown in the ip scanner

Step 5

Type the name of the pi from ip scanner or type the ip address in
MobaXterm session dialog
In my case the board is detected
Lets go to MobaXterm
Type the remote host and click ok

Now you can easily login using the default
Login id ====== pi
Password ===== raspberry





google-site-verification: google18ae80885fc3d876.html