Category Archives: Raspberry Pi

Raspberry Pi | Wiring | Pins | From https://projects.drogon.net/raspberry-pi/wiringpi/pins/

Just for my reference https://projects.drogon.net/raspberry-pi/wiringpi/pins/

The following tables give the mapping of the Raspberry Pi GPIO Pins to the GPIO connector in relation to the pin numbers and the physical location on the connector. This is a representation of the GPIO connector as viewed looking at the board from above, with the USB power at the top and the GPIO to the top-right of the board.

If using the connector pin numbering, then note that Pin 1 on the connector is the 3.3v supply. Pin 2 is the 5V supply, and pin 26 is marked SPI CE1 below.

P1: The Main GPIO connector:

wiringPiPin BCMGPIO Name Header Name BCMGPIO wiringPiPin
3.3v 1 | 2 5v
8 R1:0/R2:2 SDA0 3 | 4 5v
9 R1:1/R2:3 SCL0 5 | 6 0v
7 4 GPIO7 7 | 8 TxD 14 15
0v 9 | 10 RxD 15 16
0 17 GPIO0 11 | 12 GPIO1 18 1
2 R1:21/R2:27 GPIO2 13 | 14 0v
3 22 GPIO3 15 | 16 GPIO4 23 4
3.3v 17 | 18 GPIO5 24 5
12 10 MOSI 19 | 20 0v
13 9 MISO 21 | 22 GPIO6 25 6
14 11 SCLK 23 | 24 CE0 8 10
0v 25 | 26 CE1 7 11
wiringPiPin BCMGPIO Name Header Name BCMGPIO wiringPiPin
  • Board Revisions: Please note the differences between board revisions 1 and 2 (R1 and R2 above)

P5: The auxilliary GPIO connector present on Rev. 2 boards only:

wiringPi Pin BCM GPIO Name Header Name BCM GPIO wiringPi Pin
5v 1 | 2 3.3v
17 28 GPIO8 3 | 4 GPIO9 29 18
19 30 GPIO10 5 | 6 GPIO11 31 20
0v 7 | 8 0v
wiringPiPin BCMGPIO Name Header Name BCMGPIO wiringPiPin

Gertboard order has been delayed

After a short wait my Gertboard has finally arrived. The package I assumed was the Gertboard was actually a gift from those fine people at Yorkshire Tea. Due to high demand the delivery of my Gertboard will now be 19th November, guess I’ll just have to experiment with the breadboard and LEDs for now.

The board comes in kit form, I’ll post on my progress assembling the kit.

Raspberry PI add-on board - Gertboard
Assembled Gertboard (determined mine will look like this)

The Gertboard is an expansion board for the Raspberry PI designed by Gert Van Loo (the guy that designed the original alpha hardware for the Raspberry PI). Gertboard expands the Raspberry Pi’s GPIO pins and will allow you to interface with the outside world.

Soldering is easy: http://mightyohm.com/files/soldercomic/FullSolderComic_EN.pdf

Purchase Gertboard: http://uk.farnell.com/element14/gertbom/kit-gertboard-gpio-board-unassembled/dp/2115337

Gertboard resources: http://www.element14.com/community/groups/raspberry-pi

Gertboard assembly manual: http://www.element14.com/community/docs/DOC-48916?ICID=raspberrypi-group

Gertboard user manual: http://www.element14.com/community/servlet/JiveServlet/downloadBody/48860-102-3-256002/Gertboard_User_Manual_Rev_1%200_F.pdf

Gertboard test progamshttp://www.element14.com/community/docs/DOC-48859?ICID=raspberrypi-group

Motion detection for £45

Raspberry PI

Using a Raspberry Pi, a Microsoft VX-800 webcam and Motion – linux motion detection software.If motion is detected images are uploaded to dropbox and an email is sent to prompt looking in dropbox. Seen as the Raspberry Pi could also run on battery power there is even the possibility of a portable motion detection system (wildlife cam??).

  1. Install Motion
  2. Configure Motion
  3. Install dropbox_uploader.sh
  4. Configure mail
  5. Re-configure Motion

1. sudo apt-get install motion ** For best results build motion and ffmpeg from source (see bellow)

2. sudo nano /etc/motion.conf

Check palette configuration is compatible with camera

sudo motion -n   ** (runs in debug mode, printing problems to screen)

3. Download dropbox_uploader.sh from github.

Save files in /usr/local/dropbox  (sudo mkdir /usr/local/dropbox;; cd /usr/local/dropbox;;sudo wget https://github.com/andreafabrizi/Dropbox-Uploader/tarball/master;;sudo tar -xf andreafabrizi-Dropbox-Uploader-cdc2466.tar.gz)

sudo ./dropbox_uploader.sh

follow onscreen instructions. Once configured don’t forget to copy ~/.dropbox_uploader to home directory of user that will be running motion (ie if starting motion with sudo this will be roots home) or edit dropbox_uploader.sh and change the CONFIG_FILE= line to point to your config file ie CONFIG_FILE=/usr/local/dropbox/.dropbox_uploader

Test dropbox_uploader.sh:
sudo /usr/local/dropbox/dropbox_uploader.sh upload /var/www/pic/1.jpg /motion

** Make sure the target folder exists in dropbox first.

4. Create a .mailrc file (mail profile). I use google apps for email so mine is as follows:

cd /root
sudo nano .mailrc

set smtp-use-starttls
set ssl-verify=ignore
set smtp=smtp://smtp.gmail.com:587
set smtp-auth=login
set smtp-auth-user=xyz@xyz.com
set smtp-auth-password=pwxyz
set from=”xyz@xyz.com(Your Name)”

Save then test mail:
echo “Test Email message” | mailx -s -v “subject” toxyz@xyz.com

5. sudo nano /etc/motion.conf
Scroll down to the external commands section
Change the ; on_event_start value line to:
on_event_start echo “Your message” | mailx -s “Your Subject” who@where.com
Change the ; on_picture_save value line to:
on_picture_save /usr/local/dropbox/dropbox_uploader.sh upload %f /motion/%d_%m_%Y-%H_%M_%S.jpg
Change the ; on_movie_end value line to:
on_movie_end /usr/local/dropbox/dropbox_uploader.sh %f /motion/%d_%m_%Y-%H_%M_%S.avi
Save and restart motion:
cat /var/run/motion/motion.pid
kill [pid returned by above command]
** Start in debug mode to test
sudo motion -n
If all is well restart motion in daemon mode (just sudo motion)

Building Motion and FFMPEG from source