Posts

Showing posts from May, 2021

Interfacing Ultrasonic sound sensor with Arduino(Vehicle reverse Alarm)

Image
  Interfacing Ultrasonic sound sensor with Arduino(Vehicle reverse Alarm) const int trig = 2;//Trigger pin of Hcsr04 is connected to Digital Pin 2 of arduino. const int echo = 3;//Echo pin of Hcsr04 is connected to digital Pin 3 of Arduino. const int LED1 = 8;//LED1(Yellow)connected to digital pin 8 of Arduino. const int LED2 = 7;//LED2(Green)connected to digital pin 7 of Arduino. const int LED3 = 6;//LED3(Blue)connected to digital pin 6 of Arduino. const int LED4 = 5;//LED4(Red)connected to digital pin 5 of Arduino. const int Buzzer = 4;//Buzzer connected to digital pin 4 of arduino //const int LED5 = 11;//optional //const int LED6 = 12;//optional //const int LED7 = 13;//optional int duration = 0; int distance = 0; void setup()  {   pinMode(trig , OUTPUT);//Initialized Trigger Pin is an Output   pinMode(echo , INPUT);//Initialized Echo Pin is an input.      pinMode(LED1 , OUTPUT);//Initialized Led1 is an Output   pinMode(LED2 , OUTPUT);//Initiali...

Interfacing DHT11 Temperature and Humidity sensor with Raspberry pi pico in Mycropython programming.

Image
 #Connect DHT11 VCC to Raspberry pi pico 3.3v(Phycical Pin 36) #Connect DHT11 Gnd to Raspberry pipico GND #Connect DHT11 Data to Raspberry pi pioco Pin# 16(Phycical pin 21) from machine import Pin import utime  from dht import DHT11 dhtPin = Pin(16, Pin.IN , Pin.PULL_DOWN) led=Pin(14,Pin.OUT)#Over temperature indicator led connected to GPIO-14 buzzer=Pin(15,Pin.OUT)#buzzer connected to Pin#15 of Raspberry pi pico relay=Pin(13,Pin.OUT)#relay connected to Pin#13 of Raspberry pi pico while True:#infinite loop to checking the temperature      utime.sleep(2)     dhtSensor = DHT11(dhtPin)          temp_value = dhtSensor.temperature          hum_value = dhtSensor.humidity          print("Temperature : ", temp_value, "Degree Celcius")#display the temperature on shell.     print("Relative Humidity : ", hum_value, " %", "\n")#display the Humidity on shell.     if temp_...

Interfacing IR Proximity sensor To Toggle a relay with Raspberry Pi pico

Image
# In this Project we will Interface a IRProximity sensor with Raspberry pi pico to toggle a # If using a low active Relay upload this code. # Relay from machine import Pin import time IR_proximity= machine.Pin(16,Pin.IN,Pin.PULL_DOWN)#connected the IR sensor Output to GPIO Pin 16 Relay = Pin(17,Pin.OUT)# low active Relay is connected to GPIO Pin 17 via an NPN Transistor. while True:     if IR_proximity.value()==1:#if IR Sensor outPut Is High         Relay.toggle()#change the Relay status OFF to ON/ON to OFF         time.sleep(0.5) # If using High active relay ,upload this code from machine import Pin import time IR_proximity= machine.Pin(16,Pin.IN,Pin.PULL_UP)#connected the IR sensor Output to GPIO Pin 16 and GND Relay = Pin(17,Pin.OUT)# low active Relay is connected to GPIO Pin 17 via an NPN Transistor. while True:     if IR_proximity.value()==1:#if IR Sensor outPut Is High         Relay.toggle()#change the...

Interfacing HC05 Bluetooth Module with Raspberry pi pico

