Skip navigation

Raspberry Pi Projects

9 Posts authored by: mazzmn

Well, I've finished my main project for The Ultimate Raspberry Pi Bundle Road Trip, you can read about that here:

The Complete Channel One Temperature Monitor and Alarm Project - The Ultimate Raspberry Pi Bundle

But, that doesn't mean I'm done Road Trippin,

I still have a few more wonderful gadgets to test out....

In this post I'm go to explain how I used the Raspberry Pi, the PiFace Digital and the Raspberry Pi Camera to create a gadget that will catch sneaky people who  try to peek into packages when they're not supposed to.

 

GnomeSnoop.jpg


What's in the Box?

For this project I'll hide a Pi, Camera and PiFace Digital inside a box, we'll use a magnetic switch to detect when the box opens and snap a picture of the snoop. A follow on for this project would be to send a text message (as I did on my previous project the Channel One Temperature Monitor) or twitter or instragram the image....but I'll leave that for another day.

 

Parts needed:

  • Raspberry Pi Model B (A would work as well, but a USB hub would be required)
  • PiFace DigitalPiFace Digital - Daughter Card / Expansion board for the Pi
  • Raspberry Pi Camera BoardRaspberry Pi Camera Board
  • Magnetic Proximity switch - I had this one from Jameco on hand
  • Optional LED - Breadboard and wires to act as an "on" indicator

 

The PiFace Digital:

The PiFace Digital is a shield designed to fit on the Rasberry Pi, and it adds many features to the Raspberry Pi including

  • 8 Digital Inputs
  • 8 Outputs
  • 8 LED indicators
  • 2 Relays
  • Works in Python, Scratch and C
  • There's even an emulator


Putting together the What's In the Box Project:

I'm going to skip the steps of installing Raspbian as I covered that in my previous project.

For this project I needed to:

  • Install the camera and some code it requires
  • Install code for the PiFace Digital and test it out
  • wire up the switch and LEDs
  • write the inTheBox.py script which runs everything.

 

Install and Configure the Camera:

Watch the video on the following page to see how the camera connects to the PiFace Digital

http://www.raspberrypi.org/camera

Be aware that the camera is sensitive to static electricity, the ribbon cable is fragile and the ribbon cable must be installed in the correct orientation

To operate the camera you need to

  • run sudo raspi-config to enable the camera
  • reboot

Now you'll be able to test the camera by running the command:

raspi-still -v -t image.jpg

This command will start the camera, show you a preview, prompt you on the commandline, when you press Enter the picture is snapped

There are many options and features available on the camera. It's worth it to take a look at the camera documentation found here


Installing the PiFace Digital:

Physically the PiFace Digital fits on easily, but since the Camera is part of this project, it would have been nice if there would have been more room for the ribbon cable. It seemed to work fine to run the cable under the shield, but I wasn't really happy about bending the cable that much.
For the software portion of the install, I thought a good place to get started on this project would be the piface getting started guide

The information on enabling SPI was good, but the instructions on installing the code and emulator used wget and were out of date. I eventually found the Install PiFace Software on the PiFace website and those instructions use apt-get and are up to date:

 

After installing the PiFace Digital code and Emulator (and rebooting) you can run a few things to test out the PiFace Digital

For example, test the PiFace built in LEDs with the following blink program

python3 /usr/share/doc/python3-pifacedigitalio/examples/blink.py

 

You can also test the switches virtually by running the PiFace Emulator

piface/scripts/piface-emulator

click on the Override Enable menu option

and now the virtual Output Pin buttons will operate the LEDs, even the real LEDs on the real board!

 

Code the inTheBox.py Script:

I wanted a program to monitor the door and then snap a picture when someone opened it. I thought it would be useful to have an external LED so I could optionally have a blinking indicator letting me know the box is "armed".

To accomplish this I used one of the 8 PiFace input ports to handle the magnetic proximity sensor. I used of the 8 output ports to power the LED.

I ran Fritzing to create a schematic, but sorry to so no PiFace ....But you can see the connections here:

InsideTheBox.JPG

 

The program is called inTheBox.py and here it is

 

 

#!/usr/bin/env python3
import pifacedigitalio
import pifacedigitalio as pfio
from time import sleep
import os  # os used to run camera commands

pfio.init(True,0,0)

pifacedigitalio = pifacedigitalio.PiFaceDigital()

while(True):
  pifacedigitalio.leds[1].toggle()
  print (pfio.digital_read(7))
  if (pfio.digital_read(7) is 0):  #wait till the box opens
    print ("Smile!")
    #TODO: get date and use as part of filename
    #todo: create thread to upload images and erase them, optionally twitter?
    os.system("raspistill -t 2000  -o image.jpg")
#    os.system("raspistill -t 1000 -n -o image.jpg") # no preview 1 second pause
  print (pfio.digital_read(0)) #read button S1
  if (pfio.digital_read(0)): # if button then quit
    pifacedigitalio.leds[1].turn_off()
    exit(0)
  sleep(1)


 

 

