rpiarduinomusings

Raspberry Pi, Arduino, Sensors and the data they produce

Category Archives: Uncategorized

Sensor Project – Moving forward

We have played quite a bit with the sensors to learn about the arduino and raspberry pi devices, as well as python and C code to get a feel for the programming.  I feel like this has been a useful endeavor, and feel far more educated on those topics, but it is time to move forward with the home control and sensor efforts, moving out of experimentation to implementation.

There are several established platforms the we have looked at to get a feel for  how we could implement, as well as for theory of operations.  Our group is a mixture of disciplines with both hardware, networking and software knowledge.  We also prefer open source tools.

Today, I decided to take the group down a path, one that I believe encompasses all of the desired outcomes we have discussed.

MySensors.org has been a constant reference during this learning phase, returning there every time a new sensor came up in our discussion. I have chosen this implementation for the sensors and gateway, along with the PiDome “controller” [www.pidome.org] running on the Raspberry Pi model 2 B.

My efforts now turn to installation of the base configuration of these.

  1. PiDome Controller installation and configuration.
  2. MySensors “Serial Gateway”
  3. Basic Sensors [(4)- Sound, PIR, Temperature/Humidity, Door/Window/Gate]

The following posts will document these efforts individually.

The first step is to create the controller environment. With the  PiDome selection made, you can proceed to download the PiDome installation.  It is not currently a selection that you can download as a pre-configured image, so you will have to build it out in successive steps.  You will start with a NOOBs install, per the Rapsberry Pi page here:

http://www.raspberrypi.org

I go to the downloads page from the menu, and choose the NOOBs item with a zip download, you can use whichever method works for you.

In my case, once the download concluded, I un-zipped the files into a spot in my download directory.

Now, NOOBs is not a burnable image, as we had done with prior installs of Raspberian, I do not know why, but I am sure they have a reason.

My next step was to insert an SD card into my USB adapter, and do the SD Format on it. [ http://www.sdcard.org%5D SD Formatter 4.0 is the tool I used.

Step two was to drag and drop all the files from the directory [I un-zipped into in the previous step] into the SD card.

Now eject the SD card on your computer, and place it back into the Raspberry Pi SD card slot.

Some assumptions here are that you have the keyboard, mouse, monitor and network connections all hooked up already to the Raspberry PI [RPi].

Time to boot the RPi.

When the screen appears, Clink the box for Raspbian and click on Install.

Be prepared to wait a while, as this is a network installation of the OS.

Once this process has concluded, go to the  PiDome Server installation page here:

http://pidome.org/support/server-install.html.

Pay attention to the details on the GPIO configuration, using this webpage:

http://elinux.org/RPi_Serial_Connection

At this point, I made no changes, as I think my gateway will be using the USB connection, so I will just bookmark this page for later in case I misunderstood the functionality.

I will not document each step of the PiDome here, as I was able to follow the support page exactly.

Key steps to note:

Create the directory on the PiDome SD card: /opt/pidome/pidome-server

Copy all the files from the zip file to this directory. I use the tool winsftp to accomplish this.  I did not know how to use winsftp with elevated permissions, so I copied the files off to /home/pi/Downloads via the windows tool, then went to a terminal window and used the cp command to get the files where they belonged [ /opt/pidome/pidome-server ].  I then followed the installation page to set the permissions in this directory.

Once that was completed, I updated the init.d to make the program start up on boot.  I rebooted a couple times, but each time the system failed to run properly.  I search for the appLog.txt file (found in the server directory btw) and discovered that it ran the first time, but took longer than I had patience for (it was setting up the DB) and my reboot did not help. The second time it tried t run but the system started up before the wifi was able to get a valid IP address!  I proceeded to remove the autostart, and decided to go to a manual start for now.  Boom, It Worked!  I now have PiDome running on my Raspberry Pi model B.

Next Steps will be to attach the MySensors.org gateway, and then deploy my first two sensors.  Watch for another installment soon!

PiDome-Success

 

 

 

 

 

 

 

 

Advertisements

Power – Arduino Low Power Sensors

Since we last visited the sensor network in mid-December, we have tested the range of the previously built sensors, by placing them into some cheap plastic food containers.

These were not meant to be low power items, more just to validate software and connectivity through the nrf24l01+ wifi units, back to the base Raspberry Pi (RPi).

This worked well as a validation for each subject area.  The next step was to try to determine if the Nrf24l01+ we sufficient for the  communications job.  One modification was that we had to move the receiver to near a window, to extend the range to 60-70 feet, which was successful.

That was the good news, the bad (but predicted) news was that a 9 volt battery did not last long in either the Uno based unit (15 hours) nor the Pro Mini unit (22 hours).

The next step was to either rewrite the code in these units to automatically power down and back up when we wanted to transmit, or to find ways to reduce the power used by the regulators and on-board LEDs.  I have chosen to go a slightly different way by re-embracing of the mysensors.org environment, then adjust what they deliver to the hardware I have in hand.

My first step has been to re-purpose the arduino pro mini  [PM5] (16mhz 5v) to be the serial gateway for this.  I was able to download and setup the “serial gateway” from their web site, and am proceeding to build a new sensor device to their specifications. The next step in this environment is to pick a controller.  The group has purchased Raspberry Pi units, so that will be the device to deploy to.