background preloader

Adafruit's Raspberry Pi Lesson 4. GPIO Setup

Adafruit's Raspberry Pi Lesson 4. GPIO Setup
The I2C bus allows multiple devices to be connected to your Raspberry Pi, each with a unique address, that can often be set by changing jumper settings on the module. It is very useful to be able to see which devices are connected to your Pi as a way of making sure everything is working. To do this, it is worth running the following commands in the Terminal to install the i2c-tools utility. sudo apt-get install python-smbus sudo apt-get install i2c-tools sudo apt-get install python-smbussudo apt-get install i2c-tools Run sudo raspi-config and follow the prompts to install i2c support for the ARM core and linux kernel Then reboot! We also recommend going through the steps below to manually check everything was added by raspi-config! If you are using Occidentalis, then your Pi is ready to go with I2C as far as enabling the hardware goes. sudo nano /etc/modules sudo nano /etc/modules and add these two lines to the end of the file: i2c-bcm2708 i2c-dev i2c-bcm2708 i2c-dev sudo reboot Related:  RPI- SensorsGPIO I2CSensores

Configuring the Android ADB Two of my Androids connected via Android Debug Bridge on my Raspberry Pi When I got my Raspberry PiRaspberry Pi from element14 almost four months ago, I never intended on running Android on it. Instead, my plans were to have my Raspberry Pi service my fleet of Androids. In order to do that, I need the Android Debug Bridge (adb). ADVISORY: Only for Rooted Androids! If your Android device is not rooted and/or you do not know what Android rooting means, this this article is not for you. How to get adb on your Raspberry Pi Here are the basic resources for getting adb installed onto your Raspberry Pi: Notice: This isn't necessarily for beginners. If you don't want to bother with those Linux permission, you can install adbWireless onto your Android device(s). This article is only about basic configuration of using Android Debug Bridge on the Raspberry Pi. Marcos "Kuya Marc" Miranda

i2cset(8): set I2C registers Name i2cset - set I2C registers Synopsis i2cset [-f] [-y] [-m mask] [-r] i2cbus chip-address data-address [value] ... i2cset -V Description i2cset is a small helper program to set registers visible through the I2C bus. Options Display the version and exit. -f Force access to the device even if it is already busy. -y Disable interactive mode. -m mask The mask parameter, if specified, describes which bits of value will be actually written to data-address. -r Read back the value right after writing it, and compare the result with the value written. There are three required options to i2cset. i2cbus indicates the number or name of the I2C bus to be scanned. The value parameter, if specified, is the value to write to that location on the chip. The mode parameter, if specified, is one of the letters b, w, s, or i, corresponding to a write size of a single byte, a 16-bit word, a SMBus block write, or an I2C block write, respectively. Warning i2cset can be extremely dangerous if used improperly. See Also

Adding a second but different I2C device to the BMP085 Hello, I have successfully attached a BMP085 board to a Raspberry Pi and am logging pressure and temperature to This was fairly easy as I simply followed the instructions. Then, I added a second I2C device a Honeywell HIH6131 which is a humidity and temperature sensor. Finally, I wrote code (well maybe hacked is a better description) but it is not working correctly and would like some help. First let me explain the HIH6131 which resides at the I2C address of 0x27. From the data sheet it is "a Measurement Request command consists of the Slave address plus the WRITE bit (0). Figure 1 Next I can either read two bytes for a humidity reading or four bytes for a humidity and temperature reading. Figure 2 From the data sheet "the Master generates a START condition and sends the sensor Slave address followed by a read bit (shown in Figure 2). Now my testing. The problem is that I read back the same byte every time. Now I will describe the part of my code where it goes wrong. Thank you.

Experiments with Doppler Microwave Sensor | Black Cat Science, Inc. X-Band (10.525 GHz) Doppler Microwave Sensor with NI USB-6009 Data Acquisition Device There are bunch of low-cost X-band (10.525 GHz) Microwave sensor available these days, which can be purchased from various online sources, such as Ebay, Amazon and various DIY and Hobbyist sites. These sensor are typically used for in commercial applications for presence/intrusion detectors, automatic door openers, and non-contact light switches. Microwave Sensor Microwave Solutions MDU1720 X-Band Microwave Sensor In this example I am using the MDU1720 available from Microwave Solutions for ~$35. The image above shows the sensor module and its main features. In addition to the antennas, there are three terminals: signal (IF), ground (GND) and power (+5V). You may be wondering why is the signal output labelled IF? Data Acquisition Device NI USB-6009 Data Acquisition Device For data acquisition I am using the NI USB-6009 data acquisition device. Connecting the Sensor to the NI USB-6009 DAQ we know , and

Instalar SDK y ADB Android, para principiantes | aplicaciones android Aquí les dejo un excelente manual que explica como instalar el SDK de Android y como utilizar ADB, que lo necesitar para realizar ciertas modificaciones en su Android. Tras el salto el manual y los archivos necesarios. Paso 1, el SDK Necesitaremos la última versión del SDK que nos ofrecen. Vamos a ello. Descargarlo de aquíExtraedlo al lugar que quierasDefinid el path de la manera siguiente, donde la cursiva-negrita es el directorio donde lo has instaladoset PATH=%PATH%;c:\android\android-sdk-windows-r3\tools oset PATH=%PATH%;c:\Archivos de programa\android-sdk-windows-r3\tools Paso 2, el Driver Al conectar el móvil, varias veces nos aparecerá el mensaje, “Instalar el Driver”. Si ya se ha instalado por defecto (mal) entonces aseguraos de desinstalar los drivers primero y luego vuelvan a empezar. Paso 3, la consola Al haber puesto el path anteriormente, tenemos la suerte de que en cualquier lugar del ordenador, iniciamos el cmd y podremos ejecutar las órdenes que queramos. Paso 4, comandos