Here's a Video of the What's in the Box Project catching a snoopy Gnome in the act

I've been blogging about my experience in Road Test reviewing the Ultimate Raspberry Pi Bundle. As a part of this Road Test I'm creating a Fridge/Freezer Temperature Alarm system for our local food shelf, Channel 1. You can see where this Road Test started for me here


In this post I'll bring together all the steps required to build your own Raspberry Pi powered temperature monitor project.

Background info:

Last Christmas vacation, I volunteered for a local food shelf called Channel One. I was chatting with the warehouse manager and he mentioned that their large freezer and cooler rooms are protected by commercial monitoring systems, but he'd really like a temperature monitor for their walk-in display-case cooler and freezer. The food shelf is closed from Friday Noon until Monday at 8am, they've had several cases where the unit has blown a fuse and food has been ruined. My goal was to use the Ultimate Raspberry Pi Bundle to build a low cost temperature monitoring system that can send free text messages when the temperature in the fridge or freezer is outside of the acceptable range.

 

ChannelOneOutside.JPGchannelonefreezer.JPG

 

Project Objective:

  • Monitor the temperature of the Freezer and the Fridge Unit - the valid temperature target is 33F in the fridge unit, and -10F in the freezer unit. However, during business hours, the doors are opened by customers and stocking personnel, so the  the fridge could possibly fluctuate to 60F. So allow for a wider temperature range during Business Hours vs Off Hours.
  • Audible temp range alarm. Make some noise when the temperature is out of range.
  • Snooze Alarm - If the temperature range is out of whack, support a button that stops the noise.
  • Text message - when the temperature is out of range, send a text message to someone who can either fix the problem, or move the food.
  • LCD Temperature display -make the unit wall mountable, we'll mount it outside of the cold of the fridge/freezer unit but the temperature will be visible to staff.


complete.jpg

 

 

Parts Needed:

 

Tools Needed:

  • Soldering iron and solder - to solder the sensor to the Pi
  • Wire-stripper
  • Dremmel tool - to cut the project box
  • Xacto knife - project box tweaks
  • Screwdriver

 

Steps to build this project :

 

Install Raspbian

 

  • Using NOOBS is a very convenient way to install the flavor of Linux you prefer on your Raspberry Pi.
  • NOOBS stands for New Out of the Box Software. You can buy a pre-installed NOOBS SD card (what I used for this project) or download your own from http://www.raspberrypi.org/downloads.
  • Connect the HDMI cable, power adapter, USB keyboard and insert your NOOBS SD card (no ethernet is needed for NOOBS).
  • When NOOBS boots up, you'll be presented with the following options to install:
    • Archlinux - a configurable linux distro not recommended for newbies
    • OpenELEC - Open Embedded Linux Entertainment Center (OpenELEC) a small Linux distribution meant to be a media Center
    • Pidora - Pidora is a Fedora Remix optimized for the Raspberry Pi computer
    • RaspBMC - the XBOX Media Center interface
    • Raspbian (Recommended) Raspbian is a free operating system based on Debian optimized for the Raspberry Pi hardware
    • RiscOS - RISC OS is a British operating system designed specifically for the ARM processor
  • Raspbian is recommended and it's what I used for this project.
  • After Raspbian formatting of the SD card finishes, use the configuration screen to:
    • Change from the default password of pi / raspberry
    • Enabled ssh from the advanced options (more about SSH later)
  • Finally run the startx command to bring up the graphical desktop and move on to the next step

Setup the WiPi Wireless Adapter

I followed these instructions to configure the wireless network using commandline instructions.

 

The basic steps are:

  • sudo nano /etc/network/interfaces
  • fill in the appropriate lines with your router SSID and password
    wpa-ssid "ssid"
    wpa-psk "password"
  • reboot

After the reboot, the Pi will connect to your network and you'll be able to surf the internet from the Pi or just sit back and enjoy the blue glow from the WiPi adapter.

Setup VNC Remote Access

The Raspberry Pi features HDMI out, but if you're like me you are not flush with many HDMI TVs or Monitors. I ordered an HDMI to DVI cable for more options, but to completely free up your HDMI monitors, why not set up VNC so you can access your Pi from a normal laptop or desktop computer? VNC Remote Access (or Tight VNC) is a tool that includes the vncserver process which allows use of graphical applications without connecting any screen to the Pi itself. You simply connect to the vncserver with vncviewer.

Here's how to set-up  VNC

  • Install vncserver by running this command on the Pi:
    sudo apt-get install tightvncserver
  • Start the VNC server by running the command
    vncserver
    (Note, the first time you run it it will ask you to create a vnc password, remember it you’ll need it later)
  • Download vncviewer for your laptop (or desktop) computer
  • Connect from your laptop using the ipaddress:port of the vncserver (and the password you created above)

Now you can use your Pi even when you don't have a monitor or keyboard connected to it. You can either set it up so vncserver so it starts automatically at boot time (as described later), or connect to the Pi using ssh or winscp, log on command-line style and start the vncserver.

 

Assemble and Setup the LCD

