A kind of a Polaroid camera, based on Raspberry Pi 2.
Details : https://hackaday.io/project/7176-polapi
- Raspberry Pi 2
- Raspberry Camera Module
- 4mm F1.0 CCTV lens
- Adafruit Thermal 57mm Printer, hacked for smooth printing
- Adafruit 320x280 TFT screen
- 3A 5v voltage regulator
- 7.4v 3.6Ah Li-po battery
- Buttons and hand made case
- Java programming.
#!/usr/bin/env python
# -*- coding: utf8 -*-
import RPi.GPIO as GPIO
import MFRC522
import signal
continue_reading = True
# Capture SIGINT for cleanup when the script is aborted
def end_read(signal,frame):
global continue_reading
print "Ctrl+C captured, ending read."
continue_reading = False
GPIO.cleanup()
# Hook the SIGINT
signal.signal(signal.SIGINT, end_read)
print "Place card please..."
# Create an object of the class MFRC522
MIFAREReader = MFRC522.MFRC522()
# This loop keeps checking for chips. If one is near it will get the UID and authenticate
while continue_reading:
# Scan for cards
(status,TagType) = MIFAREReader.MFRC522_Request(MIFAREReader.PICC_REQIDL)
# If a card is found
if status == MIFAREReader.MI_OK:
print "Card detected"
# Get the UID of the card
(status,uid) = MIFAREReader.MFRC522_Anticoll()
# If we have the UID, continue
if status == MIFAREReader.MI_OK:
# Print UID
print "Card read UID: "+str(uid[0])+","+str(uid[1])+","+str(uid[2])+","+str(uid[3])
# This is the default key for authentication
key = [0xFF,0xFF,0xFF,0xFF,0xFF,0xFF]
# Select the scanned tag
MIFAREReader.MFRC522_SelectTag(uid)
# Dump the data
MIFAREReader.MFRC522_DumpClassic1K(key, uid)
# Stop
MIFAREReader.MFRC522_StopCrypto1()
print "--- Finished ---"
continue_reading = False
GPIO.cleanup()
pyDump2.py, wait tag remove after data dump. I assume tag removed if 5 times of MIFAREReader.MFRC522_Request() not OK.
#!/usr/bin/env python
# -*- coding: utf8 -*-
import RPi.GPIO as GPIO
import MFRC522
import signal
continue_reading = True
# Capture SIGINT for cleanup when the script is aborted
def end_read(signal,frame):
global continue_reading
print "Ctrl+C captured, ending read."
continue_reading = False
GPIO.cleanup()
# Hook the SIGINT
signal.signal(signal.SIGINT, end_read)
print "Place card please..."
# Create an object of the class MFRC522
MIFAREReader = MFRC522.MFRC522()
# This loop keeps checking for chips. If one is near it will get the UID and authenticate
while continue_reading:
# Scan for cards
(status,TagType) = MIFAREReader.MFRC522_Request(MIFAREReader.PICC_REQIDL)
# If a card is found
if status == MIFAREReader.MI_OK:
print "Card detected"
# Get the UID of the card
(status,uid) = MIFAREReader.MFRC522_Anticoll()
# If we have the UID, continue
if status == MIFAREReader.MI_OK:
# Print UID
print "Card read UID: "+str(uid[0])+","+str(uid[1])+","+str(uid[2])+","+str(uid[3])
# This is the default key for authentication
key = [0xFF,0xFF,0xFF,0xFF,0xFF,0xFF]
# Select the scanned tag
MIFAREReader.MFRC522_SelectTag(uid)
# Dump the data
MIFAREReader.MFRC522_DumpClassic1K(key, uid)
# Stop
MIFAREReader.MFRC522_StopCrypto1()
# wait card removed
print "--- Remove Card ---"
card_removed = False
card_removed_counter = 5
while not card_removed:
(status,TagType) = MIFAREReader.MFRC522_Request(MIFAREReader.PICC_REQIDL)
if status != MIFAREReader.MI_OK:
card_removed_counter = card_removed_counter-1
if card_removed_counter==0:
card_removed = True
else:
card_removed_counter = 5
print "--- Card removed---"
print "Place card again please..."
Check out what comes in the box with the Intel® Compute Stick (model: STCK1A32WFC), Intel’s tiny Windows-based computer. While the Intel® Compute Stick can fit in the palm of your hand, it's what we fit inside of it that is truly remarkable. The Intel® Compute Stick has 2GB of RAM, 32GB of storage, built-in WiFi, Bluetooth 4.0, and comes pre-loaded with Windows® 10. Included in the box is a Quick Start Guide, HDMI extension cable, power adapter with USB cable, and international plug adapters.
This post show how to develop C/C++ program on Netbeans IDE run on Windows 10, set up remote host on raspberry Pi. Such that you can run the program on Raspberry Pi remotely.
GPIO Zero is a simple interface to everyday GPIO components used with Raspberry Pi, with very little code, you can quickly get going connecting your physical components together.
This video show my first try of GPIO Zero on raspberry Pi 2/Raspbian Jessie.
Connection (LED and Button):
Run IDLE with sudo, enter the simple code to test:
Python 2.7.9 (default, Mar 8 2015, 00:52:26)
[GCC 4.9.2] on linux2
Type "copyright", "credits" or "license()" for more information.
>>> from gpiozero import LED, Button
>>> led=LED(2)
>>> button=Button(3)
>>> button.when_pressed=led.on
>>> button.when_released=led.off
>>>
Here is another GitHub project mxgxw/MFRC522-python (A small class to interface with the NFC reader Module MFRC522), it provide examples of Dump.py, Read.py and Write.py also.
To set up SPI on Raspberry Pi 2/Raspbian Jessia, refer to last post.
This video show how to "git clone https://github.com/mxgxw/MFRC522-python" and run Dump.py to dump data of a brand new RFID key.
Possibilities include: Determining orientation
Detecting speed
Measure environmental conditions (temperature and humidity.)
The bright 8 x 8 RGB LED display can be used to display sensor data or games. An on-board directional joystick provides a human interface for navigation and input.
Compatible with Raspberry Pi B+, A+, and Pi 2
Product Description
The Raspberry Pi Sense HAT attaches via the Pi's 40pin GPIO port to read and display sensor data from a host of built-in sensors. Based on the same hardware that is currently in orbit on the International Space Station, the Sense HAT lets you create applications, experiments, and games.
Technical Specifications:
Gyroscope - angular rate sensor: +/-245/500/2000dps
Accelerometer - Linear acceleration sensor: +/-2/4/8/16 g
Magnetometer - Magnetic Sensor: +/- 4/8/12/16
Gauss Barometer: 260 - 1260 hPa absolute range (accuracy depends on the temperature and pressure, +/- 0.1 hPa under normal conditions)
Temperature sensor (Temperature accurate to +/- 2 degC in the 0-65 degC range)
Relative Humidity sensor (accurate to +/- 4.5% in the 20-80%rH range, accurate to +/- 0.5 degC in 15-40 degC range)
8x8 RGB LED matrix display
Small 5 button joystick
Compatible with Raspberry Pi B+, A+, and Pi 2
ASTRO PI The Raspberry Pi Sense HAT is being used in conjunction with the Raspberry Pi Foundation to perform science experiments aboard the International Space Station (ISS).
CAUTION@2016-08-19:
Somebody comment no need set device tree, check the comments (in the comments below and in the video: https://www.youtube.com/watch?v=0aVtZvkuHTA) first, before you try.
This post show the steps I install MFRC522-python (https://github.com/rasplay/MFRC522-python) on Raspberry Pi 2/Raspbian Jessie (2015-09-24), to read RFID tags (key and card) using RFID Reader, RFID-RC522.
Connection between RFID-RC522 Reader and Raspberry Pi 2:
RFID-RC522 pin Name
Pin #
Raspberry Pi 2 Pin name
SDA
24
GPIO8
SCK
23
GPIO11
MOSI
19
GPIO10
MISO
21
GPIO9
IRQ
-
no connection
GND
GND
GND
RST
22
GPIO25
3.3V
1
3V3
Steps: 1 - Enable SPI using Raspberry Pi Configuration
4 - Enable device tree
Edit /boot/config.txt to add the line:
device_tree=on
5 - Install latest version of bcm2835, C library for Broadcom BCM 2835 as used in Raspberry Pi; version 1.46 currently.
(http://www.airspayce.com/mikem/bcm2835/)
# download the latest version of the library, say bcm2835-1.xx.tar.gz, then:
$ tar zxvf bcm2835-1.xx.tar.gz
$ cd bcm2835-1.xx
$ ./configure
$ make
$ sudo make check
$ sudo make install
Then reboot.
6 - Test it:
$ cd MFRC522-python
$ sudo python read.py
Updated@2016-01-30: when we using MFRC522 it will set GPIO port mode to GPIO.BOARD. So simply you can't access using GPIO ports when it is in this mode using GPIO pins numbers. But you can access any GPIO ports according to GPIO.BOARD representation. ~ refer to Unknown comment below.
Before install python-gphoto2, we have to install libgphoto2, I run the gphoto2-updater script to install gphoto2 and libgphoto2 on Raspberry Pi 2/Raspbian Jessie. After finished, gphoto2 2.5.8 and libgphoto2 2.5.4 will be installed.
- install python-gphoto2 with pip
$ sudo pip install gphoto2
If you installed with pip the example files should be in /usr/share/python-gphoto2/examples or /usr/local/share/python-gphoto2/examples or somewhere similar. Otherwise they are in the examples sub-directory of your working directory. In Raspbian Jessie, it should be in /usr/local/share/python-gphoto2/examples.
Connect a digital camera to your Raspberry Pi, switch it on, and unmount it before access with Python, and try one of the example programs:
$ python camera-summary.py
In my first test, I can run example of camera-summary.py to list details of the connected camera, but fail to capture image, with Segmentation fault!
This post show how to control DSLR (Nikon D7000) with Raspberry Pi 2 (running Raspbian Jessie), using Python 2, with libgphoto2 and piggyphoto. The camera connect to Raspberry Pi via USB.
piggyphoto is a Python bindings for libgphoto2. You have to install libgphoto2.
To install piggyphoto for Python 2, enter the command:
$ sudo apt-get install python-piggyphoto
Try in Python 2:
import piggyphoto
C = piggyphoto.camera()
print C.abilities
C.capture_preview('prev.jpg')
C.capture_image('image.jpg')
This video show how to setup Remote Java SE Platform in Netbeans IDE running on Windows 10, deploy JavaFX application running on Raspberry Pi 2/Raspbian Jessie. Actually, it's same as in Raspbian Wheezy.
Official case of the the Raspberry Pi Foundation
Preassembled 5 part enclosure--Removable Lid for easy access to the camera and display ports--Removable Top Frame--Removable Side Panels with easy access to the GPIO port
Designed with Pi HAT's in mind
Dimensions: 96mm x 70mm x 25mm
Compatible with the Raspberry Pi 2 Model B and Raspberry Pi Model B+