Posts

Showing posts from 2016

Turning on an LED with your Raspberry Pi's GPIO Pins

Image
One of the biggest selling points of the Raspberry Pi is its GPIO, or General Purpose Input/Output ports.  They are the little pins sticking out of the circuit board and allow you to plug various devices into your Pi.  With a little programming, you can then control them or detect what they are doing. In this tutorial I am going to show you how to light an LED.  In addition to your Raspberry Pi running Raspbian, what you will need is: A Breadboard An LED A 330 ohm resistor Two Male-Female jumper wires You can get all these, and more, in the £5 CamJam EduKit from The Pi Hut, which teaches you more about LEDs, buzzers and switches, and includes all the hardware and eight well-written worksheets about using the GPIO pins on your Pi. The Breadboard The breadboard is a way of connecting electronic components to each other without having to solder them together. They are often used to test a circuit design before creating a Printed Circuit Board (PCB). The ho

Stepper Motor Control in raspberry pi

Image
Steppers Steppers , or stepping motors, are brushless DC motors. In the PyHack workshop we first started with brushed DC motors (2 wires), then using H bridges to make them rotate both ways, and used pulse width modulation (PWM) to vary their speed. We followed with servos and then we went into steppers. Unfortunately, I've not posted on some of these aspects yet (I thought I had), but I'll definitely post the explanations (servo, PWM), diagrams and python code for these too. Now, let's get back to our steppers. They do come in all kinds of shape and size: Wired For our discussion right now however, we'll focus on just one thing, the number of wires. Typically, you will have a stepper with 4, 5 or 6 wires: 5 wire unipolar, 4 wire bipolar 6 wire unipolar As can be seen, 5 or 6 wires are fundamentally the same. They are what is called a Unipolar stepper. 4 wire steppers are Bipolar steppers. A different type of driver is needed dep

Ultrasonic Distance Measurement Using raspberry pi

Image
Componant :-                                 HC-SR04                                 1kΩ Resistor                                 2kΩ Resistor                                 Jumper Wires Ultrasonic Distance Sensors :- Sound consists of oscillating waves through a medium (such as air) with the pitch being determined by the closeness of those waves to each other, defined as the frequency. Only some of the sound spectrum (the range of sound wave frequencies) is audible to the human ear, defined as the “Acoustic” range. Very low frequency sound below Acoustic is defined as “Infrasound”, with high frequency sounds above, called “Ultrasound”. Ultrasonic sensors are designed to sense object proximity or range using ultrasound reflection, similar to radar, to calculate the time it takes to reflect ultrasound waves between the sensor and a solid object. Ultrasound is mainly used because it’s inaudible to the human ear and is relatively accurate within short distances. You co

Webcam Interface On Raspberry Pi

                        Raspberry PI persists in its pride stage due to its relevance in performing image processing applications. Real time image processing schemes can be developed using a Raspberry Pi, as it supports the webcam interface, and there by we can process the algorithms for detection, recognition, segmentation, surveillance etc. Hardware Modules: Raspberry Pi USB Webcam Additional Software Packages: fswebcam  package The webcam should be connected to the USB port of the Raspberry Pi. after connecting open the LX Terminal and type in lsusb. If the camera is detected then a message will be displayed, as shown in the image above (marked in red). Now install   fswebcam to start using the camera. To install the  fswebcam   software package, type in as follows: sudo apt-get install fswebcam   After the installation enter the command fswebcam followed with a desired file name for saving the image. fswebcam testimage.jpg     For selecti

Servo Motor Control Using Raspberry Pi

Image
Introduction and Component :- 5V, 1A Power Supply Raspberry Pi 2  B+ Analog Servo Motor Connecting Wires Servo motor has got three connection pins, Vcc, ground and signal. It requires a 5V 1A power, which is provided from a suitable supply source. On the Raspberry Pi board, GPIO pin number 22 is selected as the signal pin. The GND pin of the power supply is connected to the ground pin of the servo and also to the 6th pin on the Raspberry Pi. After providing suitable connections open the python editor and program the Raspberry Pi. A sample code is given below, which you can use as it is or you can modify it to suit yourself  Code :- import RPi                                  ## Import GPIO Library. import time                                 ## Import ‘time’ library for a delay. GPIO.setmode(GPIO.BOARD)                    ## Use BOARD pin numbering. GPIO.setup(22, GPIO.OUT)                    ## set output. pwm=GPIO.PWM(22,100)                        ## PWM Fr

LCD Alarm Clock With Snooze Button

Image
Componant :- ·          Raspberry Pi ·          Breadboard ·          16 x 2 LCD Screen ·          10kΩ Potentiometer ·          Active Buzzer ·          Pushbutton Switch ·          10 Female to Male Jumper Wires ·          9 Male to Male Jumper Wires Instructions: This project is designed to use the Raspberry Pi to simulate a simple alarm clock with a buzzer and a snooze button. Our project utilizes the same 16 x 2 LCD screen from our previous projects while incorporating the active piezo buzzer from   Project 10 . Additionally, we have inserted a pushbutton switch into our breadboard layout to act as a simple snooze button. Because this experiment builds upon   Project 9  on this website and requires the  Adafruit Raspberry Pi Python Code Library , be sure to follow the instructions in our   Previous Project  outlining the installation procedures before you continue. After you have populated your breadboard and cloned the Adafruit library mentioned