Posts

logic design 101

Image
  demorgan's Law                                                       

secrets of arduino atmega328p adc

Image
In this tutorials i'm gonna tell you all about the adc present in arduino famous boards like UNO,NANO,MINI....the atmega328p chips consist of the " 10-bit resolution adc " inside the uC. The type of adc is used in is  Successive approximation ADC . these are kind are slow but gives good resolution though. let's dig in registers of adc in atmega328p. To read analog input we need The reg " ADMUX ". T he adc reg have a Pin called AREF (adc reference voltage). The gives 10-bit number i.e 0-1023, 0-0V & 1023-5V. it measures using this formula       Vin = (Analog Ref * analogRead() ) / 1024 we need stable AREF voltage we can use internal 1.1V reference or we need to provide a stable voltage anywhere between 0.3V-5V externally. [NOTE: if ur are planning to provide external voltage to aref pin present on arduino uno,nano,mini, the recommended value is less than 5v to be safe on safe side cause the voltage of external 5v source may not be 5v exactly so if it i...

HACK AND CLONE CAR KEY FOB, MY EPIC FAILURE...!!

Image
In this blog post i'm sharing my experience on cloning the my car key fob signal and how to do it properly. first things frist the cars now a days comes with a wireless remote key where u get atleast 2 or 3 options like lock,unlocking ,trunk(we call it as dickey!!!).....these options let your car access wirelessly and some cars are completly keyless for even driving. the keys of the cars are actually communicating with certain frequency like 433.xxxMHz or some countries uses 315.xxxMHz...the car companies uses an algorithm called " ROLLING CODES "...these are not that esay to crack cause they change every time u press key and once the key transmitted it cannot be used again... but a hacker named "samy kamakar" demonstrated an attack called REPLAY ATTACK where u simply transmitt the signal by recording the key fob away from car or blocking the signal and then recording. so this is how i've tried it..frist i needed to listen to the signals as possible in 10KHz...

LM386

Image
                 LM386 DIP-package   The LM386 is a dip package OP_AMP specialized for low power audio amplifications still using in these day. there are different types of LM386 versions I'm using LM386 N-4...depending upon the variation the input voltage can vary... for my chip its "min=4V" to "max=18V"    , it has nearly power gain of 1W and 1W may not sound enough but it's enough for a mono audio output speaker. Here are some best youtube videos on op amp by various youtubers .  best project videos on op amps . [Note: before you go make this circuit i recommend powering it with some 9V or 6V battery of walladapter less than 5W or so.] the below circuit is by   AFROTECHMODS  a nice video on building a 1w mono amplifer circuit  using a lm386.  i'm using the circuit in datasheet with gain of A = 200.      The Vin is audio source like a mp3 files container like phone or pc. The it ...

PYSERIAL WITH ARDUINO(comms with arduino from pc)

Image
In this post we're gonna learn about "pyserial"  python language library package to communicate or log data from arduino to pc (or) we can get rid of the serial port of arduino.H ence we do the same as we do in serial monitor. the module can be installed using pip   for linux: " sudo python -m pip install pyserial"   for windows : " pip install pyserial" here is a small arduino skecth for reading from terminal or cmd from arduino serial port code: import serial as sl #importing the serial lib as name sl import time mon = '/dev/ttyACM0' #declearing a variable for port name baud = 9600 #defining baud rate arduino = serial . Serial(mon, baud, timeout =. 1 ) while True : mon = arduino . readline() print ( 'the read data:,mon' ) #printing message for reading data from serial here is the python file for data loging code: import serial arduino_port = "/dev/ttyACM0" #serial port of Arduino ba...

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 ): ...