Monday, November 27, 2017

DIY Powerbank 2017-A

In search for an easy to make power bank diagram? Here is one for you.

To keep things easy and simple different modules have been used instead of discrete components which greatly reduces the amount of work to be done however a few capacitors will be needed.

Main features:

1. Use of Lithium Ion cell. 18650 cell with protection will be perfect.
2. TP4056 based Lithium Ion charger.
3. A7530 based DC-DC boost converter. 

Extra components required

2 100uF 16V Capacitor.
SPST switch.

This diagram is easy to understand and make but the main limitation will be the amount of power it can deliver which is not that high.

The modules:

First module that will be used is a TP4056 based single cell lithium ion charger. It charges through a micro USB port which is very convenient. It can charge at up to 1A of current which is moderately fast. This module also has Two indicator LED for showing different status. Link to the datasheet is added to the bottom section of this post where a detailed information on what the indicators mean can be found. The only modification required is to solder one 100uF capacitor on the Input pads, minding the polarity.

4056 Based Lithium Ion charger Module

The second module is an A7530 based DC-DC converter. As you might know the voltage of USB port is 5V where lithium ion delivers around 3.7V-4.2V. So Voltage has to boosted up. This particular module do just that, it has a USB port on the output section that can deliver about 800mA so not that powerful but should get the job done. It comes with a 100uF capacitor on its output so nothing needed there. It also has an Indicator LED on board which will light up during operation.

A7530 based DC-DC Converter

Choosing the lithium ion cell

18650 cell with DW01A and 8205A based lithium ion protection circuit will be ideal for this. If your charging module already have protection you can use unprotected lithium cells as well. Two or more cells could be used in parallel although make sure to use similar cells. The only modification needed here is to add a 100uF capacitor across the cell.


This is how the modules and other parts will be connected. 

Very small amount of soldering has to be done with this project. On the Lithium Ion charging module a 100uF capacitor is soldered across the input pads. From the output of this module two wires run to the Lithium Ion cell. Another 100uF capacitor has to be soldered across the cell. I would recommend using 18650 battery case and soldering the capacitor across it which not only omits the necessity of soldering wires across the cell itself but will also make it easily swappable. From there those two wires run to the DC-DC voltage boost module, a switch can be added between the battery and the boost module to turn it on or off and that's pretty much it. Put everything in an enclosure and you are good to go.


1. Datasheets.
2. My full blog.

Tuesday, November 21, 2017

Single Cell LED circuit with Joule-Thief

If you want to light up a white LED from a single AA/AAA cell with minimum amount of components this circuit will be a perfect fit for you.

Scope of use:

This diagram might not be that useful for serious project but it is awesome as something small and simple to make yet works very well. This circuit can extract energy from AA/AAA cells that might seem empty. Even if other devices won't run on it you can practically get some energy from them, yes a LED won't do much but for very small torch or something it will be awesome.



25Turn of 26Gauge/0.404mm wire on Ferrite Toroid , shown in the diagram.


1 220ohm


1 BC547NPN


1 White LED.


How it works?

To put it simply the top coil in the diagram conducts while the transistor is on and stores energy across it and after small amount of time when the transistor turns off this stored energy finds a way to dissipate and increases the voltage up to a point at which the LED will conduct and which in turn make the LED light up.
If you follow the link below you will be able to learn in more details of the inner workings of this circuit.


1. It is better to use a white LED.
2. If you can't make the coil two 100uH Inductor in close proximity should work as well. 


1. Datasheet for transistor.
2. Visit my full blog.
3. Joule Thief circuit.

Single Cell LED circuit with regular components

If you plan to make a single cell LED driver but not willing to use any integrated circuit and only of the shelf products this diagram is for you.

Parts Needed:


1 PN5143 PNP
1 PN3569 NPN


1 1k
1 2.2k
1 3.3k


1 470pF
1 22uF 16V


1 1N5817 Schottky
1 LED White


1 100uH


How does it work?

This circuit simply boosts up the voltage by switching on and off the NPN transistor PN3569 which in turn stores energy in the 100uH Inductor and released. This is stored to the 22uF capacitor through the Schottky diode which turns the LED on. The switching on and off is done by the PNP transistor PN5143, 470pF capacitor and the resistor with it. You can read DC-DC Boost converter to learn more about the process.


