Other Electronics

Other Electronics
Sort By:  
Adafruit 4 Channel I2C 12-Bit Analogue to Digital Converter (ADC) (Ada A2D converter)

The Raspberry Pi does not feature an Analog-to-Digital Converter (ADC), so if you want to measure analogue singals, you'll need this 12-Bit ADC!

The Adafruit 4-Channel I2C 12-Bit ADC is a high-precision ADC and features the ADS1015 chip, which provides 12-bit precision at 3300 samples/second over I2C. The chip can be configured as 4 single-ended input channels, or two differential channels. As a nice bonus, it even includes a programmable gain amplifier,with up to x16, to help boost smaller single/differential signals to the full range. We like this ADC because it can run from 2V to 5V power/logic, can measure a large range of signals and its super easy to use. It is a great general purpose 12 bit converter. 

The chip's fairly small so it comes on a breakout board with ferrites to keep the AVDD and AGND quiet and interfacing is done via I2C. The address can be changed to one of four options (see the datasheet table 5 in downloads below) so you can have up to 4 ADS1015's connected on a single 2-wire I2C bus for 16 single ended inputs. 
 
To get you started, we have example code for the Raspberry Pi - Simply connect GND to ground, VDD to your logic power supply, and SCL/SDA to your microcontroller's I2C port and run the example code to start reading data.
 
The Adafruit 4-Channel I2C 12-Bit ADC Features:
  • Wide Supply Range: 2.0V to 5.5V
  • Low Current Consumption: Continuous Mode: Only 150µA Single-Shot Mode: Auto Shut-Down
  • Programmable Data Rate: 128SPS to 3.3kSPS
  • Internal Low-Drift Voltage Reference
  • Internal Oscillator
  • Internal PGA
  • I2C Interface: Pin-Selectable Addresses
  • Can run from 2V to 5V power/logic
  • Measures a large range of signals and is super easy to use.
  • 12-bit precision at 3300 samples/second over I2C.
  • Configurable as 4 single-ended input channels, or two differential channels.
  • Includes a programmable gain amplifier, up to x16, to help boost up smaller single/differential signals to the full range.
  • Breakout Board equipped with ferrites to keep the AVDD and AGND quiet

Tutorials

Four Channel ADC Breakout

Example Code for the Raspberry Pi

Add to Cart
R179.00
8-Channel 10-Bit Analog to Digital Converter (MCP3008) (8 channel IC A2D converter)

The Raspberry Pi is a great computer but there's just one thing that most hardware hackers will find missing: a few inputs for connecting analog sensors. This is where the MCP3008 chip comes in handy, with eight 10-bit channels accessible over SPI. Thanks to the Raspberry Pi's SPI interfaces and its two 'Chip Select' pins available off of the main GPIO connector, the problem is solved.

Features

  • 10-bit resolution
  • ± 1 LSB max DNL
  • ± 1 LSB max INL
  • 8 input channels
  • Analog inputs programmable as single-ended or pseudo-differential pairs
  • On-chip sample and hold
  • SPI serial interface (modes 0,0 and 1,1)
  • Single supply operation: 2.7V - 5.5V
  • 200 ksps max. sampling rate at VDD=5V
  • 75 ksps max. sampling rate at VDD=2.7V
  • Low power CMOS technology
  • 5 nA typical standby current, 2 µA max.
  • 500 µA max. active current at 5V
  • Industrial temp range: -40°C to +85°C

Applications

  • Sensor Interface
  • Process Control
  • Data Acquisition
  • Battery Operated Systems

How-To

The following sample assumes that you're running the latest official Raspbian distribution, that you're logged in as root and that you haven't yet customized Raspbian to use SPI from a Python script. By default, the kernel module managing SPI communications is not loaded on Raspbian, so let's ensure that the 'spidev' device is available.

[email protected]:/# lsmod
Module                  Size  Used by  
snd_bcm2835            12808  0  
snd_pcm                74834  1 snd_bcm2835  
snd_seq                52536  0  
snd_timer              19698  2 snd_seq,snd_pcm  
snd_seq_device          6300  1 snd_seq  
snd                    52489  5 snd_seq_device,snd_timer,snd_seq,snd_pcm,snd_bcm2835  
snd_page_alloc          4951  1 snd_pcm  

If 'spidev' device is not listed, we need to remove it from the kernel module 'blacklist' so that it's automatically loaded on the next boot:

[email protected]:/# nano /etc/modprobe.d/raspi-blacklist.conf  

