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 just right. This particular diagram is awesome as low cost dim light.


Components Needed:


Let's look at the components that are needed for this project.
Capacitor - 1 Bipolar 0.22uF, 2KV.
Resistor - 1 470Kohm and 1 470ohm.
LED - 4 of them.


Diagram:






How does it work?

As you can see a very simple diagram, to keep the components count low the bridge rectification is done by the LED themselves which allows us to omit the general purpose diodes that would have been used in this regard.

The load here is just shorted so the light emitting diodes just light up when you put the mains in. The 470 ohm resistor is there for limiting the current and the 470Kohm will drain any charge left in the capacitor after usage.

Drawbacks:

1. Power factor will not be good as for any other capacitive dropper circuit.
2. There might be flicker.
3. Stray electricity might keep the LED lightly lit even when the switch is not on.
4. This circuit is not mains isolated which means it can't be touched while in operation due to shock hazard.

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.

Pros: 

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.

Cons:

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.

Links:

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 don't worry this method works. So why should anyone use Raspberry Pi as their torrent box? If you think about it a Raspberry Pi consumes very little power so it is very easy to keep it running for long time instead of keeping a full PC 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 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.


Procedure:

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

a. 

"rpc-authentication-required": false

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




b. 

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

This will allow us to use the transmission web based interface with all computers on the network(including localhost) 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. I will post in a link how to do that in your Router at the end of the post. 




c. 

"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

192.168.0.100:9091


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.


Note:

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





Resources: 

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.

Procedure:

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

scrot


 4. You can also use a small timer that will allow you to take the screenshot after certain amount of time. To do so you have to type

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



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


Resources:

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.

Procedure:

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

speedtest-cli




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)


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.


Note:

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.


Resources:

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