Posts

Showing posts from February, 2022

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 should be connected to a pot to control the audio sound for amplificatio

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