Posts

LED Chaser with Raspberry pi pico in micropython programming

Image
LED Chaser with Raspberry pi pico from machine import Pin from time import sleep led1 = Pin(10, Pin.OUT) led2 = Pin(11, Pin.OUT) led3 = Pin(12, Pin.OUT) led4 = Pin(13, Pin.OUT) led5 = Pin(14, Pin.OUT) led6 = Pin(15, Pin.OUT) def Led_chaser (a,b,c,d,e,f):     led1.value(a)     led2.value(b)     led3.value(c)     led4.value(d)     led5.value(e)     led6.value(f)     sleep(0.25) while True:     Led_chaser(0,0,0,0,0,0)     Led_chaser(0,0,0,0,0,1)     Led_chaser(0,0,0,0,1,1)     Led_chaser(0,0,0,1,1,1)     Led_chaser(0,0,1,1,1,1)     Led_chaser(0,1,1,1,1,1)     Led_chaser(1,1,1,1,1,1)     Led_chaser(1,1,1,1,1,0)     Led_chaser(1,1,1,1,0,0)     Led_chaser(1,1,1,0,0,0)     Led_chaser(1,1,0,0,0,0)     Led_chaser(1,0,0,0,0,0)                   

pySerial automation

Image
Arduino code for Pyserial Automation //In this project we will control 2 LEDes connected to Arduino pin # 10&12 via serial communication from python tkinter buttons. char serialData;//created a variable name serialData char type int led1 = 10;// created a variable name led1 int type and assigned as Arduino pin# 10 int led2 = 12;// created a variable name led2 int type and assigned as Arduino pin# 12 void setup() {   pinMode (led1, OUTPUT);// initialized led1 as an output   pinMode (led2, OUTPUT);// initialized led2 as an output   Serial.begin(9600);// serial communication baud rate-9600 } void loop() {   if (Serial.available() > 0)//check condition-serial data available     serialData = Serial.read();   Serial.print(serialData);   if (serialData == 'a')// if serial data command is character 'a'   {     digitalWrite(led1, HIGH);// turn ON the led1   }   else if (serialData == 'b')// if serial data is character '...

RF Receiver with remote control

Image
Download link for Arduino sketch- https://github.com/anokhramesh/RF315-Mhz-4-relay-control/blob/main/Control4_relays_with_RF_315_Receiver_bodule_and_remote.ino Remote Button-B-RF Receiver  module pin-D0- Arduino Input pin D3                                  Remote Button-D-RF Receiver  module pin-D1- Arduino Input pin D5                                  Remote Button-A-RF Receiver  module pin-D2- Arduino  Input pin D2                                  Remote Button-C-RF Receiver  module pin-D3- Arduino Input pin D4                               Arduino Output Pin D09-...

RF433 Wireless Switch Automation

Image
RF433 Automation Circuit Diagram https://github.com/anokhramesh/RF433-Relay-and-pushbutton Arduino code for RF 433 Mhz Transmitter and Receiver Remote control Switch // RF 433 TX code #include <VirtualWire.h> #define button 6 char *data; int val; int value = 0; void setup()  {   vw_set_tx_pin(12);   vw_setup(2000);   pinMode(button, INPUT_PULLUP); } void loop() {   val = digitalRead(button);   if(val == LOW && value == 0)   {     data="a";     vw_send((uint8_t *)data, strlen(data));     vw_wait_tx();     delay(500);     value = 1;   }   else if(val == LOW && value == 1)   {     data="b";     vw_send((uint8_t *)data, strlen(data));     vw_wait_tx();     delay(500);     value = 0;   }   delay(200); } //RF433 Rx code #include <VirtualWire.h> #define ledPin 13// change the pin number according to you reuir...

Open Loop AC-Switch

Image
This is an Open loop AC Switch project  

Open loop Alarm with Raspberry pi pico

Image
#This is a micropython Script of an open loop Alarm   from machine import Pin,PWM from utime import sleep button_NC = Pin(16,Pin.IN,Pin.PULL_UP)#NC PB to Gp16 and GND via 10K resistance led = Pin(15,Pin.OUT) buzzer = PWM(Pin(13)) while True:     if button_NC.value()==1:         led.toggle()         buzzer.freq(500)#Buzzer will start to beep according to the frequency and duty.         buzzer.duty_u16(90000)         sleep(0.5)         buzzer.duty_u16(0)         sleep(0.05)         buzzer.duty_u16(1)     else:         led.off()         buzzer.deinit()

laser beam interrupt alarm system

Image
  '''This is a laser Beam Alarm System. (if any oject interrupt the lazer beam to the ldr sensor- an alrm will trigger)''' import utime from machine import Pin, PWM from utime import sleep buzzer = PWM(Pin(13)) led = Pin(15,Pin.OUT) laser_sensor = machine.ADC(26) while True:     print(laser_sensor.read_u16())     utime.sleep(2)                              if laser_sensor.read_u16()<= 5000:#if laser sensor value is less than or equal to 5000         print(" Alarm Triggered")         led.on()         buzzer.freq(500)         buzzer.duty_u16(90000)         sleep(0.9)         buzzer.duty_u16(1)         sleep(0.01)         buzzer.duty_u16(0)     else:         print("System Normal")       ...