lcdAssemble.jpg

  • Solder together the LCD - Adafruit has a write-up on the 16x2 RGB LCD for Raspberry Pi which explains step by step how to assemble the LCD (note that the layout of the circuit board has changed since the assembly tutorial was created, but the instructions are still very clear)
  • The RGB LCD shield is very easy to use. As a shield it's designed to just plug onto the Raspberry pi and comes with example code showing how to change the screen colors and poll the buttons
  • Note: this was a significant difference between the Adafruit LCD and the PiFace Control and Display. The PiFace Control and Display supports event driven button handling whereas the Adafruit LCD requires polling the buttons, simply looping through checking to see if each button has been pressed.  (I resolved this problem in the temp4sensor.py code by making the Temperature sensing portion of the code into a timebased event handler.
  • Adafruit also includes usage and testing instructions that describe a program called Adafruit_CharLCDPlate.py which allows you to verify the LCD and buttons have been assembled correctly. It polls the buttons and changes the display and color as you press the various buttons. This program provides a good example for handling buttons in python.
  • Note: one thing to watch for when first using this LCD is that it won't powerup until you actually run code to turn it on. Also be sure to follow the instructions on setting the contrast, the display is impossible to read if the contrast is set incorrectly.


Install Python Modules and Files Required by temp4sensor.py

  • To run the Temperature Monitor, you'll need the GPIO library for Raspberry Pi
  1. sudo apt-get install python-rpi.gpio
  • To play audio files for the alarm sound you'll need mpg321, install this by running the command:
    sudo apt-get install mpg123
  • The audio sound played by temp4sensor.py is a public domain sound from sound bible. The script plays Robot Blip 2 three times to get the desired sound. I also liked the Alien Siren sound effect.
    Download at least the Robot Blip sound from here:
    Robot Blip 2 Sound
    Alien Siren
  • The LCD Pi Plate Python code for Pi is available on Github at  https://github.com/adafruit/Adafruit-Raspberry-Pi-Python-Code
  1. sudo apt-get install git
  2. git clone https://github.com/adafruit/Adafruit-Raspberry-Pi-Python-Code.git
  3. cd Adafruit-Raspberry-Pi-Python-Code
  4. cd Adafruit_CharLCDPlate
  5. To test the LCD display use the Adafruit_CharLCDPlate.py script which polls the buttons and changes the screen text and color accordingly
  6. Note: this script requires sudo access so you'll need to run the command as follows:
  7. sudo python Adafruit_CharLCDPlate.py


Solder the Temperature Sensor Jacks

jack.jpg

This step is optional as you can clearly solder the temperature sensors directly to the LCD. In a previous blog post I mentioned the Adafruit tutorial that describes how to wire up one temperature sensor To use two temperature sensors we simply wire the sensors up in parallel and I've made code changes to support data returned by two sensors.

The temperature sensors have to be soldered as follows
Blue goes to Ground
Red goes to 3V power

Yellow goes to Data port #4

You'll also need the 'pullup' resistor which is supplied with the ds18b20-temperature-sensor. This resistor is required so the temperature sensor reading can be made by the pi

Plug in the Remote Speaker

A feature of the Raspberry Pi is the 3.5mm analog audio out. We'll use this feature to play an audio mp3 file when the temperature is out of the acceptable range. I happened to have a  Boombotix Portable Speaker, so this step was easy, just plug the 3.5mm jack in to the output port of the Raspberry Pi. A future enhancement for this temperature sensor is to install a smaller speaker inside the project box.


Temperature Sensors

Cobbler.jpg

One optional step for the Temperature Sensor is to use a Raspberry Pi Cobbler when testing the temperature sensor wiring. The cobbler is shown above and wiring it to the temperature sensor is described in the following Adafruit tutorial Eventually the temperature sensors need to be soldered to the 3.5mm plugs. I used headphone jacks simply because headphone cables have three wires (the same as the temperature sensor cables) and extension cables can be obtained fairly cheaply. Be careful to match the correct wire from the jack to the correct wire from the plug.


wiring.jpg

Install the temp4sensor.py code and config file

The temp4sensor.py code is meant to drive the temperature sensor. It requires a configuration file called temp4sensor.cfg. Both should be copied to the directory /home/pi/bin/
Download the files temp4sensor.py, temp4sensor.cfg and tempsensorStart from the Attachments portion of this blog post

The configuration file is a simple text file that needs to have the following lines:

#Temperature values in F:
 lowfridge,hifridge,lowfreezer,hifreezer,phonenumber
31
56
-10
8
150739586309



































Test the program by running it from the commandline as follows:

  1. sudo python temp4sensor.py

 

Configure the system so temp4sensor.py starts up at Pi Boot-Up

In order to cause the temp4sensor.py script to start automatically when the Raspberry Pi powers on, we need to configure it as a Linux Init Script

  • Download the file "tempsensorStart" from the attachment on this blogpost  Once configured, this script calls the temp4sensor.py script at startup.
  • copy tempsensorStart to /etc/init.d
  • run the following command to make it executable
    chmod +x /etc/init.d/tempsensorStart
  • test running the script to ensure it won't have problems at reboot time
  • register the command to run at startup by running the command:
    sudo update-rc.d tempsensorStart defaults

Viola! We're Finished

  • Now the temperature monitor is ready to be mounted at the installation site. As mentioned before we want to install the unit outside of the refrigerator unit, but we also don't want to install the device in too warm of a location either. I've read that Raspberry Pi's can tend to overheat, in fact there are heat sinks available and included in the Ultimate Raspberry Pi Bundle. My device is going to be installed in a somewhat cool warehouse so I'm leaving the heat sinks off for now, it will be interesting to see how the unit holds up.

Video of the Channel One Temperature Monitor In Action

The Ultimate Raspberry Pi Bundle has been a great collection of equipment to work with and test out. Now that the Temperature Monitor is finished I'll be demoing this alarm system to the good people at Channel One Food Shelf. Hopefully it can be used to prevent future food loss in their aging fridge and freezer units.

 

Note: after some additional testing, I made a few changes, the latest version of the code can be accessed here https://gist.github.com/mazzmn/9441036

I've been blogging about my experience in Road Test reviewing the Ultimate Raspberry Pi Bundle. As a part of this Road Test I'm creating a Fridge/Freezer Temperature Alarm system for our local food shelf, Channel 1. You can see where this Road Test started for me here


IMG_3071Sm.JPG


Since my last post I've been busy, last weeks on FIRST Robotics, but I managed to order some temperature sensors and get them working with the Raspberry Pi! So I'm quite close to my target project the temperature sensor/monitor for our local Food Shelf known as Channel One (and in the last week they've had another weekend outage, and another loss of food, so these sensors can really fill a need)


Previously I used the PiFace Control and Display to create a Raspberry Pi Powered Joke Machine - The Ultimate Raspberry Pi Bundle

for the Channel One Temperature Sensor I cracked open the Adafruit version of an LCD display (also included in the Ultimate Raspberry Pi Bundle) It's known as the Adafruit RGB Positive 16x2 LCD + Keypad Kit for Raspberry Pi I was glad I did too, for the following reasons:

  • The Adafruit LCD Plate is mutli colored, you can programmatically change the LCD background to 7 different colors. I decided to use the color feature to my advantage, my Temperature Sensor is normally Green, and I change it to Red if the temperature is too hot, and blue if the temperature is too cool
  • The Adafruit LCD features a nice set of Tutorials right on the product website and one tutorial was almost exactly what I was looking for, it explains how to use the DS18B20 1-wire temperature sensor and the Pi and PiPlate. I simply had to modify things slightly to use 2 sensors and then figure out how to use the LCD display as well.
  • With the PiFace I was wondering how to tap into the open ports after the shield was plugged in, Adafruit pointed out a neat device that could be used to make things easier here...stacking headers
  • Assembly instructions were very clear and easy to follow even though the pcb had been recently rearranged.
  • The Adafruit LCD does not have the IR sensor found on the PiFace CAD, or the extra togglebutton. However for this project I didn't really need those features
  • The Adafruit LCD buttons are controlled by polling instead of the event driven design found on the PiFace CAD. This is significant, for example I wanted to have a button that cancels the temperature sensor...if the buttons were event driven this would be easy, but since I have to poll the buttons with the Adafruit design, I'll need to poll temp sensor one, temp sensor two, then loop looking for button presses and then timeout when no buttons are pressed.


So the Raspberry Pi and the temperature sensors can detect when the Freezer or Fridge unit are out of range (too hot or too cold) and the LCD display can show the current temperature and even change colors when the temp is out of range? But how do we notify someone who can hopefully correct the situation? Well we don't have to worry about the issue of a power outage, as there is already an alarm in place for that, we also can assume that we have Wifi access. In a previous project I sent a twitter message to send a warning Create an Internet Connected Pill Dispenser but Channel One wanted to have a text message sent to one or more folks. While Twitter was free, I couldn't find a free SMS solution, but Twilio seemed like a reasonable cost for this project, each text costing only a penny or so. (Still would like to find a free solution)


Assembling the Adafruit LCD 16x2 Plate

IMG_3059AdaFruitSm.JPG


Testing on the home Fridge and Freezer

TempsensorSmIMG_3073.JPG


Issues I found this time around

  • The mini keyboard is once again annoying, sometimes types multiple characters and I found it does not have a "\" ...a key that is necessary with  python
  • Running out of time to review/blog about all the things in my Ultimate pi Bundle, still to come: Gertboard, PiFace Digital, Camera, Protoboard, and Embedded Pi

I've been blogging about my experience in Road Test reviewing the Ultimate Raspberry Pi Bundle. As a part of this Road Test I'm creating a Fridge/Freezer Temperature Alarm system for our local food shelf, Channel 1. You can see where this Road Test started for me here

 

After the success of my first Raspberry Pi Project The Pi Powered Joke Machine - The Ultimate Raspberry Pi Bundle Blog post

I documented that fun little educational project on Instructables (since they are running a Raspberry Pi contest)

 

And now it's back to the Temperature sensor. I need to figure out what type of temp sensor I should use. Previously I found this resource on Element 14 that lays out the types of temp sensors I could use

Hints for selecting the correct temperature sensor for your application

 

For a project I worked on a few years back, we used an Arduino and a TMP36 IC and I also had access to an LM34 and LM35, but I believe those would all require analog ports which the Pi doesn't have.

I thought a thermocouple might work, but a friend tells me they put out a very low level signal that requires a lot of analog processing (hmm again analog port required)


He recommended a digital output sensor like the Dallas Semi DS18B20 and found a prepackaged version that looks like what I want. It is pre-wired, waterproof, is meant to go long distances (I'll have to run the sensor out 25ft from where I mount the Pi) and they have included some documentation / examples on how to use it.

http://www.adafruit.com/products/381#Description

Reasonably priced at $9.95 (although I could have saved money and bought just the ICs...but...then I would have to try to wrap them up to stand up to the cold of the freezer and buy cable and cable wrap....) Another good sign is that according to my research Raspian (which I've installed on my Pi) supports this type of temp sensor

Here is a link to the tutorial on how to use the sensor Adafruit's Raspberry Pi Lesson 11. DS18B20 Temperature Sensing

 

And here is a little bonus too, I happened to notice Adafruit was having a few live events....Demos of Wearable tech, a Show and Tell session and Ask an Engineer. I participated in the Show and Tell (showing off my Pi Powered Joke Machine) and then while watching the Ask an Engineer session they provided a discount code worth 10% off all orders for the evening...so my temp sensors are on the way!

 

Next step...while waiting for the Temp Sensors I'm going to crack in to some of the other items in the bundle....hmm possibly the Gertboard and or the Pi Camera....say cheese!

I've been blogging about my experience in Road Test reviewing the Ultimate Raspberry Pi Bundle. As a part of this Road Test I'm creating a Fridge/Freezer Temperature Alarm system for our local food shelf, Channel 1. You can see where this Road Test started for me here

 

Here is a short video of a project I created as a way of learning the Raspberry Pi. The Joke Machine queries iheartquotes.com and displays a One-Liner in 16 char segments. It uses the momentary buttons found on the PiFace Control and Display to allow you to scroll forward and backward the joke and request a new joke.

 


To create the Joke Machine I had to do the following:

I found a website that provides free Quotes (including One-Liners which is what I used here). The quotes come back in basic text and so I figured a simply wget or curl example would work....I ended up using pycurl and not using python3. Seemed like I was having problems getting the pifacecad examples to both be using the same version fo Python. In fact many examples of using the buttons on the PiFaceCad required python3...which is fine, but I was running into problems getting pycurl to run in python3. So I ended up using the following style of handling multiple buttons on the PiFace https://gist.github.com/larsks/6161684

Install the PiFace Control And Display Example code

sudo apt-get install python{,3}-pifacecad

 

Install PyCurl

sudo aptitude install python-pycurl

 

Install TheQuoteMachine.py

This is the python script I created to query www.iheartquotes.com to get the one-liner, break it into 16 char segments and handle the buttons to allow users to scroll.
I posted the code for TheQuoteMachine.Py as an attachment in my previous blog post
PiFace Control & Display - The Ultimate Raspberry Pi Bundle

Don't forget to make it executable by running chmod +x /home/pi/bin/TheQuoteMachine.py

 

Push a Button, Get a Joke

Now you can run /home/pi/TheQuoteMachine.py  It will connect to the free service http://www.iheartquotes.com and display hilarious one-liners. It does this by getting the one-liner back in straight text, splitting it up into 16-Char wide segments and then allowing you to scroll up and down through those segments using the PiFace buttons.

 

The Quote Machine Buttons:

  • Button 1 is the back button
  • Button 2 is the advance display button
  • Button 3 is the New Quote button
  • Button 4 is the Quit Button

I've been blogging about my experiences in Road Test reviewing the Ultimate Raspberry Pi Bundle. As a part of this Road Test I'm creating a Fridge/Freezer Temperature Alarm system for our local food shelf. You can see where this Road Test started for me here

 

My next step is to add an LCD display connection

I have two choices with the The Ultimate Raspberry Pi Bundle

 

I'm going to start with the PiFace Control & Display because it doesn't need to be soldered together and it features an interesting Remote Control interface. I'm glad that both items include the option of control buttons (should be handy for adjusting the temperature sensor and for use as a "snooze alarm" button for my Temperature Alarm System.

 

The PiFace™ Control & Display is a plug and play device that allows you to use and control your Raspberry Pi without a keyboard, mouse and monitor. It saves space and power yet still provides a simple and functional user interface.

 

Getting Started

A perfect place to get started is with the PiFace Quick Start Guide  and it's setup instructions

This document walked me through the simple process of

  • aligning the CAD shield and connecting it to the Pi
  • Enable the SPI bu by running: sudo raspi-config, option 5
  • the installation of Control and Display software by running
    sudo apt-get install python3-pifacecad
  • Testing the device with the handy sysinfo.py command
    python3 /usr/share/doc/python3-pifacecad/examples/sysinfo.py
    Note: the sysinfo.py example command shows the IP address and temperature of the Raspberry Pi. Having the IP address is handy for times when I want to use SSH to start vncserver and then vncviewer to connect to the system

 

20140125_082811.jpg

 

I put the Pi away and when I came back to try it again the next day. To my surprise, sysinfo.py made the screen flicker but display nothing. The troubleshooting section in Quick Start Guide mentioned :

If your LCD has nothing appearing on it or its character spaces are all

black, try adjusting the contrast screw with a small star head screwdriver.

But it doesn't exactly say where that is...look for the screwdriver in the lower right hand corner of the picture...that's where the adjustment screw is:

20140125_190627.jpg

 

 

One question I have is with the CAD in place, how can I easily access the other ports available, ...looks like they are available on top??

 

Wake Up with Sysinfo!

As I mentioned in my last post I like connecting to my Pi using vnc and in the interest of learning something new, I decided to have the sysinfo program run at startup for my Pi. This way no matter where I plug it...it will display the IP address it has been assigned and then I can easily SSH to it (and optionally run vncserver)

In order to make sysinfo.py run at startup, I had to:

  • Copy the sysinfo.py program to sysinfo1Time.py and modify it so that it no longer loops forever.
  • register the sysinfo1Time.py program so it runs at startup

 

To modify sysinfo.py script so it no longer loops forever, you simply need to:

  • comment out line 48, the while True statement in the show_sysinfo() routine.
  • comment out line 57, the while Sleep statement in the show_sysinfo() routine.
  • change the indentation on the show sysinfo() routine


To Run the sysinfo1Time.py at startup, you simply need to:

  • create a file in /etc/init.d that calls the new sysinfo1Time.py script (I've called it SysInfostart and attached it to this blog post)
  • chmod +x /etc/init.d/SysInfostart
  • test running the script so it won't hang or error out at reboot
  • register the command to run at startup by running the command:
    sudo update-rc.d SysInfostart defaults
  • Should you want to stop having this program run at startup run the following command:
    sudo update-rc.d -f SysInfostart remove

 

Now reboot the Raspberry Pi and you'll see "Waiting for IP...." and then the IP Address of your Pi will appear

 

To use VNC to connect to the Pi you simply need to:

  • run ssh or putty from your windows machine to the ip address. An easy way to do this is to install Winscp and use it

winscp.JPG

Once you log on to the Pi with WinScp, click on the ,Open Terminal icon and you can run commands on the system...in this case we want to run the vncserver command

vncserver.JPG

And finally you'll be able to connect using vncviewer.

Vncviewer gives you a full gui environment running on the Pi

vncviewer.jpg

 

 

Next steps for me on the Ultimate Raspberry Pi Bundle review........create something useful with the  PiFace Control & Display....it's called the Automatic One-Liner Machine

 

Also ...things to look into...I found if I want to try to debug the problem with my XBMC SD card, I should take a look at this page R-Pi Troubleshooting - eLinux.org

I've started blogging about my experience in Road Test reviewing the Ultimate Raspberry Pi Bundle. As a part of this Road Test I'm creating a Fridge/Freezer Temperature Alarm system for our local food shelf, Channel 1. You can see where this Road Test started for me here

 

Installing Raspian on the Raspberry Pi

That is a slightly misleading statement, as the Pi doesn't have any local storage. More precisely what I did (while the NFC playoff game was paused) was use the provided NOOBS SD card to select my choice of Linux flavor to run on my Pi.

NOOBS stands for New Out of the Box Software. It's meant to make setting up Linux on your Pi easy, and it avoids the need for a network connection. When NOOBS boots up, I was presented with the following options

  • Archlinux, - very configurable linux distro, but probably not recommended for newbies
  • OpenELEC - Open Embedded Linux Entertainment Center (OpenELEC) is a small Linux distribution built from scratch as a platform to turn your computer into an XBMC media Center

  • Pidora - Pidora is a Fedora Remix optimized for the Raspberry Pi computer
  • RaspBMC (the XBMC interface I had been using in my last blog post),
  • Rasbian (Recommended) Raspbian is a free operating system based on Debian optimized for the Raspberry Pi hardware
  • RiscOS - RISC OS is a British operating system which was designed specifically for the ARM processor by the same team who created the original ARM

 

I'm still getting used to this wireless touchpad that came with the XBMC, so when I picked Raspbian I almost pressed proceed faster than I could read the reminder that my SD card was going to be formatted...but that's ok, that's what we're trying to do.

 

After the formatting I was presented with the configuration screen and I:

  • Picked the Expand Filesystem (but found I didn't need to because NOOBs already configured things so my entire SD card can be used)
  • Change from the default ID and password of pi / raspberry
  • Did not enable boot to desktop, because I may use SSH to access this Pi for a while, and I can always run startx to start the desktop
  • Used the Advanced options to enable ssh and check the system name
  • After I picked finish on the config menu I ran startx to bring up the graphical desktop
  • Next I wanted to configure the Wi-Pi device. I know I do this with the WiFi Config Icon...but oops the Wi-Pi is not currently plugged in...when I put the Wi-Pi in the USB, it caused the machine to reboot ..scary..why??

 

Configuring the Wireless Network

  • This part should be easy, there is a WIFI Config icon, I used it to scan the networks, found mine and entered in the password information
  • I kept getting an error Failed to initiate AP Scan- this message would appear when I would try to connect to any of the wireless connections I found when scanning. I'm not sure if I was typing the password wrong (verified it was typing correctly by typing it in a terminal window) or if I was choosing my authentication parms wrong
  • When I came back to this again I decided to try using commandline and it worked...found this set of instructions on the Adafruit website.
  • And now the Wi-Pi works great, and it gives off a nice blue glow when it is communicating.

 

The blue glow of the Wi-Pi:

20140120_194051.jpg

 

After the connection was made, I was able to surf the internet, and I also used Winscp to connect from my Windows 7 box to the Pi

 

Screen Options

Since I currently only have one TV that can use HDMI, I've ordered a HDMI to DVI cable, I'll soon be able to use my computer monitor

I also installed vncserver. Vnc is a process that allows me to use Graphical applications without connecting any screen up to the Pi itself. To use it we start the vncserver on the Pi (usually by using ssh or winscp to long on commandline style to the Pi). When you start the server, it will have you create a password that allows you to connect to the server and it will tell you the port number to connect to (usually 1 in this situation) Then from your PC, run the command vncviewer, when prompted, specify the ipaddress and port (ie 198.162.2.12:1 (you can find out your PC Ipaddress by running the command ipconfig) and finally specify the connection password when prompted.

 

To install vncserver on raspbian, you can run the following command from the Terminal window:

sudo apt-get install tightvncserver

When I ran it it warned me that it would use 9988 kB of additional disk space

 

Here's what VNCviewer looks like running on my Pc

vncserver.JPG

 

Review Comments:

  • It was very easy to use NOOBS, I like it. It might be nice to have some indication of what the various flavors are useful for.
  • I wonder if I should have copied off the NOOBS SD card before I used it to make it easier to try another flavor? But I guess I can just download another copy from Downloads | Raspberry Pi
  • Slight glitch trying to install Wi-Pi, the commandline technique worked very easily though.
  • Super easy to install vncserver and connect via vnc

 

Next step....LCD display connection

When I applied for the Ultimate Raspberry Pi Bundle, I took a little time to peek at the products included in the package. I've seen Raspberry Pi's before, seen friends make them into cool projects, but have not actually used one myself. I have worked with a few different flavors of Arduino, a Parallax Propeller Board of Education and done a tiny bit with ATTiny micro controllers, but I am a software engineer at heart, so I'm still learning the hardware game. My first reaction to the bundle was one of intrigue, lots of gadgets to try, some I had not even read about. Next I noticed there appeared to be some overlap of function, for example an LCD display and another LCD display that needs to be soldered together ...that's ok, displays are good.

Anything appear to be left out of the "Ultimate Bundle"?  Well, there's no case I guess, but that's a style thing and for my project I will probably need a custom case anyway. No cable or wall wart (er I mean power adapter) maybe, we'll see. A super minor thing would be the cobbler needs a breadboard to be useful, that's fine, I have those. 


Those all seemed like pretty minor issues, the real challenge is to come up with a project that fits this eclectic package, here's what I proposed:

As I said in my first blog post, I wanted to design a temperature sensor for the local food-shelf.  It seems the Ultimate Pi Bundle would allow me to pretty much implement this worthy project, provide reviews for element14 and probably add some creative bells and whistles...also know as feature creep...adding on requirements that the customer did not really ask for.

I understand the base requirement to be simply monitor temperature range in the refrig and freezer unit, then use either the available wifi connection and or a cellphone interface to notify the appropriate Channel One employees of issues. By using Pi, I'm sure I could allow easy configuration of settings and viewing history information from an on-board web-server...boom done!

But wait, there's more, now with the Ultimate Raspberry Pi Bundle...could I add more?, let's see

  • WiPi - wifi is essential for my current base design
  • Adafruit RGB Positive 16X2 LCD & Keypad Kit - a beautiful solution to add an onsite Temperature Status display
  • PiFace™ Digital plugs could allow us to add sensors to the display case doors and signal an alarm if the door is open for too long of a time (something that has caused problems in the past)
  • PiCamera could be useful to see who or what is blocking the door, or for security if someone opens the door during off-hours.
  • ChipKit Pi could be used to provide custom configuration slides/buttons on site as opposed to, or in addition to the proposed web based configuration options
  • Gertboard and Pi Cobbler would allow easier prototyping and debugging of our design.

 

So in order to not get carried away, I visited ChannelOne to check on their real requirements.

I met John on a Friday afternoon just as the Food-Shelf was closing, he was happy to talk to me especially since he likes the idea of a free temperature monitoring system and the only thing on his agenda for the day was cleaning :-)

We looked over the refrigerator system, looked for power sources, checked the wifi signal and inspected the larger cold storage warehouse to see what their monitoring system looked like.

 

ChannelOneIMG_2809.JPG

FridgeUnitIMG_2802.JPG

 

There are two units like the above, one is a refrigerator unit and one is a freezer unit. I'll need to monitor the temperature range of each separately.

 

Here's what we decided:

- the base requirement is a bit more complicated, the valid temperature target (33F in the fridge unit, and -10F in the freezer unit) needs to vary depending on the time of day and probably the time of year. During business hours, and especially in the summer, since the doors are opened by customers and stocking personnel the fridge could possibly fluctuate all the way to 60F. So we agreed we need a Business Hours Range and an Off Hours Range, and a way to indicate what business hours are. (Another reason for these 2 ranges is reaction time to the problem. Becuase if 60F is occasionally allowed during the day, if the cooler hits 60F at night, this is not acceptable because it will likely soon hit 70F and it may take a while till someone can address the problem)

- the door ajar alarm - my parents used to have a car with a voice chip that literally said "The door is ajar" when the door was left open. While this may seem cute at first it can be kind of annoying. That's what we decided about the door ajar sensor I originally proposed...customers and stockers have a ligament reason to keep the door open. So instead we realized we need an audible temp range alarm. Originally we were just going to send an email or text message to someone when the range is out of hand, but we decided that during the day, an audible alarm when the temp is out of range is also obviously needed.

- Snooze Alarm - a good use of sensors on this project would be a snooze alarm. If the range is out of wack, it's probably going to take people a while to fix the problem...we'll need a way to silence the annoying alarm. A button on the unit would be preferred.

- Text don't just email - the original design was to send an email when the temp range is not correct. After talking to John and Mike in the warehouse they pointed out that most people don't read email at midnight (really?) and a text message would be much more effective. Of course this should go to more than one person due to vacations etc.

- Location of display - we carved out a good spot to mount the finished product, a power source is available, we'll be outside of the cold of the unit (figuring the Pi would probably not last as long in extreme temp conditions) and the LCD will be visible to staff.     

- Power Outage Warning - the original brainstorming on this project thought assuming Channel One has a UPS on their computers and wifi, we might be able to have a battery backup Pi, detect a power outage and send a warning. However we decided Channel One has generators and a system set up for power outage notification.

- Security Camera Function - another bell and whistle that isn't needed. While we could take a picture and send an alert if someone opens the freezer unit after hours, this would require is to add door sensors or motion sensors and isn't really needed since the building is already under multi-camera surveillance

 

Ok, I think that is about it, KISS Keep It Simple Stupid...let's get working on these requirements before there is more wasted milk.
I'll figure out another way to review the entire kit of parts...I've wanted to buy a Pi for a while anyway :-) 

 

Oh, I this week I also took some photos of the products I received:

 

PiIMG_2784.JPGWiPiIMG_2786.JPGChipKitIMG_2789.JPGEmbeddedPiIMG_2787.JPG

 

CameraPi_IMG_2779.JPGPiFaceSmIMG_2790.JPG

xbmcSmIMG_2801.JPGLCDIMG_2793.JPG

IMG_2792.JPG

CobblerIMG_2798.JPGAdafruitIMG_2796.JPG

PiRackIMG_2795.JPGPiFaceControllerIMG_2791.JPG

Wow! be careful what you wish for you just may get it :-)

I applied for and just received via UPS the Ultimate Raspberry Pi Bundle from element14!

Thanks very much!

Now comes the daunting job of not only blogging and reviewing these great products, but putting them into production for a local Food Shelf!

 

Embedded image permalink

 

You see over Christmas vacation, I volunteered for a local food shelf called Channel One. I was chatting with the warehouse manager and I mentioned my hacker space The Rabbit Hole has quite a bit of experience with various micro-controller projects and wondered if there might be something our club could contribute to Channel One. He mentioned that their large freezer and cooler rooms are protected by commercial monitoring systems, but he'd really like a temperature monitor for their walk-in display-case cooler and freezer. The Rabbit Hole jumped on the idea right away, and began some brainstorming how best to build this type of monitor. We were leaning towards a Raspberry Pi solution as a powerful, flexible and inexpensive answer. Two weeks later, the aforementioned cooler blew a fuse over the weekend and caused a ton of milk to go to waste. Next thing you know I was checking the Road Test progress of fellow RabbitHole member Peter Shabino and noticed the element14 Ultimate Raspberry Pi Bundle Road Test applied and was selected Yeah!

I'm new to blogging, but there's more to follow, I'd appreciate comments and suggestions from the element14 community

 

More to Come: I'll create a series of posts as I review these products, here's the next in the series: Getting the Requirements Right - The Ultimate Raspberry Pi Bundle

Filter Blog

By date: By tag: