Posts

How to calculate Mean, Median and Mode in python

#CALCULATE MEAN import numpy as np speed = [ 99 , 86 , 87 , 88 , 111 , 86 , 103 , 87 , 94 , 78 , 77 , 85 , 86 ] x = np. mean (speed) print (x) #CALCULATE MEDIAN import numpy as np speed = [ 99 , 86 , 87 , 88 , 111 , 86 , 103 , 87 , 94 , 78 , 77 , 85 , 86 ] x = np. median (speed) print (x) #CALCULATE MODE from scipy import stats speed = [ 99 , 86 , 87 , 88 , 111 , 86 , 103 , 87 , 94 , 78 , 77 , 85 , 86 ] x = stats. mode (speed) print (x)

How to use Matplotlib markers

import numpy as np import matplotlib.pyplot as plt ypoints = np. array ([ 3 , 4 , 10 , 12 ]) #for solid line #plt.plot(ypoints, '-') #for dashed line #plt.plot(ypoints,'--') #for dashed and dotted lines #change the colour and size of the marker #plt.plot(ypoints,marker = 'o',ms=20,mec='r') #change the face colour to red plt. plot (ypoints, marker = 'o' , ms = 20 , mfc = 'g' ) plt. show ()

Line chart in python

import matplotlib.pyplot as plt import numpy as np x = np. array ([ 1 , 8 , 7 , 6 , 5 , 4 ]) y = np. array ([ 3 , 10 , 12 , 13 , 23 , 17 ]) #plot dots instead of a line #plot stars plt. plot (x,y, "--" ) plt. show ()

How to generate bar chart in python

import matplotlib.pyplot as plt import numpy as np x = np. array ([ "A" , "B" , "C" , "D" ]) y = np. array ([ 4 , 5 , 3 , 7 ]) #change colour #horizontal bars plt. barh (x,y, color = "g" ) plt. show ()

8-Bit adder circuit diagram

Image
 8-Bit Adder circuit on Proteus

ESP32 Error: A fatal error occurred: Timed out waiting for packet content.

Image
This article provides a complete solution for the most common Fatal error that usually occurs while uploading the code to ESP32. In this article I have interfaced DOIT ESP32 devkit V1 module with MG995 servo motor on GPIO = 18. You can use any module of your choice. Servo Motor Connections: Most analog servo motors like the MG995 use a 3-wire color-coded cable for interfacing. Although the color-coding is not an official standard many manufacturers use the same colored wires: 1)Orange – The PWM servo control input. This is a logic-level signal, and most servo motors can accept 3.3-volt logic as well as 5-volt logic. Some models, especially 270-degree rotation servos, use a White wire for this connection. 2)Red – The servo motor power supply input. Generally 3.3-5 volts DC, but be sure to check first. 3)Brown – The ground connection. On some servo motors, this is a Black wire ESP32 PWM Most micro controllers can be used to generate PWM signals and the ESP32 is certainly no ex...

IR sensor and Mpu6050 controlled Robotic Hand

Image
  Greetings! The finest way for me to learn any programming language is by developing fun projects. Therefore, to bring my theoretical knowledge in practical I build this Arduino based Robotic hand. Components Required: Transmitter side: 1x Arduino Nano 1x Xbee Nano Expansion Board 1x Nrf24l01 Transceiver module 5x IR sensors (TCRT5000) 1x Mpu6050 Circuit Diagram: Receiver side: 1x Arduino Nano 1x Xbee Nano Expansion Board 1x Nrf24l01 Transceiver module 5x mg90s servo motors 1x MG996 servo motor 1x 3D printed Robotic hand Circuit Diagram: App: https://www.arduino.cc/ Code: Transmitter Side: https://drive.google.com/file/d/1kiJryWOpBPrDHvi9IDVAo1wkSK8k3E5v/view?usp=sharing Receiver Side: https://drive.google.com/file/d/1vVRRti-Du6H9Oa_lKgh6o_cxX4At8JBF/view?usp=sharing YouTube channel: https://www.youtube.com/channel/UCY5O7tihQh7VwO4iWww3iCg

Gesture Controlled speaker using esp32+TCRT5000(IR sensor)+DF-miniplayer+Speaker

Image
This is a simple project for mute using ESP-NOW. Wirelessly you can send commands to the speaker using TCRT5000(IR sensor). Each finger at the transmission side can have a different command at the receiver side. The micro SD card inside the DF-mini player has to be first inserted in the laptop using SD card reader where you can save different files like 0001, 0002 so on and so forth. Now these files are going to be the one played on the speaker once commanded. Components Required: 2 x Esp32 1 x DF-mini player 1 x micro SD card 1 x SD card reader 1 x 5V Speaker 4 x TCRT5000 18 x jumper wires Transmitter Side: Receiver side: Video: Email: easymathsforyou3@gmail.com YouTube channel: https://www.youtube.com/watch?v=plUAwFPqPhM&t=241s

Sending and Receiving IR sensor data through NRF24L01

Image
NRF24L01 is known as a multiceiver as it can transmit and receive data at the same time over a distance of 100 meters. It is an inexpensive yet reliable two way RF module. It is a cheap module which could be bought only for 2 bucks online  on various sites  making it one of the most inexpensive data communication options that you can get. Hardware rundown: Radio Frequency : 2.4GHz  worldwide ISM(Industrial Scientific and Medical) frequency band and uses GFSK modulation  for data transmission. Power Consumption: 1.9-3.6V SPI Interface: It communicates over a 4-pin Serial Peripheral Interface with a maximum data rate of 10Mbps with 125 selectable channels with an SPI configuration. Modulation Format: GFSK Maximum Operating Current: 13.5mA Max Air data rate: 2Mb/s Infrared sensors IR   sensor also known as Infrared sensor   is an electronic device that computes and detects   infrared   radiation in its surrounding environment. Active   infrared ...

Detecting Obstacles and Warnings with ultrasonic sensor

Image
Components Required: 1x Arduino 1x Ultrasonic sensor 1x Buzzer 1x Jumper wires Application: https://www.arduino.cc/ Code: int trigPin = 6; int echoPin = 5; int buzzPin = 2; void setup() {   Serial.begin(9600);     pinMode(buzzPin, OUTPUT);    pinMode(trigPin, OUTPUT);   pinMode(echoPin, INPUT);   // put your setup code here, to run once: } void loop() {   long duration, distance;   digitalWrite(trigPin,HIGH);   delayMicroseconds(1000);   digitalWrite(trigPin, LOW);   duration=pulseIn(echoPin, HIGH);   distance =(duration/2)/29.1;   Serial.print(distance);   Serial.println("CM");   delay(10);    if((distance<=10))    {     digitalWrite(buzzPin, HIGH); }    else if(distance>10)  {      digitalWrite(buzzPin, LOW);    } } Your project is all set...!!! Visit my YouTube channel once and see more interesting projects. https://www.youtu...