Posts

Showing posts from August, 2021

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 'b'   {     digitalWrite(led1, LOW);//

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-  Relay Module IN1                               Arduino Output Pin D10- Relay Module IN2                               Arduino Output Pin D11- Relay Module IN3                               Arduino Output Pin D12- Relay Module IN4  

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 reuirement void setup() {     vw_set_rx_pin(11);     vw_setup(2000);     pinMode(ledPin, OUTPUT);     vw_rx_start(); } void loop() {     uint8_t