1. Datasheets of the diode and transistors used in this project.
2. Visit my full blog.

Single Cell High Current LED Driver with LTC3490

If you are looking for a circuit to drive high brightness 1W LED with a single dry cell this will a be perfect diagram to use.

Necessary Components:



1. Inductor that can handle 2-2.5A has to be used.
2. To soft turn on the circuit an 1uF capacitor can be used across the 1Mohm resistor.
3. 1W white LED should be used with this circuit.
4. Q current is less than 1mA.


1. Datasheets of the components used in here.
2. Visit my full blog.

Single Cell LED Driver With LT1932

Have you ever tried to turn a LED on with a single AA cell? It wouldn't light right? Because a single cell doesn't have enough voltage to turn a LED on as typical LED forward voltage is about 2V-3V. So if you want a LED to light up with a single cell you will need something more.

In this post I will write about how to do just that but with good components which will be excellent for a bright LED based torch light running on a single cell.



1. Input Capacitor Must be placed as close as possible to the LT1932.
2. Rset value of 1.2Kohm is selected to get about 20mA, for higher current check the datasheet.
3. Low ESR capacitor should be used with the output.
4. Low DCR Inductor should be used.
5. For a long battery torch light single C cell will be perfect.
6. 5mm 20mA White LED with reflector should be a good choice for torch.
7. You can add more LED if you want, check the datasheet


1. Datasheets Integrated circuit, diode and LED used in this post.
2. Visit My full blog.

Wednesday, November 1, 2017

Simple Main Line LED Dim Light

If you are planning to make a small mains powered LED lamp you are in the right place.
The diagram is a very minimalist in nature, it is not the best diagram of course(in terms of power factor) but it surely will get the job done.

Where to use? 

This particular diagram is awesome as low cost dim light or indicator light.

Components Needed:

Capacitor - 1 Bipolar 0.22µF, 400V(or Higher).
Resistor - 1 470KΩ and 1 470Ω.
LED - 4 of them.


How does it work?

To keep component count to minimum the bridge rectification is done using the LED themselves, in many cases you might have to use four individual general purpose diode or a bridge rectifier chip.

The load here is just shorted so the light emitting diodes just light up when you put the mains in. The 470Ω resistor is there for limiting the inrush current and the 470㏀ will drain any charge left in the capacitor after usage to prevent you from getting electric shock at the outer input pins when it is off.


1. Power factor is not good(like any other capacitive dropper circuit).
2. There might be flicker(as no filter capacitor is used here).
3. Stray electricity might keep the LED lightly lit even when the switch is off.
4. This circuit is not mains isolated which means it can't be touched while in operation due to shock hazard.

Practical Setup:

This is the working circuit in real life, not good from a security standpoint but it is just to show the diagram works. However I'm using 1kohm inrush current limiting resistor and no resistor across the capacitor.

Visit my full blog!

Monday, August 7, 2017

Xiaomi Mi USB Wi-Fi Internet Sharing

Good evening everyone. So to add more ways of sharing the internet now I'm going to write about a small product that can be used to create an easy Wi-Fi access point to share internet with Wi-Fi enabled devices very easily.
Scope of use:

The device that I'm talking about is this one, Xiaomi Mi Portable Wi-Fi. There are other devices on the market like a simple USB Wi-Fi dongle that can do what it does which is creating a Wi-Fi access point but what good about this product is the software that has made this product very easy to use.

So like I said this product can be used to create an access point. All you need to do is find a computer or laptop with internet and free USB port. By simply installing the provided application you can turn that system into an access point. It doesn't matter how that computer is getting internet from, could be wired LAN, could be wireless LAN, could be 3G/4G modem etc.

Components needed: 

1. Working computer with internet and the software installed.
2. Mi Portable Wi-Fi.

This is what I got in the box or package. Obviously I ordered the black one.

And yes the manual provided here is in Chinese.

How to use: 

First you need to download the software and install it. Installation process is very simple so I'm not gonna go over it but I will put a link to the software down below. You can use this device in two ways, either as AP or as an USB dongle for your system. Let's go over them real quick.

