Microphone pre amplifier using LM358

Pre amplifier using LM358

microphone pre amplifier using LM358

Components

  1. LM358
  2. R1 – 10k
  3. R2 – 47k
  4. R3 – 10k
  5. R4 – 10k
  6. 1M POT
  7. C1 -4.7 μf
  8. C2 – 10 μf

This is a simple mic pre amplifier using LM358. The circuit is self explanatory and is based on LM358 op-amp.

The main function of a pre amplifier is to amplify small and weak signals. The pre amplifier amplifies signal with very high gain but does not have the drive current or current gain to drive the output. hence the boasted signal from pre amplifier is given to power amplifier where the current is amplified. You can connect to amplifier using LM386 described in my previous post or any other amplifier that you have.

 

Simple 2 minute Timer Circuit for your DIY

In this post, a simple timer circuit switch for light is designed that will turn on a high power LED for a particular duration.

Timer is a switch that is operated by a timer system. The switch is turned on or off by the timer only after the preset time. One of the best examples of a timer switch is the sleep mode in televisions and computers. If no key is pressed for a particular duration, the television or computer will automatically go to sleep mode where the device enters a low power consumption mode or may even be switched off.

Circuit Idea

timer circuit

Components Required

  1. T1 – BC337
  2. T2 – BC547
  3. D1 – 1N4007
  4. LED
  5. R1-270 Ω
  6. R2 -12 k
  7. R3 -10k
  8. R4 -220Ω
  9. R5 -1k
  10. VR1 -100k pot
  11. C1 -1000 μf
  12. Push switch

Circuit Design

It’s a transistor based electronic timer. The design of the timer switch is very simple. A push switch  triggers the light. The timer is based on the charging and discharging of the capacitor in the RC network. The circuit is very simple and self-explanatory.

How it works

When the switch is closed, the transistor BC547 is turned on. The 1000µF capacitor will charge at the same time through 220Ω resistor.

As BC547 is turned on and its emitter is connected to the base of BC337 through 12K resistor, it will trigger BC337 and it starts conducting.

As the LED is connected to collector of BC337, it is turned on. R1 acts as the current limiting resistor for the LED. When the switch is opened or button is released, BC547 will stay turned on due to the charge from the capacitor. The time of discharge of capacitor through 10KΩ resistor and 100KΩ POT can be set by adjusting the variable resistor.

A 1KΩ resistor acts as a protection resistor when the resistance of variable resistor is completely reduced.

The timer switch in this project will keep the LED turned on for a maximum of approximately 2 minutes.

Testers – what value add we provide?

As a tester what value add we provide? To answer this we need to answer few questions like
What is a business value of testing?
What is cost of quality?

Running tests by itself has no value add. Testing has value when it connects with some other goals or objective of the organization.
Some of the goals are listed below:

  1. Finding must-fix defects before release. This will reduce long term defect related cost.
  2. Finding less critical defects which have workaround. These workaround can be documented and reduce tech support and helpdesk cost.
  3. Reduce risk by running tests and giving confidence to delivery manager in releasing it to customer. This will give an assurance that the software will also pass the test on customer environments and probability of failure is less.

To measure the quantitative value add and efficiency of testing we need to look into Cost of Quality.

Cost of quality can be understood as cost of poor quality. Cost of quality shows that cost of poor quality is more and that good quality saves money. Cost of quality can be classified as

  1. Cost of prevention – Cost incurred to prevent bugs from happening. Example: training to development team.
  2. Cost of detection – Expense incurred in finding bugs and would include even if we do not find bugs. Examples: Test planning, design and execution etc.
  3. Cost of internal defects/failures – Expense incurred in re-work / bug fixing and expense of re-testing.
  4. Cost of external failures – Expenses we incurred because we did not found and removed all defects before release and there are defect leakages.

Spending effort on external failures are less if we spend more effort in defect prevention, detection and internal failures. It increases confidence that probability of external failures is less.

So it’s very clear that cost of quality is high if there is no internal testing. To phrase it correctly, no proper internal testing as you may argue that developers do testing. By Proper I mean complete end to end testing and not just unit level testing.

We clearly see that there is a need of testers and some value that testers can provide.
Also as a testers we should move out of our comfort zone and think ourselves as an independent advisor to customer and provide trusted advice to customer in terms of quality and quality improvement process.
Feel free to provide your thoughts on this.

 

How to connect 16*2 LCD display Arduino UNO

To Connect 16*2 LCD Display Arduino Uno we will use the previous project to capture temperature and display on console.

Parts required for the project:

  1. Arduino IDE to program the code and upload
  2. OneWire and DallasTemperatre library for the Arduino and DS18B20
  3. One DS18B20 digital temperature sensor
  4. Arduino UNO R3
  5. 16*2 LCD display
  6. Jumper wires
  7. Breadboard/PC/General purpose board
  8. Arduino UNO cable
  9. wires

Steps 1: Wiring Arduino and DS18B20

  • The wiring, of a 1-wire interface, is super simple.
  • The GND pin of the DS18B20 goes to GND on the Arduino. [black]
  • The Vdd pin of the DS18B20 goes to +5V on the Arduino. [red]
  • The Data pin of the DS18B20 goes to a (digital) pin of your choice on the Arduino, in this example I used Pin 7
  • Add a pull-up resistor of 4.7 KΩ. as shown in the schematic diagram. One end of resistor connecting Vdd and another end connecting data pin.

