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
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
- 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
- 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
- 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
- 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
As a connector, the terminal block is an important module in the electric industry.
It makes it easy to connect wires to your pcb.
Rated voltage: 300V
Rated current: 16A
Contact resistance: 20mΩ
Insulation resistance: 5000MΩ/1000V
Withstanding voltage: AC1500V/1Min
Temp. Range: -30℃~+120℃
Max Soldering: +250℃ for 5 Sec
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
5 x 2 pin Terminal Blocks
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.
- 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
- Sensor Interface
- Process Control
- Data Acquisition
- Battery Operated Systems
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:
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&3) << 8) + r 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
- Loading I2C, SPI and 1-Wire drivers on the Raspberry Pi
- Jeremy's Blog: Raspberry Pi hardware SPI analog inputs using the MCP3008
- wiringPi 'C' API for interfacing with SPI, I2C, GPIOs and more
- Adafruit Learning System
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.
- 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
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.
1 x Pair Male Female 12V DC Power Plug Jack Adapter Connector
Connector Type:Male Plug
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
|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|