1. Using it as AP.

First open up the MiWiFi application. It should ask you to connect the device.

As soon as you connect the device, you will see it has by automatically created an access point. You can change the name and the password from the main window or from the settings menu. It is a Wi-Fi n device so USB 2.0 port would be enough to handle the speed.

You can see no device is currently connected to it.From your phone or any other Wi-Fi enabled device you can connect to it and use internet.

These are two screenshots from my phone which shows the connected state and the speed you can expect from it. To remind you though the Portable Wi-Fi device is connected on the front panel USB 3.0 port of my desktop and I'm sitting next to it and yet you can see it is not getting full signal. From the PC you can see the 1 device is connected.

The button on the right side of the number of devices connected open up device management window from where you can limit speed for any device, blacklist it or make it administrator.

This is the speed that my computer gets which is directly connected to the router via Ethernet cable. So yes your are losing out on speed while using this particular device.

Sorry about the black bars though.

2. Use as an USB Wi-Fi dongle

The second thing that we can do with this device is simply use it as a Wi-Fi dongle. To do so we have to press the menu button and click IDS_SWITCH_MODE_STATION. (Marked with Red on the picture)

Upon confirming it should automatically switch and now you will be able to see nearby Wi-Fi access points and connect to them if you want to.

If you want to go back to the AP mode simple click on the menu button and change it back to AP.

There are other clever things that could be done with it which I might write about in the future including how to use it with Linux and Raspberry Pi.


1. Price - This is a very cheap product. I paid about half of what an USB Wi-Fi n dongle would cost me here.
2. Size - Very compact.
3. Very easy to use.
4. Speed - Although the connection speed kept on fluctuating I didn't find any problem using internet on my phone through this AP or using it on my PC when it was on simple Wi-Fi dongle mode.


1. Bad design - Hard to get it out of the the cover and hard to get it out of the USB port if the port is in awkward place.
2. Unstable connection - Fluctuates a lot. Even on ideal condition it keeps on varying from 6.5-72Mbps.
3. Wi-Fi standard - This is a Wi-Fi n device, so if you need high speed Wi-Fi, this one is not for you.
4. Range - One small room, that's pretty much the usable range of this product.


1. Link to the software.
2. Link to the official device page.

3. Visit my full blog. 

Saturday, April 1, 2017

Raspberry Pi Torrentbox

Continuing with the Raspberry Pi posts this time I'm writing about how you can transform your Raspberry Pi into an always On torrent box.

Although this is April 1st but be sure that this method works. So why should anyone use Raspberry Pi as their torrent box? To begin with Raspberry Pi consumes very little power so it is very easy to keep it running for long period time as oppose to keeping a full Computer running. You can just start a download and go about your business and at the end of the day the file will be there for you to use. There is even no need for getting it to your computer, you can watch it on the Pi itself(if you hook it up to a display) or turn your Pi into a Network attached storage so you can watch it directly from the Pi.

So what do we need? 

1. Raspberry Pi, whichever model you have. I find Raspberry Pi 2 to be the most suitable candidate.
2. Power Supply and micro SD for Pi.
3. Extra storage solution, whether an USB based flash drive or a hard drive.
4. Working copy of Raspbian.
5. Internet connection, I will recommend using the Wired one as it is much faster than the Wi-Fi.


1. Like always we will start the process with updating the operating system. The code for that is

sudo apt-get update
sudo apt-get upgrade

2. Now that everything is nice and updated it is time to install a torrent client called Transmission. Personally I have used both Transmission and Deluge and found that Deluge looks much smarter but Transmission is much easier to use. To install it we have to type

sudo apt-get install transmission-daemon

Seems like I already have the newest version.

3. Now to make Transmission work we have to modify couple parameters so what we are going to do is simply stop Transmission so that we can edit the settings.json file.

sudo service transmission-daemon stop

4. Now that the service is stopped we can start editing. To do so we have to type in

sudo nano /etc/transmission-daemon/settings.json

So the settings.json file is open, we have to edit some items such as


"rpc-authentication-required": false

This will get rid of authentication when connecting to Transmission via web browser.


"rpc-whitelist": ",192.168.0.*"

