Sunday, March 26, 2017

Autostart python program at boot time in raspberry pi

 

  1.  Save your program which has to be execute  in boot time at   home/pi 
  2. Go to terminal box and enter the command 
     
    sudo nano /etc/rc.local
     
  3. Enter the program  name using following command. Be sure to leave the line exit 0 at the end,
     
    sudo python /home/pi/your_program_name.py 
     
    For example  
    
    https://32414320wji53mwwch1u68ce-wpengine.netdna-ssl.com/wp-content/uploads/2014/11/test1.png
  4.   To save and exit by pressing Ctrl+X, " Y", ENTER
  5.  Test it out. In the terminal type           sudo reboot     press"Enter"
    
 

Tuesday, March 7, 2017

Mobile Sensors

Sensor Name

Application

Accelerator or Accelerometer

Used to detect the  tilting motion and orientation

E-compass

e- compass is usually based on a magnetometer sensor which provides mobile phones with a simple orientation in relation to the Earth's magnetic field

Proximity Sensor

Used to disable accidental touch events

(lights off when mobile  bring near to ear)

Ambient Light Sensor

Adjusts the brightness of your display according to the external environment.

Fingerprint

--

Geomagnetic Sensor

Magnetometer which measure the strength and direction of magnetic fields

Hall Sensor

·      Hall effect sensors are used for proximity switching, positioning, speed detection, and current sensing applications.

·      Hall effect sensor is used to detect flip covers and to automatically switch the screen on or off depending on whether the cover is opened or closed, respectively.

Gyroscope

Rate of rotation around the x,y and z axis

Ambient Light Sensor

An ambient light sensor is mounted in mobile phones to automatically measure the amount of light in the environment and adjust screen brightness accordingly

Barometer

A barometer in a mobile phone helps the GPS chip get a faster lock by delivering altitude data

Gesture Sensor

Gesture sensor is used to detect and recognize meaningful gestures from the parts of the human body such as hands, arms, face, and head. Most of the gesture sensors are mainly based on image sensor.

HRM Sensor

Heart Rate Monitor

RGB Ambient Light Sensor

Used as backlighting controls in any number of LCD display applications from consumer electronics to automotive, and by automatically adjusting display brightness, they can conserve battery life

Geo-magnetic Sensor

Usually based on a sensor called magnetometer provides mobile phones with a simple orientation in relation to the Earth's magnetic field

UV Sensor

Ultraviolet sensor to remind people when UV is at dangerous level and warn them about sunburn

Backside Illumination Sensor

A back-illuminated sensor, also known as backside illumination (BSI or BI) sensor, is a type of digital image sensor that uses a novel arrangement of the imaging elements to increase the amount of light captured and thereby improve low-light performance

Digital Compass

(magnetometer sensor)

To check orientation in relation to the Earth's magnetic field

 

 

Saturday, March 4, 2017

Raspberry Pi First Program on LED Blink using Python

 1.Install Python Module RPi.GPIO
   sudo apt-get install python-dev python-rpi.gpio

2. Open Terminal (Command Prompt)
3. Launch IDLE IDE by typing in terminal
        sudo idle

4.  After the IDLE launches, open a new window by FILE>OPEN or Ctrl+N
 5. Type the code below in the window 

LED Config (Source:https://electrosome.com)

import time
import RPi.GPIO as GPIO       ## Import GPIO library
GPIO.setmode(GPIO.BOARD)      ## Use board pin numbering
GPIO.setup(11, GPIO.OUT)      ## Setup GPIO Pin 11 to OUT
while True:
 GPIO.output(11,True)  ## Turn on Led
 time.sleep(1)         ## Wait for one second
 GPIO.output(11,False) ## Turn off Led
 time.sleep(1)         ## Wait for one second
 
6. Save the code by FILE>SAVE or Ctrl+S 
7. Run your code RUN>RUN or Ctrl+F5 
8. The Led will start blinking now.