Friday, 30 June 2017
Spinning electrons open the door to future hybrid electronics
Raspberry Pi – Basic Setup without Monitor and Keyboard (Headless Setup)
Introduction
In this tutorial/project, we will see how to setup the Raspberry Pi without monitor and keyboard. This type of setup is often called as Headless Setup of Raspberry Pi. Before going in to the details of the basic setup, let us take a brief look at the high performance single board computer – The Raspberry Pi.
Raspberry Pi is small pocket sized computer developed by the Raspberry Pi Foundation of the United Kingdom. Although the main reason for developing the Raspberry Pi series was to teach the basics of computer science and programming to the school students, the Raspberry Pi has reached in to a wider range of user like makers, hobbyists, electronics enthusiasts and even in the field of robotics.
As of March 2017, more than 12.5 Million Raspberry Pi Computers have been sold.
Over the years, Raspberry Pi Foundation has released several versions of Raspberry Pi boards and the current version is the Raspberry Pi 3 Model B. It comes with loads of features like:
- A 64 – bit Quad Core ARMv8 Processor clocked at 1.2GHz (BCM2387).
- On – board WLAN (Wi-Fi) and Bluetooth (BLE)
- USB 2.0 Ports (4 of them)
- Ethernet Port
- GPIO Pins
- HDMI and Composite Video and many other features
From the brief list of features, it is clear that Raspberry Pi board comes with a great on – board hardware and options to connect different types of external modules like cameras, displays, keyboard, etc.
The main issue is that, when we buy this $35 small computer, all we get is the board and we need to connect it to a monitor or TV through HDMI and a keyboard or mouse through USB in order to make use of its potential.
But there is a way to get started with Raspberry Pi without monitor and keyboard. As mentioned already, this type of setup is called headless setup of Raspberry Pi.
In this project, I’ll take you through a step – by – step process of installing the newest version of the Raspbian OS (Raspbian Jesse) on Raspberry Pi without connecting it to a monitor or keyboard (well, technically, we need a computer to make this happen).
Hardware needed for Headless setup of Raspberry Pi
First, let us gather all the hardware components required for the setup. In order to setup the Raspberry Pi, we need the following components.
- A Computer with Internet connection (Laptop or Desktop)
- Raspberry Pi 3
- 5V – 2A Power Supply (Recommended by the Raspberry Pi) with microUSB connector
- MicroSD Card (minimum 8GB)
- SD Card Adapter (USB type or standard SD Adapter)
- Ethernet Cable (in addition to the one used for computer)
- Access to the internet router (if no access, do not worry, we have an alternative)
I’ll be explaining the setup process using a Windows PC. The steps will be similar in Mac as well (with slight variations like terminal in Mac and Putty in Windows, for example). For powering the Raspberry Pi, I’ve used a 5V – 2A Mobile Charging Adapter with microUSB connector.
Getting started with the Headless Setup of Raspberry Pi
Formatting the microSD Card
First, we need to properly format the microSD Card, on which we are going to install the operating system for the Raspberry Pi. For this, I’ve used the official SD Card Formatter tool from this website
Download the SD Card Formatter Software and install it. Insert the microSD card into the adapter and plug the adapter into the USB port of the computer. Some adapters will be of microSD to Standard SD and they must be inserted into a dedicated SD Card slot.
Open the SD Card Formatter tool and select the correct drive which we need to format. After that, go to options and set the FORMAT SIZE ADJUSTMENT to ON. Then format the microSD Card.
Downloading the Operating System
Now, we need to download the operating system for our Raspberry Pi. I’ve used the Raspberry Pi Foundation’s official operating system – Raspbian. It can be downloaded from this page
If you observe, there are two variants of the Raspbian OS: Raspbian Jessie with Pixel and Raspbian Jessie Lite. I’ve used the Raspbian Jessie with Pixel as it has a Graphical user Interface (GUI).
After downloading the OS (it will be downloaded in zip format), unzip the contents to a folder. You can find the operating system file with extension .img (image file).
Writing the Raspbian OS to microSD Card
We need to write this OS on to the microSD card. For this I’ll be using the Win32 Disk Imager software. It is a free software that you can use to write image file (.img) on to USB drives or SD Cards.
It can be downloaded from here and install it on your computer.
Open the Win32 Disk Imager software and first select the correct drive letter of the microSD Card (assuming the microSD card is already inserted and formatted). Then select the Raspbian Jessie image file (.img), which we have downloaded and unzipped in to a folder, by clicking on the folder icon.
Then you can click on the Write button on the Win32 Disk Imager. The size of the Raspbian Jessie image file will be around 4GB and hence depending on the write speed of the microSD card, it will take anywhere between 1 to 10 minutes to complete the writing of the image file.
Enabling SSH (Secure Shell)
In the recent Raspbian Operating Systems, the SSH Server is disabled by default. If you are using your Raspberry Pi with a monitor and a keyboard, we can enable the SSH with the help of Raspberry Pi Configuration Settings in the Preferences menu or using the terminal window.
Since we are setting up the raspberry pi without monitor and keyboard (i.e. the headless way), we do not have access to the terminal yet.
There is an alternative way to enable the SSH Server. After you are done with writing the Raspbian OS on to the microSD Card, open the SD Card and create a file with name “SSH” and no extensions in the boot partition of the microSD Card.
First, open the microSD Card and select the Organize option on the top left corner.
Then click on Folder and Search Options. Go to View tab and uncheck the “Hide extensions for known file types” option.
Then, right click on the empty space and create a New Text Document.
Delete the name “New Text Document” and also the extension “.txt”. Then enter “SSH” without any extension. You will get a warning message, just click on Yes. The SSH file is created.
NOTE: When we boot the Raspberry Pi, it looks for the SSH file and since we created it, the Raspberry Pi will enable the SSH and then deletes the file.
Now, you can insert the microSD Card in to the slot on the Raspberry Pi. Before powering it up, we need two more tool to continue with the setup.
Since we don’t have access to the command prompt of the Raspberry Pi yet, we need a tool called Putty, which acts as a remote SSH Server so that we can access the Raspberry Pi’s command prompt from a remote computer.
Putty can be downloaded from this link
Another software we are going to need is the Advanced IP Scanner. This tool will scan for the devices connected to a router and displays the corresponding IP Addresses.
We need the IP Address of the Raspberry Pi. So, download the Advanced IP Scanner from here . There is no need to install as there is a portable version which can be run directly from the downloaded file.
Booting up the Raspberry Pi
After we have done all the above steps, we are now ready to boot the Raspberry Pi. Before turning on the power, make sure that the Raspberry Pi is connected to the internet through an Ethernet cable. After plugging in the Ethernet cable and the micro USB cable in to the Raspberry Pi, turn on its power supply.
First thing we need to do is get the IP Address of the Raspberry Pi. Open the Advanced IP Scanner tool which we just downloaded and select the Run option. After the tool opens up, click on the Scan option.
The tool then lists out all the devices connected to the router along with their IP Addresses. In our case the IP Address of our Raspberry Pi is 192.168.1.3. Note down this IP Address.
Then, open Putty and enter the IP Address of the Raspberry Pi in the Host Name (or IP Address) field. The rest of the fields like Port 22 and Connection Type as SSH are unchanged.
Click on Open and if everything goes well, we will get a warning message from Putty about the SSH Server.
Just click on Yes. If the SSH connection is successful, you will get the Raspberry Pi’s Login Page.
If this is the first time you are using your Raspberry Pi or haven’t changed the default password, enter the default username as pi and when you hit enter, you need to enter the password which is raspberry.
Username – pi
Password – raspberry
NOTE: When you enter the password, there will just be a blank space and nothing gets printed on the screen. Do not worry. Just enter the correct password and hit enter.
You are now successfully logged in to the Raspberry Pi through SSH.
If you want to configure your Raspberry Pi like changing username, password etc., type sudo raspi-config on the terminal and hit enter. You will now enter in to the Configuration Settings of your Raspberry Pi.
Accessing the Desktop of Raspberry Pi using VNC
We will continue with the setup by accessing the desktop of Raspberry Pi on the computer we are using. For this we need a VNC (Virtual Network Computing) software like RealVNC. The RealVNC Viewer can be downloaded from here
Now, we need to setup the VNC option in our Raspberry Pi. For this first let us update the operating system of the Raspberry Pi by entering sudo apt-get update on the Putty terminal.
This command will check for any updates and if there are any, it will download and update.
After this, we need to install the VNC Server and VNC Viewer on the Raspberry Pi. For this we need to enter sudo apt-get install realvnc-vnc-server realvnc-vnc-viewer on the Putty.
This command will install the VNC Server and VNC Viewer on the Raspberry Pi.
After installing, we need to enable the VNC Server of the Raspberry Pi from the configuration settings. So, enter sudo raspi-config on the Putty.
Select Interfacing Options and select VNC from the list.
Enable the VNC by selecting YES option. You will get a confirmation message that VNC is enabled.
If you want to change the resolution of your display, you can probably change it now by going in to Advanced Options in the Configuration Settings and selecting Resolution.
You will get a list of possible resolutions and in our case, the laptop supports a maximum resolution of 1366 x 768. So, I have selected 1280 x 720. You will once again get a confirmation message saying the display resolution has been changed.
Go back to main window of the Configuration Settings and select Finish. It will ask you to reboot. Click on Yes. Your Raspberry Pi will now reboot.
NOTE: Putty will lose connection with Raspberry Pi after reboot. If you want to use Putty, close it and open it again.
Now, that we have enabled VNC and changed the display resolution of the Raspberry Pi, we are now ready to begin our final step. Open the VNC Viewer which we have downloaded earlier and enter the IP Address of the Raspberry Pi in the address bar and click enter.
You will get a warning message from VNC Viewer and just click on Continue. Then the VNC Viewer asks for the username and password. If you haven’t changed them using the Raspberry Pi’s configuration settings earlier then enter username as pi and password as raspberry.
Tada!!! You have now access to the Raspberry Pi’s Desktop.
The post Raspberry Pi – Basic Setup without Monitor and Keyboard (Headless Setup) appeared first on Electronics Hub.
Thursday, 29 June 2017
Vortex-antivortex pairs found in magnetic trilayers
Laser Security System
Laser based Security System is a type of security and alarm system that uses laser light and a light sensor. A security system protects our homes, offices, banks, lockers etc. from intrusion and unauthorised access. There are different types of security systems available and laser based security system is an important and efficient type.
A Laser security system can acts as a standalone system, which makes some sound or noise when it detects any irregular activity, or can be part of a much bigger security and home automation system, which can send messages, call the owner etc.
In this project, we have designed a simple DIY lased based security system, which acts as a tripwire like security system and triggers an alarm when the laser in interrupted.
WARNING: We have used a laser pointer in this project. Direct exposure of laser light on eyes can be very dangerous. Even though it is a low power laser, avoid direct eye exposure of laser.
Circuit Diagram
Components Required
- LM358 (Op – Amp IC)
- NE555 (Timer IC)
- LDR
- 3 x 10 KΩ Resistors (1/4 Watt)
- 220 Ω Resistors (1/4 Watt)
- 10 KΩ Potentiometer
- BC547 (NPN Transistor)
- Small Buzzer
- 100 nF Capacitor (Ceramic Disc Type Capacitor – Code 104)
- Push Button
- Laser Pointer
- 9V Battery
- Connecting Wires
- Breadboard (Prototyping board)
Component Description
Laser Pointer
Laser Pointer acts as the main source of light in this project. We have used a small laser pointer with an output power of less than 1mW. The laser pointer emits red light and the wavelength of the laser output is between 630 nm to 680 nm.
LDR (Light Dependent Resistor)
The LDR acts as a light sensor in this project. As the intensity of the light falling on the LDR increases, the resistance of the LDR decreases and vice – versa. The LDR is used in combination with the laser to form the light sensor and source.
NE555 (IC 555)
IC 555 is a precision timing IC that provides time delays or oscillations. 555 Timer IC has three modes of operation: Astable, Monostable and Bi-stable. In this project, we are going to use the IC 555 in Bi-stable mode.
LM358 (OP – Amp)
LM358 is a dual Operational Amplifier IC and it is capable of operating in all the conventional operational amplifier circuits. In this project, the LM358 is used as a Comparator.
Circuit Design
The design of the laser security system circuit is very simple. We will see the design of the circuit in this section and in the working explanation we will see the working of the individual component.
Coming to the design of the circuit, first, the LDR and a 10 K Ω resistor are connected in a voltage divider fashion and its output (common point) is connected to the pin 3 (non – inverting) of the Op- Amp IC LM358.
For the inverting terminal (pin 2), connect the wiper of a 10 KΩ potentiometer (other two terminal of the POT are connected to VCC and GND).
The output of the Op – Amp (Pin 1) is connected to the base of the transistor (BC547) through a resistor.
The trigger pin of 555 (Pin 2) is pulled high using a 10 KΩ resistor.
The reset pin (pin 4) of the 555 is connected to VCC through a 10 KΩ resistor and a push button is connected between Pin 4 of 555 and GND. A bypass capacitor of 100 nF is connected between pins 5 and GND. A buzzer is connected to pin 3 of 555 IC.
Rest of the connection are shown in the circuit diagram.
Working of the Project
A simple, cheap and effective laser based security system is developed in this project. Let us see the working of this project.
First, the Op – Amp circuit acts as a comparator i.e. it compares the voltages at the inverting and non – inverting terminals and produces an output accordingly.
The LDR – 10 KΩ resistor Voltage divider is connected to the non – inverting terminal of Op –Amp and a POT is connected to the inverting terminal.
Assume, the laser pointer is placed directly in line of sight to the LDR and the light from the laser is continuously being incident on LDR.
In this situation, the resistance of LDR falls down to few Ohms (or tens of Ohms) and as a result, the voltage at the non – inverting terminal will be less than that at the inverting voltage. The output of the Op –Amp is low and the transistor is OFF.
If the laser light is blocked by an intruder from falling on the LDR (even for a small duration), the resistance of the LDR goes to few hundreds of Ohms and as a result, the output of the Op –Amp will be HIGH. This will turn on the Transistor.
As the output of the transistor is connected to the Trigger Pin (Pin 2) of the 555 Timer IC, if the transistor is ON, the trigger pin gets a short low pulse and as a result, the output of the 555 becomes HIGH. This will activate the alarm by turning ON the buzzer.
Since, the 555 Timer IC is configured as a Bi – Stable Multivibrator, a small active low trigger pulse at the trigger pin will set its output to HIGH and in order to reset it we need to push the reset button.
Until the reset push button is pushed, the alarm will stay on hence, we can place the reset button at a secret location so that only the owner can disable the alarm.
Advantages
- The circuit, construction and setup for the Laser Security System is very simple.
- If used with a battery, the laser security system can work even when there is a power outage.
Disadvantages
- The laser security system works only if the laser is obstructed. If the intruder passes without obstructing the laser, it is considered as a failure.
- In order to secure a larger area, we need more lasers and corresponding sensors.
Applications
- Laser Security System can be used in safety lockers in our homes, where even if the locker’s code is hacked, it acts as an additional layer of security.
- Apart from security systems, this laser based setup can also be used to check if pets or babies crossed a certain boundary.
The post Laser Security System appeared first on Electronics Hub.
Wednesday, 28 June 2017
Graphene and terahertz waves could lead the way to future communication
Rectifier Diode Circuit Working And Its Applications
Diodes are widely used semiconductor device. A rectifier diode is a two-lead semiconductor that allows current to pass in only one direction. Generally, P-N junction Diode is formed by joining together n-type and p-type semiconductor materials. The P-type side is called the anode and the n-type side is called the cathode. Many types of diodes […]
The post Rectifier Diode Circuit Working And Its Applications appeared first on ElProCus - Electronic Projects for Engineering Students.
Tuesday, 27 June 2017
Arduino Controlled Power Outlet
A power outlet allows electrical equipment and appliances to get connected to AC power. Arduino can be used to control this power outlet in order to turn the electrical equipment or appliance in to a smart device. Normally, we plug in different appliances or electrical devices in to the wall socket and turn them ON or OFF with the help of associated switches on the wall.
In this project, we have used Arduino to control a Power Outlet so that it can be controlled with the help of a sensor or remote switch. We have designed a Power Outlet box with one plug and a switch that is connected to a relay module, which is controlled by the Arduino. For triggering the relay, we have used an LDR light sensor.
Alternatively, the Power Outlet can be made to work with Bluetooth, over the internet with Wi-Fi Module (ESP8266) or any other type of sensor.
WARNING: We are going to connect 230V AC to the Power Outlet Box and the 5V Relay Module. It is very dangerous and you should be very careful while making the connections. Make sure that nothing is plugged in while connecting and switch on the supply only after double checking the connections.
Circuit Diagram
Component Required
- Arduino UNO
- 5V Relay Module
- ON – OFF Switch
- A Power Outlet (Plug or Socket)
- LDR (Light Dependent Resistor)
- 10 KΩ Resistor (1/4 Watt)
- Power Supply
- Connecting Wires
If Relay Module is not used, then we need the following components
- 5V Relay
- BC547 (NPN Transistor)
- 1N4007 PN Junction Diode
- 1 KΩ Resistor (1/4 Watt)
Component Description
Power Outlet and Switch
We have used a single power outlet box with control switch. This particular socket is rated for 250V and 6A. So, any electrical device with power consumption up to 1200W (just to be on the safe side) can be easily used with this outlet.
5V Relay Module
The 5V Relay Module is an important component of this project. It runs on 5V and hence, can be powered using the Arduino itself. This particular module consists of a 5V Relay, a transistor, a Zener Diode, an Optocoupler IC, couple of LEDs, corresponding current limiting resistors, screw terminals and few male headers for connecting power and other inputs.
The circuit diagram of the 5V Relay Module is shown in the following image. From the circuit, it is clear that the 5V Relay Module is an active LOW module i.e. a logic ‘0’ from Arduino will turn ON the relay and vice – versa.
LDR (Light Dependent Resistor)
An LDR (Light Dependent Resistor) is used to sense the light falling on it and accordingly vary the output voltage. This voltage is read by the Arduino and will trigger the Relay.
Circuit Design
The design of the circuit is clearly expressed in the circuit diagram. We will see a detailed explanation of the circuit here. First, an LDR and a 10 KΩ Resistor are connected to form a voltage divider and the output of the divider i.e. the connections midpoint is connected to analog input pin A0.
Coming to the relay, the 5V and GND pins for the relay module are given from the Arduino UNO. The control pin for the relay is connected to the pin 8 of Arduino.
Finally, the power outlet box. We need to open the box and make connections. First connect neutral wire from the supply to neutral connector on the socket. Connect the other connector on the socket to one end of the switch (bottom terminal) and also to the NO (Normally Open) contact of the Relay.
The second terminal of the switch (top terminal) is connected to the Line (Hot) wire from the supply and also to the COMM (Common) terminal of the Relay.
CAUTION: Be very careful when using AC Mains lines. It is very dangerous and could kill you.
Working of the Project
A Power Outlet box that is controlled using Arduino is designed here. The working of the project is pretty straight forward and is explained here.
The connection between the Arduino and the power outlet is made through a 5V Relay Module. The switch provided on the power outlet box can be normally used to turn ON or OFF the appliance plugged in to the socket.
Since the Relay is also connected to the Socket, we can control the appliance with the relay as well. To make the project a little bit interesting, we have used a simple light sensor in the form of an LDR (Light Dependent Resistor) to trigger the relay.
Arduino will continuously monitor the readings from the LDR and when there is no light falling on the LDR (darker conditions), the Relay is activated and hence the appliance or device connected to the power outlet box will also be turned.
When the intensity of the light falling on the LDR increases, the relay will be deactivated and appliance will be turned OFF. For demonstration purpose, we have connected a 27 Watt CFL light to the power outlet.
An Interesting Observation
If you observe from the circuit diagram, the switch on the power outlet box and the relay terminals are connected in parallel forming a circuit similar to the following image.
From the above circuit, either of the switches can be used to control the light and if one is active, the other switch is automatically doesn’t have a chance to control the appliance as this is not a Stairway Switch connection.
Applications
- The Arduino Controlled Power Outlet can turn any electrical device into a smart appliance.
- We have used a light sensor in the form of LDR to control the power outlet, but there are many other ways to control it like mobile phone, internet etc.
- Arduino Controlled Power Outlet can be used in special applications like sensing the water level and automatically turning the motor, turning on a fan when the temperature increases etc.
The post Arduino Controlled Power Outlet appeared first on Electronics Hub.
Tiny, wireless antennas use light to monitor cellular communication
Researchers developed a biosensing technique that eliminates the need for wires. Instead, tiny, wireless antennas use light to detect minute...
-
In this project, we will learn about the MCP2515 CAN Controller Module, how to interface the MCP2515 CAN Bus Controller with Arduino and fin...
-
Interfacing DC motor to the microcontroller is a very important concept in many industrial and robotic applications. By interfacing DC motor...
-
Do you need a MOSFET gate resistor? What value should it be? And should it go before or after the pulldown resistor? If you’re a bit impati...