This will allow us to use the transmission web based interface with all computers on the network(including local-host) with IP 192.168.0.x, where x could be any numerical value. I know that the way my Router's DHCP server is set it will give out IP addresses like this, if your Router gives off different IP like 192.168.1.x then you have to use that value. As with the DHCP we know that after lease time IP addresses are given to other devices if not renewed, so the IP address of Pi can change. If you want to avoid that all you have to do is simply reserve an address for it into the router. I will post in a link how to do that in your Router at the end of the post. 


"rpc-port": 9091
"rpc-url": "/transmission/"

that's all the edits we need. Save and exit from here.

5. Now let's start the service again by typing.

sudo service transmission-daemon start

6. Time to test. Get to the browser of your computer and type in the IP address and the port, for me I know my Raspberry Pi 2 can always be reached by a certain address that is reserved so for me

Seems like it is working.

7. So let's grab a torrent file and upload it or put the URL of that torrent after hitting the "Open Torrent" button at the very left.

So I grabbed the torrent file of Ubuntu OS and let's see if the Pi can download it.

Seems like the Pi is downloading the file just fine. Seems a bit slow but it is downloading it. You can change the default directory or limit speed from the settings menu by clicking on the bottom left corner buttons. So we have a working torrent down loader that can be kept on for long time.


1. Raspberry Pi might not download torrents that fast as it lacks Gigabit Ethernet so even if you connect it directly to your router via Ethernet port you will get 100Mbps at best, connection-wise, Pi might download it at somewhat lower speed.(If your internet is not that fast, say 4-5Mbps, you should be fine)

2. It also lacks high speed storage support. There are other boards out there with Gigabit Ethernet and SATA port or USB 3.0 port, those should be much suitable for this purpose but as you can see for normal usage this one works fine as well.

3. If after rebooting, the transmission web base interface does not show up just stop and restart the service by typing the following commands in the terminal or via SSH.

sudo service transmission-daemon stop
sudo service transmission-daemon start

4. If you find it difficult to remove the torrent file from the Raspberry Pi remove it from the web based interface by right clicking on the torrent name and Trash Data and Remove option.

5. In this method deleting file from the Raspbian OS might not be possible due to access issue. In that case from the Web interface make sure to use "Trash Data and delete torrent" to ensure the file is deleted as well. 


1. Read my other posts here.
2. All posts about Pi.
3. How to reserve an address on your Router. 

Thursday, March 30, 2017

Taking Screenshot in Raspbian

So this will be a very small post about how you can take a screenshot through command line interface in Raspbian operating system.

What Do we Need?

1. Raspberry Pi or any other single board computer that supports Raspbian.
2. Mouse, keyboard and Monitor if you want to use the Raspberry Pi alone.
3. Internet Connection.
4. Raspbian OS.
5. Power supply for the Pi.


1. Like always we will start off with making sure the Raspbian is fully updated. To do so just run the commands.

sudo apt-get update
sudo apt-get upgrade

2. Next we are going to install a small software called Scrot. To do so we have to type.

sudo apt-get install scrot

3. Now to take a screenshot all we have to type is


 4. You can also delay taking the screenshot simply by adding delay marker and a numerical value indicating seconds. To do so you have to type

scrot -d x
[where x will be a numerical value which is in second]

5. Screenshot will be stored at /home/pi.

That's pretty much it! Hope this was helpful.


1. My other posts.
2. All Pi related posts.

Tuesday, March 28, 2017

Check Your Internet Speed With Raspberry Pi

Good evening, welcome to another Pi post which is about checking your internet speed with Raspbian on Raspberry Pi. This post will be very brief and just to show how you can check your internet speed without using anything other than the Terminal.

So, what do we need? 

1. Raspberry Pi!
2. Internet Connection to it either via Wired or Wirelessly.
3. Power supply for Raspberry Pi.
4. Working installation of Raspbian on Micro SD card, I'm using the latest release.
5. Monitor, keyboard and mouse if you want to only use the Raspberry Pi.

Note: You can also use another computer to SSH into the Pi or maybe use Virtual Network Computing but if you have a computer where is the point of doing a speed test on Pi although it might be helpful to understand how fast will the Pi download something if used as a Torrent box.

