Friday, June 10, 2016

Getting Started with Hobby Electronics - 1

Good afternoon everyone, I was planning to write this post for a very long time now, but didn't quite got my thoughts together to compile this so let me try another time. I will be writing this as a series and first one obviously is the introduction.

To whom this post might concern:

1. Someone who is trying to get into hobby electronics.
2. Someone who is already into it but not sure what to do.
3. Someone who is facing difficulty.
4. Just to get the idea what it is all about.

Why? 

Well, this probably is the most common question that we get is why do you need to be an electronic hobbyist? The simple answer is, it is a hobby, I don't need a reason to have this hobby, simple. Although it is pretty much the same as any other hobby but it might be somewhat beneficial in your day to day life too. Electronics hobbyists usually don't have to rely on electricians for normal day to day needs regarding electrical equipment and stuffs. An electronic hobbyist can many of his/her domestic problems associated with electrical or electronic items just fine. So it is obvious that hobby electronics is a pretty fun thing to do and also very useful.

I do understand that hobby is a thing that we do to distract ourselves from the normal monotonous work that we do so often times we don't worry about the gains from hobbies and it should be this way but almost every hobby that I know will help you with something. If you collect stamp it is pretty sure that you know something about many countries that other people do not know about. This knowledge pretty much comes free and it might help you one day, same thing applies for electronics hobby too. It will help you in many ways but that is not the primary purpose.

How about some more examples?

I probably can think of thousands upon thousands of examples of how this hobby can help you in your day to day life but let's just start with some normal examples.

1. Say your 2 years old router is not working, none of the indicator lights are glowing but you need internet very badly, what can you do? Well you are in luck if your hobby is electronics, measure the output voltage of the adapter of the router. Probably it has died so not putting anything on the output lead. Okay so probably the problem is identified, now you can look closely at the adapter or router it should say the working voltage of it. Assume 9V 0.6A which is very common. Now with your skill and simple components like the 7809 regulator you can make a power supply under 10 minutes and you are good to go to run the router again.

2. Your phone needs charging but no electricity, although you have a sealed lead acid battery and couple other components. What can you do? Well make a simple circuit that puts out 5V from the input 12V, maybe a 2576 regulator based circuit and done, charge your phone with that! You need to charge your lead acid battery? No problem you can do that later too maybe with a 317 integrated circuit and some other components!

3. How about some automation? A remote control to turn on your lights or fans? Sounds good right and you can make that happen with some development board too, not that complicated either!

4. Ceiling fan running slow? Chances are the capacitor has gone bad, replace it, if you are a hobbyist it will be a very simple thing to do, no need to call for assistance of other people and it might take only 3-4 minutes.

5. Need to change blown fuses? Depleted batteries? Damaged lamps? Well you can do any of them with relative ease. Someone who doesn't have this hobby can do it too so it will be even easier for you.

6. How about building a small Network attached storage that will download and store your favorite series which you can watch from any device you want? Well you are in luck, you can use any small single board computer to do this.

7. How about making a small amplifier? You can use either Bluetooth or standard wire with it to get the audio from the source!

You can think of infinite number of examples too but I will just stop here and hope that my point has gone across. Proper tools and necessary knowledge can make your life a lot easier and we regularly face this issues so no harm knowing I guess.

One thing to keep in mind though yes you can buy these stuffs or service but the main thing is the fun, making something brings a lot of pleasure and this pleasure will be multiplied when you will see the things that you make are working properly and helping you with something!

That is pretty much what I wanted to say as introduction, I hope I have got your attention so in the next couple posts I will be focusing on:

1. The hardware that is needed, both mandatory and optional.
2. Some circuit theories that might be helpful.
3. Conclusion.

Resource:

1. Index page of my blog!



Friday, June 3, 2016

Tight VNC Server On Raspberry Pi

Good morning everyone so according to my plan I was experimenting with the Raspberry Pi and trying to document as much as possible but the process is still pretty slow but here is a small bit of that. So we know Raspberry Pi is a single board computer that has its own Video output but what if you don't want to use it and you are not happy with the SSH either then a virtual network computing might come handy. So this post is about how you can set up VNC and use it on raspberry pi. 


First of all what do we need?

1. The obvious one which is a Raspberry Pi, I'm using the Pi 2 model B. 





2. Next we need something to power up the Pi. I'm using my good old phone adapter from Asus. You can use whatever you have on hand but make sure it is from a reputable brand.



3. You need to connect the Pi to the network where the other system is connected in order to make this happen. Probably you can connect a Pi directly with your system and it will still work but it is much convenient to use a router or something. I'm just using my home router to connect with both my computer and Pi 2 via Ethernet cable. You can use wired or wireless network, no problem.


4. We need some software like Putty and Tight VNC for the computer which I will get more into in procedure section. These software are free and download links will be on the resource section.

So let's begin!


First let's talk about the connection.

I'm guessing you are running the latest version of Raspbian. So just plug in the network wire and power it up. In case of Wireless, make sure to connect to the network that you will be using and done.


Procedure:

1. Make sure your computer is also connected to the same network and get the IP address of your Pi. To do this you can check the router's client list. In my case it is 192.168.0.103. 




One important Tip here, if you have to frequently use SSH to login and you need the IP often and you don't want to turn off the DHCP of your router then what you can do is reserve the IP address against that MAC address. This way your Pi(or any other device) will always have the same IP as long as that MAC address matches.

There is another easy way however, just type ifconfig directly on the Terminal of Raspbian or via Putty and you will get the IP address. (Although if you already have the IP to connect via Putty why would you need the IP one more time right?)

 



As I'm using Pi 2, I only have the wired Ethernet, if you use Pi 3 or an USB Wi-Fi dongle you might get one more option of eth1 and make sure you use the proper IP. 

2. Now that we have the IP address we will move on to Putty and login.

Default User : pi 
Default Password: raspberry



Okay so we are in!

3. Make sure your Pi is fully updated, if not type in the following commands and update the pi.

sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade

Now when the upgrade process is finished let's start installing the VNC server. To do so type in

sudo apt-get install tightvncserver



So mine was already installed and updated. For you just install it.

4. Now to enter the password type in tightvncserver and hit enter.



It is nothing that complicated either, for the first time you need a password that viewer computer has to put in to see. I keep it at default raspberry.

5. Now let's start a full high definition session on display 1. Remember when your Pi boots up it has already started a display at display 0, so you have to use display 1. To do so type in

vncserver :1 -geometry 1920x1080 -depth 24



You can probably use 32bit depth but I tried using it and didn't work so 24bit is fine. 


6. Now download and install tight VNC viewer on your computer and launch it. 




Important thing to remember is the :1 part, if your pi starts broadcasting at display 2, you have to use :2 for that. Anyway after launching Tight VNC viewer, type in the IP with display number and hit enter. Next enter the password that you set up earlier. Click okay and done, now you should view through the network and work on it. Let me show you an example.



So that's pretty much how you can set the whole thing up. There are much to it actually like turning off the display at 0 because remember display 1 and display 0 are not showing the same thing. You can also set up tight vnc server to start at the boot, the way that I have shown will require you to start each time you boot up the pi.

Anyway that's pretty much it, let me add the useful links down below.


Resources: 


Good luck and happy experimenting!