Thursday, December 20, 2018

Remote Controlled Home Appliance

Parts Required:

1. Arduino, I'm using an Uno for this project.
2. Relay board, I'm using a four channel board to control four devices.
3. Infrared sensor.
4. Standard Television Remote Controller.


Friday, December 7, 2018

Make Speaker/Headphone Bluetooth Capable

Bluetooth capability on your speaker or having a Bluetooth headphone might come in handy in many scenarios and if you are a person like who generally uses Wired headphone or speakers it is normal not to have a Bluetooth capable one. Moreover if you have like an old system that is really good but lacks this modern option you can very easily add that option.

Bluetooth Audio Receiver.

To make this project possible we will be needing a very simple and inexpensive device. This particular device comes in many different quality, price and form factor. Here is one for example.


It pretty much looks like a USB Bluetooth dongle or a Mass storage device but it is nothing of that sort. This is a Bluetooth audio receiver, what it does is connects with your phone/computer via Bluetooth and puts out the audio on that 3.5mm jack you see, That cap is hiding an USB port that is used to power up this device.

The small hole that you see behind the Bluetooth logo can have a microphone or a status LED. Some of these receivers have built in Rechargeable Lithium cell to use without plugging in a stationary power supply.

How to set up?

To use it with a speaker all you need is to put one end of a 3.5mm jack to this Receiver and other end(whether 3.5mm/RCA) to your speaker. Put some power on it and voila, setup is done. Now if you navigate to your Bluetooth settings in your Computer/Phone you should be able to see this particular device.

If you want to use a wired headphone with this device you can do that too, just put the 3.5mm TRRS jack of your headphone in it and power up the receiver if needed and again you are good to go.

In this specific example I'm using a small Power Bank to power it up and it takes a very small amount of power, with a 1000mAh capacity you should be able to run such a device for 1000 hours or so.

Note:

1. Some cheaper ones that I tried didn't have the best audio quality, they are often noisy and have an weird ringing sound to it.
2. High quality ones are pretty good, as good as Bluetooth can be which in most cases not as good as wired setup.
3. When using a power supply with it, even though it burns very little power, use a good quality one because low quality ones might introduce even more noise.(Maybe make a small linear regulator?)



Monday, December 3, 2018

Simple Electret Microphone Amplifier

What if you are working on a project that has to pick up audio using an Electret Microphone and couldn't get a powerful signal? Here is a simple solution, a single Transistor amplifier for Electret Microphone.

Components Needed:

2 10KΩ 1/4W Resistor
1 100KΩ 1/4W Resistor
2 0.1µF Capacitor
1 2N3904 Transistor 
1 Electret Microphone
9V Supply

Diagram:

  
Note: 

Output can be taken from the output pin and ground pin.

Can be operated on 3V-9V. 

 

DIY PoE Injector

PoE or Power over Ethernet is simply a way to put Power and Data on the same Twisted Pair Network Cable(E.g. CAT6) so that external power source is not required. This is extremely handy when Cameras and Wireless AP are scattered over a place and difficult to run another power cable to them. To use PoE both device has to be PoE capable but what if you have a PoE supported Camera or AP but not a PoE supported Switch? You can simply use a PoE injector or make one yourself. Now this is not going to be as good as a well made say Maxim chip based PoE injector but it should get the job done.

Component List:

3 4.7kΩ 1/4W Resistors
2 0.1µF Capacitor
1 330µF 100V Electrolytic Capacitor
1 Green LED as indicator
1 58V Zener Diode
2 RJ45 Female Jack
48V DC Power Source

Use:

This can be used for DIY projects where 48V PoE is required on 10/100M connection.

Diagram:


Description:

This simply puts 48V on the unused pins of Ethernet cable, works on 802.3af 10/100 Mode B. If your source can provide about 400-500mA on 48V you should be able to get about 15W of DC power on the other end which is enough for running a camera or a Wireless AP.

Note:

Be very careful with polarity.

Sunday, December 2, 2018

USB Power Injector 5V-12V Variant


USB Power Injector 5V Variant

What can you do if you don't have a Powered USB Hub and you need to power a device that needs more than your standard USB can provide? Here is a quick solution.

Components:

1. A pair of USB Male and Female jack, good quality one that can actually carry a good amount of current without dropping significant voltage.
2. 5V Relay.
3. 1N4007 diode.
4. 1kΩ 1/4W Resistor.
5. 100µF 16V Electrolytic Capacitor.
6. An external power supply, 5V 3A or whatever you need.

Optional:

7. LED and 470Ω Resistor if you need an indicator.

Purpose:

This will not pull much power from your host device so if you need a high powered device say a Hard disk drive to run on a single board computer you can use this diagram. This will omit the necessity of buying a powered USB Hub.



Diagram:






How it works: 

In the diagram USB 1 is the USB male jack that will connect to your host device, say a Single board computer. USB 2 is a Female jack where you can connect your USB hard drive which will be powered by the external power injector from P1 where you can use any 5V supply of your choice, but be very careful about the polarity. 

When USB 1 is unplugged, transistor Q1 stays off, so the relay will stay off as well and there will be no power on the USB2 jack even if the power is available at P1. As soon as the USB1 is plugged in a host transistor Q1 will start conducting as now it has base current provided by the host which will turn on the Relay thus providing power to the USB2 jack from the external power source.

LED will glow when power is available at USB2 jack. 


Note:

Be very careful about polarity as reversing it might destroy your USB device. 

C1 is optional, although if this circuit is kind of far from your power supply add another 0.1µF capacitor in parallel with C1 to reduce noise.

You can also add another 470µF capacitor after the Relay to minimize the impact of contact bounce. Just connect it between #2 pin of Relay and Ground, observing proper polarity.

Use a good quality power supply as the external source.



 

Tuesday, November 20, 2018

555 LED Blinker

It is possible to write a whole book on 555 Timer IC and people have done it too. Here is a very simple thing that can be done with this chip, a very simple two LED blinker.

Diagram:

Note:

From the circuit it is very simple to get the idea which parts to be used.

R1, R2 and C2 determines the speed of blinking.

Can be easily powered by a single 9V PP3 battery.

555 is a very common and versatile chip so learning about it can help hobbyist a lot.

Omitting one LED and the corresponding resistor will simply make it a single LED blinker.

Tuesday, September 25, 2018

Confusing Tech - USB Standard


Confusing Tech - Fast Charging


Confusing Tech - WiFi Standard

Now we live in a world where we have to use internet everyday and to do so many of us rely on Wi-Fi. Even if my desktop is not connected via wireless means my many other devices are. As time goes by improvements in this field has made it kind of confusing. So I am hoping to clear some up with this post. Note that I will be very brief here because otherwise this post will become extremely long and boring.

So what is Wi-Fi? 

Wi-Fi is a technology for radio wireless local area networking. It is like it's wired counterpart acts as a medium to get your device networked but unlike using wire it simply uses radio link. In simplest term Wi-Fi enabled devices can connect to a Wireless Access Point and provide Internet(or local network whatever the case may be).

What is what?

If we look at the market we will see many devices have many different specification regarding Wi-Fi. Wi-Fi n, Wi-Fi ac, Dual Band Wi-Fi and so on. So let's put them in lists and see what we can get.

IEEE 802.11

This is a set of Media Access Control and Physical Layer specification for implementing Wireless network in difference frequency bands. Wi-Fi ac that you might see on some product specification is actually just 802.11ac which specifies many aspects of that particular technology. I will list out some of the most common ones now to give you a better idea which came out when. Note that in the list very uncommon ones will be omitted.

802.11-1997 (Legacy)

This was pretty much the dawn of Wi-Fi, it worked at a whopping 1Mbps/2Mbps on 2.4GHz ISM band. Some used 900MHz as well.