Hardware Connection:

1. Connect Mouse, keyboard and Monitor.
2. Next connect the internet, however you like.
3. Finally plug in the micro USB power cable to power it up.


1. After the boot up, launch the Terminal and make sure to fully update the Pi. To do so type in

sudo apt-get install update
sudo apt-get install upgrade

Once that has accomplished let's move on to the actual installation.

2. Now we need to install the Python-pip which is a package management system used to install and manage software packages written in python. In the terminal type in

sudo apt-get install python-pip

Here I already have the latest version so nothing new installed.

3. Not time to install the speed test part which we will do using the Package Management system.

sudo pip install speedtest-cli 

Again I already have it installed so not much was shown here.

4. Let's do the speed test which will be shown in the Command Line Interface. To do so we have to type in


Just to make sure let's compare this with my computer that is also directly connected to the Router via Wired Ethernet just like the Raspberry Pi.

Ping has increased in Pi but speed is consistent. Although my internet is not that fast so it also proves another thing that for slow internet Pi is good enough.

That's pretty much how you can use Pi as your internet speed tester.

More links:

1. Read my other posts here.
2. More Pi related projects.

All About Pi!

Short Index for all Pi Related posts! Hope you will enjoy it.

1. Raspberry Pi Starter Kit. (Coming Soon)
2. Let's talk about operating systems for Raspberry Pi. (coming soon)
3. Virtual Network Computing(VNC) on Raspberry Pi.
4. Raspberry Pi as Network Attached Storage.
5. Turn your Pi into a Torrent Box.
6. Internet Speed test using Raspberry Pi.
7. How to take Screen Shot in Raspberry Pi
8. Turn Your Raspberry Pi into a IR Remote Controller. (Coming soon)
9. RPi NAS drive without USB. 
10. Firefox on Raspberry Pi.

Visit my full blog!

Tuesday, February 14, 2017

Musical Doorbell

This post is about making a simple musical doorbell circuit that can be used in your house and might take only couple minutes to build it.

Goal here is pretty simple, it will be a musical doorbell that has a very small power consumption and can play the music for couple moments even after releasing the momentary doorbell switch. For the music we will be using a melody generator integrated circuit to make our work easy and to turn on and keep it on we will be relying on Capacitor and transistors, so let's take a look at the component list.

Component List.

1. Integrated Circuit UM66.
2. Transistor 2N3904, 2N3906, SS9013, one piece each.
3. Capacitor 100uF.
4. Resistor two 1Kohm, and one 10kohm and one 100kohm.
5. Battery holder, two AA type.
6. Speaker 4/8ohm.
7. Momentary press button.

Let's talk about music!

Part number of the UM66 will give us an idea of what music it is going to generate. To find the right music for doorbell buy the one with the right part number.

The diagram!

Now that we know which Integrated circuit to order let's build the circuit.

How does it work? 

Power source for this circuit is two AA size cell, preferably Alkaline. They will provide roughly 3V.

When SW1 or the momentary press button is pressed the 100uF capacitor will be charged and at the same time the 2N3904 transistor will start conducting as it is getting current to it's Base.

As the 2N3904 can now be treated as a close switch we can assume the Base of 2N3906 to be at the ground which will cause the 2N3906 to start conducting.

Now we can see the current can enter into the integrated circuit causing it to turn on. This circuit will output a melody signal which will be amplified using SS9013 transistor which is feeding a loud speaker.

If the momentary switch is released, the 100uF capacitor will discharge through the 10kohm resistor and the 2N3904 transistor. So it will keep the circuit alive for couple moments after releasing the switch. Once it is fully discharged both the transistors will be open again and the integrated circuit will not get any power to stay On.


1. You can use ZL66 instead of UM66 too.
2. Two AA Alkaline cells will be fine for this doorbell.
3. A normal 1-3W speaker will be fine.
4. Increasing the value of the capacitor will cause the circuit to stay alive longer after the press button is released.
5. Both the 2N3904 and 2N3906 can be replaced by similar NPN and PNP transistor respectively.


1. UM66 Datasheet.
2. SS9013 Datasheet.
3. Read my other posts.