Plus/minus supply using LMC7660

LM 7660 is a CMOS voltage convertor capable of converting a positive voltage in the range of +1.5 v – 10 v to the corresponding negative voltage of -1.5v to -10v using very few external components. Below is the schematic diagram for the same.

We can use this get +/-5v from different sources like from 9v battery. Adding LM7805 converter to a 9v battery or 9v power supply will reduce it to 5v as shown below.


  • IC1 – LMC7660
  • IC2 – LM7805
  • C1,C2 – 10μF 16V
  • C3 – 470 μF 25V
  • C4 – 2.2μF 16V
  • Battery – 9v


Bicycle USB Charger

This circuit has been developed to add a USB charging port to a bicycle for charging a mobile phone. The input supply for the circuit is produced by a dynamo (6V, 3W dynamo) in the bicycle.

The circuit is based on LM2596-5.0. It is a 3A step down voltage regulator. LM 2596 are available in fixed output voltage of 3.3, 5, 12v and an adjustable output version. The LM2596 series operates at a switching frequency of 150 kHz, thus allowing smaller-sized filter components than what would be needed with traditional lower-frequency switching regulators. The IC provides all active functions for a step-down (buck) switching regulator, capable of driving a 3A load with excellent line and load regulation.

Circuit & Part list

  • C1        1000uf
  • C2        470 uf
  • D1-D2        1N5818
  • D5        1N5818
  • J        Dynamo 6v 3W
  • L        33 u
  • LED
  • R          1k
  • SW        1 on/off switch
  • IC        LM2596
  • USB-A Connector

How it Works?

The alternating voltage generated by the dynamo is converted to DC by a full-wave bridge rectifier comprising Schottky barrier rectifier diodes D1 through D4 and a filtering electrolytic capacitor (C1). The output of the bridge rectifier, which is charged to peak value of AC voltage (nearly 10V), is input to switching regulator LM2596-5.0 to provide a regulated 5V (DC) output, which is suitable for charging mobile devices using the USB connector.

The 5mm LED (LED1) in the circuit indicates output status. Feedback connection FB (pin 4 on IC1) is connected directly to output voltage at electrolytic capacitor C2. The 33μH inductor (L1) should be rated for a DC current of at least 1A. The dynamo output is connected to the circuit by switch S1.

Light Sensor using Arduino


In this project, a simple light sensor is designed using LDR. The project is built around Arduino.

Components required

  • Arduino UNO
  • Light Dependent Resistor (LDR)
  • 100 KΩ POT
  • Buzzer

Circuit Diagram


A 100 KΩ POT and the LDR form a voltage divider and the output of the voltage divider is given to the analog input A0 of Arduino. A buzzer is connected to pin 11 of Arduino.

When the LDR detects a light over certain intensity, the Arduino will trigger the buzzer. When the intensity of light decreases, the buzzer is turned off.

The 100 KΩ POT used in the voltage divider network can be used to adjust the intensity levels at which the buzzer is triggered.


int sensorPin = A0; // select the input pin for the potentiometer
int sensorValue = 0; // variable to store the value coming from the sensor
void setup() {
// declare the ledPin as an OUTPUT:
void loop()
if(sensorValue <= 14)

This circuit is similar to dark sensor circuit using BC547 transistor.

Make your own Li-ion power bank


There are many ways to make a Li-ion power bank. We will here use 3.7v Li-ion rechargeable battery and few other modules. You can purchase the battery from ebay or Aliexpress or extract from your old laptop battery. This power bank can be used for charging smartphones.

What all you need ?

Following are the components/module required to make your own Li-ion power bank. In the below project I have used only one battery of capacity 2600 mAH. You can add more battery in parallel to increase the capacity of your Li-ion power bank.

  1. Li-ion 3.7 volt battery of type 18650 and 2600mAh
  2. 5V Mini MICRO USB 1A TP4056 Lithium Battery Charging Charger ModuleCharger_module
  3. DC-DC Boost Converter Step Up Module 1-5V to 5V Booster_module
  4. A case of your choice
  5. USB connectors


  • Connect Li-ion battery positive and negative to charger module B+ and B- respectively. The charging module has mini usb connector which can be used as input 5 v charging voltage. You can also connect In+ and In- to Solar panel (optional)
  • Connect DC-DC boost converter to Battery via a switch. IN+ and IN- of boost converter should be connected to battery.
  • Connect Ground and 5v to USB connector as output.

The battery charger module, is designed around a dedicated lithium-ion battery charger TP4056 chip. The onboard charge controller chip handles BATT.1 charging operation by processing the 5V DC input supply received through the USB socket (or through IN+ and IN- terminals). Output terminals (BAT+ and BAT-) can be directly connected to BATT.1. Two onboard SMD LEDs located on top of the circuit board provide charging-status indications.

BATT is used as the power reservoir. Since only 3.7V DC supply is available from BATT, DC-DC boost converter is used to cater to the stable 5V DC supply at output. If input voltage of 0.9V to 5V DC is available, this converter gives stable 5V DC output through its USB socket. When the battery is fully charged, a blue-coloured LED will turn on. You may remove the charger connected at USB-IN.

Li-ion power bank

Microphone pre amplifier using LM358

Pre amplifier using LM358

microphone pre amplifier using LM358


  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.

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


Machine generated alternative text: fritzing


// 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.println("Temperature Demo");
 lcd.begin(16, 2);
 lcd.print("hello, WORLD");

void loop()
 sensors.requestTemperatures(); // send command to get temperatures
 temperature= sensors.getTempCByIndex(0);
 lcd.setCursor(0, 1);
 lcd.print("Temp: ");
 lcd.setCursor(7, 1);
 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.


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.




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


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

OneWire oneWire(ONE_WIRE_BUS);

DallasTemperature sensors(&oneWire);
void setup(void)
 Serial.println("Temperature Demo");

void loop()
 Serial.print(" Fetching temperature...");
 sensors.requestTemperatures(); // send command to get temperatures
 Serial.println("Temperature is ");

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


Figure 2- Circuit Diagram




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() {
// 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)
// sets the servo position   according to the scaled value
// waits for the servo to get there

Next we will see how to measure temperature using DS18B20.


How to test Arduino UNO


You have received your Arduino UNO and want to quickly verify and test arduino uno that it is in good condition or you want to write your first Arduino UNO program. To do so you need to follow the following steps:

  • Launch the Arduino IDE. If you have not installed, you can download from following site and install it.

  • Connect the Arduino to USB port.
  • Write the following code to blink the on board LEDtest arduino uno 1
  • Compile and upload the code.
  • The on board LED should start blinking every second.