Posts

Showing posts from 2021

The reactance of capacitors and Inductors

Image
 The "reactanceđź‘Š" is a fancy way of saying the word "Resistance✊" for an inductor or capacitor. well we denote the symbol "X" instead of  "R" . The capacitor acts as a frequency dependent resistor in here, well the reactance of the capacitor(Xc) increases with decreasing of frequency. In math we call it as inverse relation(Xc ∝ 1/F). here in this figure we can see that "Xc"(reactance of capacitor) decreased with increasing "F". so the Xc can be expressed as  The Inductor acts as a frequency dependent resistor in here well the reactance of the inductor(X L ) increases with Increasing of frequency. in math we call it as proportional relation(X L  ∝ F). here in this figure we can see that "X L "(reactance of inductor) decreased with decreasing "F". Or increase as increase in frequency. so the X L can be expressed as

HOW TO WRITE A CLASS OBJECT IN PYTHON

Image
The one way to get started with  the object oriented programming in python is to get started with the " creating a class object and using it". things u need to get started: 1. Latest version of python3  u can get that from here  2. An ide or u can use python default ide which it comes with! that's all u need to get started. here we are gonna make code for math function called standard scaler(for scaling data). you make one for anything u want I'm just a math guy!!  so the math formula for standard scaler is : hence we start with a class object called Scale , the class object doesn't need any input variable for it's name we do it in functions inside of it. The first function inside of class object should be a __init__() " function it must be..! next, an __init__() function should always starts with a " self " variable and other as   follows  by as other variables u may like... class Scale:         def _init_ ( self , data ):              s

A FORMAL INTRO TO MACHINE LEARNING USING LOGISTIC REGRESSION FROM SCRATCH

Image
The machine learning  is all about making computer or a machine like Robot! to do stuff without actually telling every single thing via programming...here the computer or a machine just learns how to do the stuff.., it'll figure it out like you and me. how it does that?...well that's math!! for you...yes, literally it figure it out using mathematics. What kind of it??? well for starters if you ever had any math class in your university or school...that'll do!  Ok that being said we gonna learn little bit of ML(machine learning). especially the one called supervised learning. Supervised Learning : is a kind of method telling the computer what to do whether than how to do..in technical term we call it as specifying "LABELS" for prediction... Say we have a data on a phone parts like camera, storage, ram, 5G or 4G, brand (apple, Samsung, etc..) and their prices. we need to predict the price of a new phone based on specs from our previous data on specs and brand. her

video face detection using HAAR'S CASCADE with python

Image
face detection using HAAR'S CASCADE with python In this tutorial we're gonna look into a face detection using "HAAR's CASCADE" algorithm in open cv.  haar's cascade a is face detection classifier built-in  opencv for face and many more detection. Haar's cascade is originally developed from viola-jones algorithm . but it's not perfect it is prone to noise often, and this algorithm is best suited for frontal face detection, but for just simplicity we use it today. Let's be clear about 2 things they are face Recognization and face detection. They both are 2 separate things. This haars cascade focus and used for face detection means in picture or a video it can detect the faces. Where face recognization is detecting a particular face of person. The problem in computer vision has been bothered so long untill  Development began on similar systems in the 1960s, here is wiki page on history of face detection . The viola jones algorithm achived the face

simple color tracking using opencv(no machine learning mombo jambo!)

Image
                              In this method we are using opencv and python for identifying a color and hilight it. this method uses the simple Bitwise and operation and image "HSV(hue,saturation,value)" manupulation of colors.                      The HSV value of image is represent the original colors of image though the RGB or BGR cannot tell the difference between the levels of colors hence this method only to work with HSV images since the HUE tells the color and saturation tells the level of color.                       here i'm tracking blue levels of colors in HSV u can track any color u want you need the hsv value for that, i suggest to use max value of upper color and min value for lower colorat start and play around the values untill u get statisfied results or just google it!.                      To get started u need few things, and just few line of codes you get ur face detection. we need the following things to get started: 1.python 3 recent would be nice

computer vision(opencv) with python

Image
face detection using HAAR'S CASCADE with python In this tutorial we're gonna look into a face detection using "HAAR's CASCADE" algorithm in open cv. haar's cascade a is face detection classifier built-in  opencv for face and many more detection. Haar's cascade is originally developed from viola-jones algorithm. but it's not perfect it is prone to noise often, but for just simplicity we use it today. "using this method we can also detect many other features like face,eyes,full body,lowerbody,russian number_plates,etc.." here the same method modified for video face detection to get started u need few things, and just few line of codes you get ur face detection. we  need the following things to get started: 1.python 3 recent would be nice! 2.opencv lib package installed using pip 3.laptop/desktop with webcam step 1:               go to www.python.org and download latest version of python3  choose the install python along with pip and Option say

DIY VOLTMETER USING ARDUINO ADC

Image
This post helps to DIY yourself a high precision multimeter using Arduino. The UNO already comes with an excellent 10-bit ADC which is enough, but I recommend using an external ADC of 16-bit if you want to take it to serious measurement. But you don’t want you use it as replacement for a multimeter, buy a good multimeter instead of it. This Arduino based one is helpful for projects and static voltages that doesn’t change over the time.  We can create a voltage divider hence  We can measure voltage drop between the divider and hence multiply with resistance to get the VIN. Here I’m using a 1Kohm and 2.2KOHM resistance to measure max voltage of 5V. If want to measure the higher voltage use the following formula to adjust the resistors.   Vout = VIN * (R1R2/R1+R2) [NOTE:   This voltage “VOUT” should not have to be more than 5v, I recommend VOUT<less than 5V is safe to use]. Sounds easy because it is, but V_IN cannot be measure hence we need ADC to do trick, the 10-bit adc can mea

HOW TO IMPLEMENT PRECISE TIMED EVENT WITH ARDUINO

Image
Let us assume a situation where you want to blink an event at a precise moment with a trigger, while the Arduino doing other tasks and you want to prioritize the blink as important event. Well in order to do that you need timers help to time it precisely hence you need to use timer as interrupt to do that. The Arduino IDE default has a time function called “delay (microseconds)” it is pretty good and we can use it almost in many things, but it’s not precise and tends to shift some mill-seconds after sometime hence not reliable. That being said let’s see how we can implement a timer of Arduino to create a triggered event. The Arduino comes with two 8-bit timers, one 16-bit timer hence we can use the 16-bit timer to implement and triggered event. We are gonna use the TCCR1A and TCCR1B timer registers to implement. In the datasheet it is given clearly about how to implant it. The Timer/Counter (TCNT1), output compare registers (OCR1A/B), and input capture register (ICR1) are all