802.11a OFDM
At 5.8GHz 802.11a solved the issue of crowded 2.4GHz space and could theoretically get up-to 54Mbps. But with higher frequency it lost some of its range. Currently devices still support this standard at 5GHz 54Mbps. Although real speed achievable was about 20Mbps. Which was a lot during 1999.

802.11b
It uses the same ISM 2.4GHz band like legacy Wi-Fi but raw data rate gone up to 11Mbps.

802.11g
This one also works on 2.4GHz but uses OFDM just like 802.11a. It has a maximum bit rate of 54Mbps and real world speed was around 20Mbps.
During this time Wi-Fi started to gain popularity and many devices came at that time supported 802.11a/b/g at both 2.4GHz/5GHz. However using such a device with older hardware say 802.11b will result in reduced throughput.

802.11n 
Probably the most used Wi-Fi standard now(when I am writing this post). It uses both 2.4GHz/5GHz and can get bit rate from 54Mbps to 600Mbps. However without using specialized hardware at both ends do not expect to get 600Mbps speed. From this time things started to get real murky with manufacturers claiming many things and throwing many different numbers at us the customers.

802.11ac
Another very popular network of this time. This was an improvement over the 802.11n using higher frequency 5GHz compared to more common 2.4GHz of n, wider channel, higher-order modulation and thus achieving 433Mbps per stream. Add couple streams together and you will get over gigabit theoretical speed. It also has features like Multi User Multi input multi output. Wi-Fi n only had the Multiple input Multiple output feature.
Vendors also released a so called 802.11ac Wave 2 devices that supports 160MHz channel as opposed to 80MHz of standard 802.11ac(note that n has 20 or 40MHz channel).
However ac has less range compared to n as it uses a higher frequency.

802.11ad
To make a short range high speed communication possible even higher frequency is being used, 60GHz. It drastically reduces the range from a house to maybe a room but improves the speed upto 7Gbps. You might find this type of products under the marketing name WiGig.


There are many more other standards but they are not that common so I will leave them for now.

Frequency:
So another thing we found is the frequency.We got

900MHz
2.4GHz
3.6GHz
5GHz
60GHz

2.4GHz and 5GHz being the most common ones. 2.4GHz is not as fast as 5GHz but it has more range, it is also a very crowded space so interference might be a problem for this frequency. Not as much for 5GHz which also has higher data transfer capability.



Confusions:

So there are a lot of confusion over many things now, specially with the Wi-Fi n and Wi-Fi ac. If a devices says it runs on 5GHz doesn't make it Wi-Fi ac. It can be Wi-Fi n 5GHz.

Another confusion can be with speed, we often see ridiculous speeds printed on devices like 1800Mbps or 3200Mbps, don't expect to get that on a single device. Modern routers often has the capability to work on both n and ac(and previous iterations as well but let's stick to n and ac) so what they usually do is add up all the numbers. If it can get up-to 300Mbps on Wi-Fi n and 867Mbps on Wi-Fi ac they will market it as 300+867 or 1167 or roughly 1200Mbps router. But if your devices is a single antenna Wi-Fi n you would probably get around 72.2Mbps-150Mbps from this router.

Antenna Matters

Both for n and ac number of antennas play a very important role.

For Wi-Fi n single antenna will give you anywhere between 54Mbps to 150Mbps. Add another antenna on both side you will get up-to 300Mbps, add another and get 450Mbps and so on. Although there is a limit at 600Mbps with four antennas in 40MHz mode.

Wi-Fi ac can get much better speed even with a single antenna, 433Mbps. Using 2 antennas will provide around 867Mbps.

The most important catch here for both this is that you need support on both ends. So to get Wi-Fi ac working at 867Mbps you need a router that has two antennas and a device that has two antennas, if one device is a single antenna one your speed will be down to 433Mbps. Same goes for n as well. To get 300Mbps you will be needing two antenna AP and two antenna device.

Some confusing terms:

MIMO

Multiple-input Multiple-output.
Using multiple transmit and receive antennas capacity can be increased with this technology. So with MIMO data can be transferred at a higher speed to any certain device.

MU-MIMO