Image
Controlling 5 Relays via bluetooth module HC05 in micropyhon programming Download Android APK file for the Application from the Given link https://drive.google.com/file/d/1qr3WY5u5K4XytKopU8D0akamqsebhGX0/view?usp=sharing   https://drive.google.com/file/d/1qr3WY5u5K4XytKopU8D0akamqsebhGX0/view?usp=sharing   Micropython Code from machine import Pin# importng machine module from machine import UART# importng UART(Universal Asynchronous Receiver) module from time import sleep#importing sleep from time module HC05=UART(0,9600)#creating an object HC05 and declaring UART communication channel,boud rate relay_1=Pin(28,Pin.OUT)#creating an Object relay_1 and assign Pin 28 as an OUTPUT relay_2=Pin(20,Pin.OUT)#creating an Object relay_2 and assign Pin 20 as an OUTPUT relay_3=Pin(18,Pin.OUT)#creating an Object relay_3 and assign Pin 18 as an OUTPUT relay_4=Pin(19,Pin.OUT)#creating an Object relay_4 and assign Pin 19 as an OUTPUT led=Pin(25,Pin.OUT)#Onboard led of Raspbetty pi pico while ...

TTP233 Touch pad with raspberry pi pico

Image
Micropython code  from machine import Pin import time Touch_pad = machine.Pin(16,Pin.IN,Pin.PULL_UP )#connect touch pad sensor in between GPIO16 and 3.3volt out of arspberry pi pico. led = Pin(15,Pin.OUT) Relay = Pin(17,Pin.OUT) while True:     if Touch_pad.value()==1:         print("Touched")         Relay.toggle()         led.toggle()         time.sleep(0.5)

Interfacing HCSR501 Motion sensor Raspberry PI PICO

Image
Interfacing HCSR501 Motion sensor Raspberry PI PICO #In this project we will configure the Raspberry pi pico as an alarm System. #In normal state the GPIO pin 28 is looking a +4 volt is available from the PIR sensor output. #if there in no +4volt received in GPIO 28,Raspberry pi pico will trigger the interrupt the- #normal duty of LED(Toggling Every 5 second interval the system is running normal) # and Perform  the task which we defined in the def function. import machine import utime sensor_pir = machine.Pin(28,machine.Pin.IN) led = machine.Pin(15,machine.Pin.OUT) buzzer = machine.Pin(14,machine.Pin.OUT) def pir_handler(Pin):     print(" Motion Detected!!!!")     for i in range(50):         led.toggle()         buzzer.toggle()         utime.sleep_ms(200)          #sensor_pir.irq(trigger=machine.Pin.IRQ_RISING, handler=pir_handler) sensor_pir.irq(trigger=machine.Pin.IRQ_FALLING,...

Interfacing KY038 sound sensor with Raspberry pi Pico

Image
Micropython code from machine import Pin #importing Pin Class from machine module. import utime #importing time module led=Pin(15,Pin.OUT)  #created an led object and assigning the GPIOPin 15 to as an OUTPUT button=Pin(16,Pin.IN,Pin.PULL_DOWN) #created an object button and assigned to GPIO Pin 16 as an INPUT PULL_DOWN. def led_toggle(irq): #created a function led_toggle.     global led     led.toggle()       button.irq(trigger=Pin.IRQ_RISING,handler=led_toggle)  

Heat Detector Alarm with LM358 OP amp

Image
 

Interfacing HS0038A2D with raspberry pi pico

Image
 # Toggling an led/Relay with pushbutton and HS0038A2D from machine import Pin# Import Pin class from machine module import time# importing time module button = machine.Pin(16,Pin.IN,Pin.PULL_UP)#declaring a variable button and assign as an INPUT,PIN16 PULLED UP INITIALLY(GPIO 16 and GND) led = Pin(17,Pin.OUT)# declaring a variable led and assign as an OUTPUT the GPIO Pin 17  while True:     if button.value()==0:         led.toggle()         time.sleep(0.5)

INTERFACE Proximity sensor with arduino

Image
  // Arduino  and IR Proximity sensor + pushbutton int pbutton=8; int led=3; int val=0; int ledon=0; int pushed=0; void setup() {   Serial.begin(9600);   pinMode(pbutton, INPUT_PULLUP);// Connect one point of Pushbutton to D8 Pin of Arduino and other point to GND of Arduino.   pinMode(led, OUTPUT); } void loop()  {   val=digitalRead(pbutton);   if(val==HIGH && ledon==LOW)   {     pushed=1-pushed;     delay(100);   }   ledon=val;   if(pushed==HIGH)   {     Serial.println("led on");     digitalWrite(led, LOW);   }      else   {     Serial.println("led off");     digitalWrite(led, HIGH);   } }

Raspberry pi pico running on external power source

Image
  Raspberry pi pico running on external power source