I2C Python Library - 3-Axis Digital Accelerometer (ADXL345) with the Raspberry Pi » Think Bowl The ADXL345 is a 3 axis accelerometer that can communicated to the Raspberry Pi with I2C. It offers several advanced features that can be easily incorporated into your project via this library. In general an accelerometer returns the gravitational affects on 3 sensors; for example, if the z axis is perpendicular to the earth, it should have a reading of approximately 1. Some features of this library: Instance initializes with default values for common uses simplifying initial setupSettings can be tweaked for individual applicationsEasy setup for single tap, double tap, or free fall sensingConfigure interrupts to trigger based on activity, taps or free fall Usage Basic Example I2C ADXL345 Basic Example from i2clibraries import i2c_adxl345 from time import * adxl345 = i2c_adxl345.i2c_adxl345(0) while True: print(adxl345) sleep(1) Tap Example Free Fall Example I2C ADXL345 Free Fall Example Installing the I2C Libraries Instructions for installing the Think Bowl I2C Libraries are here. Functions __str__

Perl and Raspberry Pi: Install HiPi is a collection of Perl modules for the Raspbian Wheezy Linux Distribution on the Raspberry Pi. There is further information in the About Page. Preparing To Install During the install process, the installer will excecute: sudo apt-get update. The installation of dependencies often fails if apt-get update has not been run. The install process requires root privileges to install its scripts and does so by calling 'sudo'. Automated Install wget hipi-install Manual Install If you want to download the latest tarball, read what the build process actually does (and perhaps you should as it executes some commands under sudo ) and then install manually: ... clear any prior download and extractrm hipi-latest.tar.gzrm -rf hipi-latest... download and build, installwget -xvzf hipi-latest.tar.gzcd hipi-latestperl Build.PLperl Buildperl Build testsudo perl Build install gksudo hipi-control-gui

Making the electronics for a Doppler motion sensor There are many different sensors that can be used to detect motion in a given environment. Passive InfraRed (PIR) sensors are the most used today, as they work by detecting moving heat signatures. However, they are less reliable in the hotter days and obviously only work for animals and humans. Sensors like the one shown in the above picture started to appear on the internet, they use the doppler effect to detect motion. I (limpkin) designed the electronics you need to add in order to get them to work. Here is a simple explanation of the doppler effect: if you send an RF signal at a given frequency to a moving target, the reflected signal’s frequency will be shifted. The Doppler motion sensor I bought only outputs a non-amplified signal of a few micro-volts, whose frequency represents the speed at which an object is moving towards or away from the sensor. I even made a simple video showing off the result:

Windows: Instala ADB, Fasboot y drivers Android para Windows en tan sólo 15 segundos Si eres un usuario avanzado de Android sabrás a qué nos referimos cuando hablamos de ADB, de Fastboot o de los drivers Android y también sabrás que la configuración inicial del entorno suele conllevar bastante tiempo ya que tenemos que descargar numerosos paquetes por separado o el kit de desarrollo oficial y configurar los directorios de funcionamiento. El usuario de XDA-Developers Snoop15 acaba de lanzar un paquete para Windows que permite la instalación y configuración de ADB y Fastboot, así como los drivers para Windows en cuestión de sólo 15 segundos. Te presentamos ADB Installer. Se trata de un pequeño paquete que te permite instalar los componentes por separado, o bien, todo el conjunto de herramientas desde un sencillo menú en línea de comandos. Para usarlo, descárgalo de aquí y ejecútalo con permisos de administrador, luego sigue las instrucciones en pantalla según lo que quieras instalar. Más información | XDA-Developers

Linux Examples These examples are designed to demonstrate how to use a range of our modules on a Raspberry PI. You will need an SD card with the latest official Raspbian Linux distribution running on it. I2C Modules The Raspberry PI I2C port is not enabled by default there is a rpi_i2c_setup.doc documenting the process I used to get i2c running on the Raspberry PI. We have provided the source code for download ready to be compiled and used on your system. There is also a diagram below showing which pins on the Raspberry pi's GPIO header to use for the i2c port. MD49 The RPi serial port is used to communicate with the MD49 and drive the motors. SRF01 Follow the instructions above to get the serial port going on your RPi. USB-RLY08b This example shows how to read and write from the USB port. Raspberry pi i2c port diagram The diagram below shows how to connect the I2C-LVL01 to the RPi for use with 5v I2C modules. Raspberry Pi MD49 Diagram. Raspberry pi SRF01 diagram

I2C Humidity Monitoring on the Raspberry Pi First published: 17th July 2013 So, as discussed in my introduction to humidity monitoring on the RPi, I had chosen to connect a HIH-6120-021-001 to the RPi's I2 bus. Hardware Honeywell's datasheet shows how simple it is, just the chip, a 0.22µF capacitor and a couple of pullup resistors. However, the RPi already has 1.8KΩ pullups on the I2C bus. Construction was just a matter of adding two components to the matrix board with a 26-pin header socket already used for my 1-wire interface. The limitation of the I2C bus is that it was designed for short distances - for example, on a motherboard. Software Adafruit has some simple instructions for configuring the I2C bus. i2c-bcm2708 i2c-dev Also, the I2C utilities are not installed by default: sudo apt-get install python-smbus sudo apt-get install i2c-tools (Change to -y 1 for newer raspberry pi) "the maximum number of I2C devices used at any one time is 112" Once the kernel modules are loaded, the buses can be seen: #! With this result: .