Multi-user MIMO
This allows data to be transmitted to multiple user at a time improving the latency for all users. However it requires more signal processing.

Beamforming

This is a signal processing technique for directional signal transmission or reception. It can help with focusing more power to a certain device on a certain direction.






Monday, September 24, 2018

How to apply for MRP in Bangladesh

UNDER CONSTRUCTION


মেশিন রিডেবল পাসপোর্টের জন্য অনলাইনে আবেদন করাই সবচেয়ে সহজ। 

প্রথম ধাপঃ ব্যাংকে টাকা জমা দেওয়া। 

দ্বিতীয় ধাপঃ অনলাইনে আবেদনপত্র পূরণ করা।

তৃতীয় ধাপঃ আবেদনপত্রটি প্রিন্ট করা। 
মনে রাখা জরুরী উভয়পাতায় প্রিন্ট করতে হবে। সাদাকালো হলেও চলবে।
অন্তত দুইসেট প্রিন্ট করতে হবে।
ব্যাংকে জমা দেওয়ার রশিদ আঠা দিয়ে সংযুক্ত করতে হবে। 

চতুর্থ ধাপঃ ছবি এবং জাতীয় পরিচয়পত্রের কপি(যদি দেওয়া হয়) সত্যায়িত করা লাগবে। অন্য কোন সনাক্তকারী দলিলাদি সাথে থাকলে তাও সত্যায়িত করা লাগবে।
পরিচিত কোন গ্যাজেটেড অফিসার দ্বারা প্রত্যয়ন লিখা লাগবে এবং তাঁর জাতীয় পরিচয়পত্রের নম্বর দেওয়া লাগবে।

পঞ্চম ধাপঃ আঞ্চলিক পাসপোর্ট অফিসে গিয়ে লাইনে দাঁড়াতে হবে। ছবি তুলে ফেলার পরে আপাতত কাজ শেষ।

ষষ্ঠ ধাপঃ পরবর্তীতে পুলিশ এসে তথ্যাবলি নিশ্চিত করবে এবং এর পর পাসপোর্ট হাতে পাওয়ার অপেক্ষা শুধু।


Wednesday, August 29, 2018

Simple Delay Circuit

This will be a short brief post about a simple delay circuit using Capacitor and Transistor. It might not be very useful in real world scenarios but awesome for understanding some basic functionality.



Brief Description:

So this circuit will be a simple circuit that even when turned off it will stay on for couple seconds or so(depending on components). In a calling bell this circuit can be used where the bell will ring for couple more seconds even after releasing the momentary switch.

Diagram:

Component values are already on the diagram. Make sure to use a capacitor that has twice the voltage rating of supplied voltage. In this case 25V capacitor should be fine.

How it works?

Working of this circuit is very simple, when the momentary switch SW is pressed current flows from the power source to charge up the capacitor as well as provides current to turn on the Transistor via the base resistor. This in turn turns on the LED.

But when the SW is released the energy stored in the capacitor gets discharged via the transistor keeping it on for some more time and keeping the LED on for that time.

That LED can be swapped out for Relay and use this circuit for doing something else.Increasing the Capacitor value will increase the amount of time the circuit will stay alive after power being cut off.

Resources:

Visit my full blog.

Wednesday, August 8, 2018

Firefox on Raspbian.

This will be a very short post about installing Firefox on Raspberry Pi.


Procedure:

To install Firefox open up terminal and type in

sudo apt-get install firefox-esr





Resources:

1. Read my posts on RPi.
2. Visit my full Blog.


RPi NAS Drive Without Additional Storage

In one of my previous posts I have written about how you can share an USB drive on Network that is connected with a Raspberry Pi effectively making a Network Attached Storage. In this post I will show another way of making making a NAS, this time I will be sharing the SD card of the Pi. 

SD card is very cheap now so it is easy to get a good capacity one at a bargain and Raspbian Operating system doesn't take that much of a space. 8GB card is enough but people often use higher capacity ones, like in this project I will be using a 32GB card. For Raspbian only that is a waste of space. So let's use some of that storage to make it a NAS. Granted speed might become an issue here but for this project as I'm using a RPi 2 that has 100Mbps Network, even a 40MBps Read-20MBps write card will be fast enough to do the job. 

Hardware:

1. Raspberry Pi. I would suggest getting either RPi2 or RPi3.

2. Network with Internet access, wired network preferred.
3. Good Power Supply. I have got a 5V 2A for this project.
4. Reliable and Fast Micro SD card, I'm using a Samsung 32GB here.

Software: 

1. Working version of Raspbian.

In this case I will be using my desktop to SSH into the Pi, you can directly use the Raspbian OS if you so desire.

Procedure:

1. Make sure your OS on Pi is fully updated. To do so use 

sudo apt-get update 
sudo apt-get upgrade



2. Next We will install Samba, which is the piece of software needed to share file over the network.

sudo apt-get install samba samba-common-bin



3. Now we need a folder that will be shared across the network. But we need to make one that has a sticky bit(1) so that it does not get deleted by accident and we will also need read write execute(777) permission on that folder, so we need the 1777. This folder can be located in any where, in this case it is on the root file system.

sudo mkdir -m 1777 /share



4. Next stop configuring the samba share to make it visible on the network. to do so type in

sudo nano /etc/samba/smb.conf



At the very bottom of this configuration file we need to add

[share]
Comment = RPi NAS
Path = /share
Browseable = yes
Writable = yes
only guest = no
create mask = 0777
directory mask = 0777
Public = yes
Guest ok = yes




This will make sure that anyone on the network can view and execute what is on this share.

5. Now we need to add an user and put a password, you can use the default password if you want to but it won't be that secured, for personal usage on your personal network default password is fine. We need to type 

sudo smbpasswd -a Pi

Put the new password and user Pi will be added.



6. In the last step we will make sure that Samba starts running as soon as Pi turns on to do so we need to type 

sudo /etc/init.d/samba restart


7. Restart the Pi and see if you can find it on the network from other systems. I am happy to report that it works fine on both Android and Windows.



I'm getting around 10MBps speed on transfer, which is pretty much the maximum RPi 2 can get on Network so no complain there.

Wednesday, August 1, 2018

Capacitor Start vs Capacitor Run Motor


A Study on the Humble Table Fan

I was planning to write on split-phase and capacitor start/run motor for a very long time so I guess this will be a good starting point for that.

Let's start with a simple 3 Speed Table fan. The way this type of motors work is pretty interesting but simple enough. We can not make an induction motor that starts on a single phase(without any modification to the original 3 phase induction motor design). So if we need to run a motor on single phase we somehow need another phase, hence comes the split phase where we literally split the phase in two to get the motor started and running. I will write about split phase and capacitor start/run motor on a separate post so not getting into much details on that. 

So in a table fan motor we split the phase with a capacitor to get another phase which is powers the starting or the auxiliary winding. Simple enough but what what intrigued me is the speed control and how it is done. I looked for diagrams online before cracking open one and found out a diagram showing use of different length of primary Stator winding. Also another fact that the capacitors of these type of fans are dying like cockroaches this days. On a 220-240V supply line, a 400V rated capacitor won't last long. So one easy thing to do is measure the voltage across the capacitor, if this diagram is correct, no matter the speed it is running at, the capacitor should always see the same voltage(unless the primary winding voltage induces something on the starting winding or something) but apparently it was not the case.


So these are the findings, and the weird thing about this is the voltage across the capacitor. No wonder even 400V rated(which probably is like a 300V one) capacitors were going boom. This also confirms the whole thing is not as simple as the first diagram eluded to.


Friday, July 13, 2018

Incandescent vs Fluorescent vs LED


UNDER CONSTRUCTION


Estimated lifetime: For LED light you will often see ridiculous amount like 50,000 hours or so, but in reality those are not marketing gimmick. What manufacturers do is push more than normal current to produce a certain output power which reduces the lamp life significantly.