Put a hash character in front of the 'blacklist spi-bcm2708' statement and save the file:

#blacklist spi-bcm2708  

then, manually load the SPI device:

[email protected]:/# modprobe spidev  

The command should just complete without returning an error. Validate the list of modules:

[email protected]:/# lsmod  
Module                  Size  Used by  
spi_bcm2708             4401  0  
spidev                  5136  0  
snd_bcm2835            12808  0  
snd_pcm                74834  1 snd_bcm2835  
snd_seq                52536  0  
snd_timer              19698  2 snd_seq,snd_pcm  
snd_seq_device          6300  1 snd_seq  
snd                    52489  5 snd_seq_device,snd_timer,snd_seq,snd_pcm,snd_bcm2835  
snd_page_alloc          4951  1 snd_pcm  

The 'spidev' device should now be available.

Next, install the 'git' package. It will be needed to install other packages from Github.

apt-get install git-core  

Install the 'python-dev' package. It will be needed to compile the 'py-spidev' package.

apt-get install python-dev  

Download and compile the 'py-spidev' package.

[email protected]:/# cd /home  
[email protected]:/home# git clone git://github.com/doceme/py-spidev  
[email protected]:/home# cd py-spidev/  
[email protected]:/home# python setup.py install  

At this point, SPI is available from Python 2.7. Assuming that you have wired the MCP3008 to the Raspberry Pi's SPI bus using CE0 as the 'chip select' pin, you can read all eight analog inputs using the following Python script.

[email protected]:/home# nano adc.py  

Paste the script below in the editor and save it.

import spidev  
import time    
spi = spidev.SpiDev()  
spi.open(0,0)    

# read SPI data from MCP3008 chip, 8 possible adc's (0 thru 7)  
def readadc(adcnum):
          if ((adcnum > 7) or (adcnum < 0)):
                  return -1
          r = spi.xfer2([1,(8+adcnum)<<4,0])
          adcout = ((r[1]&3) << 8) + r[2]
          return adcout

while True:
          for adcInput in range(0,8):
                  print "ADC(", adcInput,")=", readadc(adcInput)
          time.sleep(1)  

To execute the script

[email protected]:/home# python adc.py  

Sample output using a 10K Ohm trimpot connected to the ADC's pin 3 and all other pins pulled down to ground using a 10k resistor.

ADC( 0 )= 0  
ADC( 1 )= 0  
ADC( 2 )= 0  
ADC( 3 )= 507  
ADC( 4 )= 0  
ADC( 5 )= 0  
ADC( 6 )= 0  
ADC( 7 )= 0  

Credits go to Jeremy for his work on the 'py-spidev' Python module which makes working with the MCP3008 straight forward. Alternatively, checkout wiringPi's SPI functions if you prefer using a 'C' API.

Related Tutorials & Samples

Add to Cart
R59.00
Pair Male Female 12V DC Power Plug Jack Adapter Connector for CCTV (male female cctv connector)
Description:
Simple & Professional appearance for power cabling
Easier for camera installation, save time and more securer cable connection
5.5mm x 2.1mm Female power plug connector
Clearly marked positive and negative to avoid reversal.


Package Includes:

1 x Pair Male Female 12V DC Power Plug Jack Adapter Connector
Add to Cart
R17.54
5.5 x 2.1mm DC Power Male Jack Plug Connector (male connector 5.5 cctv)
Specifications :

Connector Type:Male Plug
Material(External):PVC Plastic
Color: Black + Green
Size:2.1 x 5.5 mm
Internal diameter of the plug: 2.1mm
External diameter of the plug: 5.5mm

Package includes :

1 x  DC Power Male Jack Plug Connector
Add to Cart
R14.90
IR - Infrared Receiver (TSOP38238) (infrared receiver)

IR (Infrared) sensor tuned to 38KHz, perfect for receiving commands from a TV remote control. Runs at 3V to 5V so it's great for use on the Raspberry Pi!

To use, connect pin 3 (all the way to the right) to 5V power, pin 2 (middle) to ground and listen on pin 1. It doesn't do any decoding of the signal, just passes the 'raw data' along.

TSOP38238 Technical Features:

  • Carrier Frequency: 38kHz
  • Transmission Range: 45m
  • Directivity: 45°
  • Supply Voltage Min: 2.5V
  • Supply Voltage Max: 5.5V
  • Supply Current: 350µA
  • Opto Case Style: Through Hole
  • Operating Temperature Min: -25°C
  • Operating Temperature Max: 85°C
  • Packaging: Each
  • Operating Temperature Range: -25°C to +85°C
  • SVHC: No SVHC (16-Dec-2013)
  • Supply Voltage Range: 2.5V to 5.5V
  • Manufacturer: VISHAY MINICAST AGC2
Add to Cart
R19.00
2 Pin Plug in Screw Terminal Block Connector 5.08mm Pitch(pack of 5) (2 pin screw terminal(5))

As a connector, the terminal block is an important module in the electric industry.
It makes it easy to connect wires to your pcb.

Electrical Properties:

Rated voltage: 300V
Rated current: 16A
Contact resistance: 20mΩ
Insulation resistance: 5000MΩ/1000V
Withstanding voltage: AC1500V/1Min

Mechanical Properties:

Temp. Range: -30℃~+120℃
Max Soldering: +250℃ for 5 Sec
Torque: 0.5Nm

Specifications:

Screws: M2.5 steel Zinc plated
Contact: phosphor bronze Ni plated or stainless steel
Pin header: Brass, Tin plated
Housing: PBT, UL94V-0
Pitch: 5.08mm Poles: 2P
Color: Blue
Quantity: 5

Package includes:

5 x 2 pin Terminal Blocks
Add to Cart
R14.90
TCRT5000 Reflective Infrared Sensor Photoelectric Switches(Pack of 2) (infrared sensor x 2)
Color Black + blue
Material Plastic + iron
Specification Detecting range: 0.591" (15mm); Detecting method: Reflective; Collector Emitter Voltage: 70V; Collector Current: 100mA; Forward Current: 60mA; Output type: Phototransistor; Working temperature: -25~85'C
Features Compact construction, sense the presence of an object by using the reflective IR beam from the object
Application Perfect for line tracking robot car DIY project
Packing List Pack of 2 units
Out Of Stock
R25.00
GPIO LED kit v1.3 (GPIO LED v1.3)
GPIO LED kit v1.3 - SOLDERING REQUIRED - DIY kit

The LED kit is the ideal breakout board to learn how to control the RPi GPIO using python or on your Arduino.

This kit includes
  • pcb
  • 5 x LEDs with a choice of 5 colour pack or red only
  • 5 x 330 Ohm resistors
  • 6 pin male to male pcb connector
Possible projects
  • Traffic light
  • Disco/christmas running lights
  • Status indicator LEDs for alarm,robotics or related projects
  • Give away your age by doing the front panel on Kit from Knight Rider!
What you will need
  • Basic soldering skills and your soldering kit
  • 6 female to female jumpers to connect to your Pi
  • 6 male to female jumpers to connect to your Arduino
Please take note
  • Safety first
  • Soldering irons get very hot - be careful when soldering to avoid burns.
  • It is good practice to shut down the Pi/Arduino and unplug the power before connecting or disconnecting jumpers to the GPIO.


BULK

This item is also available in bulk at R52.50 for 5 or more units
Please inquire for bulk pricing for more than 10 units at  [email protected]
PiShop 5 LED manufactured kit
Add to Cart
R60.00
GPIO IO kit v2.02 (GPIO IO v2.02)
GPIO IO kit v2.02 - SOLDERING REQUIRED - DIY kit

This IO kit is the second in our range and the ideal breakout board to learn how to control the RPi GPIO using python or on your Arduino.

This kit includes
  • pcb
  • 3 x LEDs, red, yellow and green
  • 3 x 330 Ohm resistors
  • 8 pin male to male pcb connector
  • 1 x Light dependant resistor
  • 1 x 1uF capacitor
  • 1 x buzzer
  • 1 x tactile switch
Possible projects
  • Traffic light
  • Disco/christmas running lights
  • Status indicator LEDs for alarm,robotics or related projects
  • Learn how to measure light intensity
  • Learn how to detect when a button is pressed
What you will need
  • Basic soldering skills and your soldering kit
  • 8 female to female jumpers to connect to your Pi
  • 8 male to female jumpers to connect to your Arduino
Please take note
  • Safety first
  • Soldering irons get very hot - be careful when soldering to avoid burns.
  • It is good practice to shut down the Pi/Arduino and unplug the power before connecting or disconnecting jumpers to the GPIO.

Sample code is available here in a Python tutorial to assist you

Add to Cart
R80.01
Per Page      1 - 9 of 9
  • 1