Step 2: Connecting the LCD display

  • VSS –> GND Arduino
  • VDP –> 5V Arduino
  • VO –> output potentiometer (potentiometer VCC -> 5V Arduino, potentiometer GND -> Arduino GND).
  • RS –> pin 12 Arduino
  • RW –> GND Arduino
  • E –> pin 11 Arduino
  • D4 –> pin 5 Arduino
  • D5 –> pin 4 Arduino
  • D6 –> pin 3 Arduino
  • D7 –> pin 2 Arduino
  • A –> 5V Arduino with 1.2 k resistor
  • K –> GND Arduino

 LCD display Arduino UNO breadboard diagram

Step 3: WRITING CODE AND UPLOADING

Machine generated alternative text: fritzing

#include<OneWire.h>
#include<DallasTemperature.h>
#include<LiquidCrystal.h>

// Data wire is plugged into digital pin2
#define ONE_WIRE_BUS 7
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);
//LCD display pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
double temperature;
void setup(void)
{
 Serial.begin(9600);
 //Serial.println("Temperature Demo");
 sensors.begin();
 lcd.begin(16, 2);
 lcd.print("hello, WORLD");

}
void loop()
{
 sensors.requestTemperatures(); // send command to get temperatures
 delay(500);
 temperature= sensors.getTempCByIndex(0);
 delay(1000);
 lcd.display();
 lcd.setCursor(0, 1);
 lcd.print("Temp: ");
 lcd.setCursor(7, 1);
 lcd.print(temperature);
 lcd.print(" C");
 
}

LCD display Arduino UNO Schematic

Screenshot of the Project output

LCD display Arduino UNO project screenshot

How to Measure temperature with Arduino and DS18B20 sensor?

In this example project we will be combining an Arduino and DS18B20 sensor. The DS18B20 is also called 1-wire digital temperature sensor

Arduino and DS18B20 Temperature Sensor The DS18B20 comes in different forms and shapes, so you have plenty of choice when deciding which one works best for you. There are 3 variations available: 8-Pin SO (150 mils), 8-Pin µSOP, and 3-Pin TO-92.

I have used waterproof version as shown below.

ds18b20-waterproof

Note: DS18B20 is quite versatile. It can be powered through the data line (so called “parasite” mode, which requires only 2 wires versus 3 in normal mode), it operates in a 3.0V to 5.5V range, measures Temperatures from -55°C to +125°C (-67°F to +257°F) with and ±0.5°C Accuracy (from -10°C to +85°C). It converts a temperature in 750ms or less to a up to 12 bits value. Another cool feature is that you can connect up to 127 of these sensors in parallel, and read each individual temperature.

Things you need to get Arduino and DS18B20 sensor work:

  1. Arduino IDE to program the code and upload
  2. OneWire and DallasTemperatre library for the Arduino and DS18B20
  3. One DS18B20 digital temperature sensor
  4. Arduino UNO R3
  5. Jumper wires
  6. Breadboard/PC/General purpose board
  7. Arduino UNO cable

Below is the schematic diagram for the same.

Schemaic_arduino_ds18b20_temperature_sensor

 

 

Step 2: Installing and loading OneWire and DallasTemperature Library

Unzip the downloaded zip file. Make sure that folder name is OneWire, which contains the library. Drag it into the Library folder of Arduino IDE. Alternatively you can use Sketch-> Import Library -> Add Library option of Arduino IDE and select the Zip file.

Step3: Writing code and uploading

#include<OneWire.h>
#include<DallasTemperature.h>

// Data wire is plugged into digital pin2
#define ONE_WIRE_BUS 2

OneWire oneWire(ONE_WIRE_BUS);

DallasTemperature sensors(&oneWire);
void setup(void)
{
 Serial.begin(9600);
 Serial.println("Temperature Demo");
 sensors.begin();
}

void loop()
{
 Serial.print(" Fetching temperature...");
 sensors.requestTemperatures(); // send command to get temperatures
 Serial.println("Done..");
 Serial.println("Temperature is ");
 Serial.println(sensors.getTempCByIndex(0));
 delay(1000);
}


Output will be shown as follows:

Arduino DS18b20 - Output

Screenshot of the above example:

Arduino and a DS18B20 sensor 1

We can modify this to display it in LCD display. For details on how to display the temperature on LCD display visit my post How to connect 16*2 LCD display Arduino UNO

Servo Motor Control using Arduino

Following post will explain Servo motor control using Arduino UNO 3.

Servo motors have three wires: power, ground, and signal. The power wire is typically red, and should be connected to the 5V pin on the Arduino board. The ground wire is typically black or brown and should be connected to a ground pin on the board. The signal pin is typically yellow or orange and should be connected to pin 9 on the board.

The potentiometer should be wired so that its two outer pins are connected to power (+5V) and ground, and its middle pin is connected to analog input 0 on the board.

Figure 1 – Schematic Diagram

servomotor-arduino_bb

Figure 2- Circuit Diagram

servomotor-arduino_schem

 

 

Complie and upload the following code.

#include <Servo.h>
Servo myservo;  // create servo object to control a servo
int potpin = 0;  // analog pin used to connect the potentiometer
int val;    // variable to read the value from the analog pin

void setup() {
  myservo.attach(9);  
// attaches the servo on pin 9 to the servo object
}

void loop() {
 val = analogRead(potpin);   
 // reads the value of the   potentiometer (value between 0 and 1023)
 val = map(val, 0, 1023, 0, 180); 
 // scale it to use it with the  
 servo (value between 0 and 180)
 myservo.write(val); 
// sets the servo position   according to the scaled value
 delay(15);   
// waits for the servo to get there
}

Next we will see how to measure temperature using DS18B20.

 

Page 1 of 2012345...1020...Last »