Raspberry Pi Doorbell and Camera Part 2

After a session of lifting tin and climbing through the roof to run cables the camera has now made it’s way to it’s new home 🙂

After the cable was run I wired up the POE and Ethernet and found there was too much of a voltage drop over the line to keep the Raspberry Pi running while taking a picture so I changed out the 5v PSU for a 7.5v PSU to bring the line voltage up.

After I did this the Pi booted no worries and shot off a picture.

psu

My eBay case arrived and while not the most subtle case for the job it has more than enough room to house everything.

The Pi was mounted to the plastic board inside with a pair of zip ties and the camera with a good chunk of blue tack. I think I’ll eventually mount the camera better but with the camera board being so small it is a bit of a pain to mount.

case outside

case inside

camera

And after mounting the case out the front we have success:

front door

I made a few further changes to the software side as well as shown here:

run script

As you can see here upon the door bell being pressed the Pi:

1. Sends a pushover notification via the API

2. Captures two pictures. One low res and one hi res

3. Attaches and emails the low resolution picture

4. Inserts the date and time to a mysql database

5. Copies the hi resolution picture to my NAS

 

Here you can see the mysql table which simply contains the date and time the door bell was pressed, eventually I will do up a PHP interface to be able to view the data from mysql more easily.

mysql

 

And now onto the next project 🙂

Webserver, Mysql and Temp Sensors

A bit of work finally got done on the back end systems for home automation including setup of a new Debian VM for a web server and Mysql server to allow data collection from various sensors around the house as well as hosting the library data for Kodi (XBMC).

I now have two virtual machines running on the NAS. The Windows 7 machine runs Home control assistant which gives access to Insteon control as well as the USB relay boards from both PC and Phone.

The Debian machine is configured with Apache2 for web, Mysql database as well as running python scripts to poll the various sensors and insert the data into Mysql.

virtualbox

I currently am using two different sensors. The water proof DS18S20 temperature sensor and the DHT22 temperature/humidity sensor.

Further DHT22 sensors will be added to both the bathroom and en-suite to allow humidity based extraction fan toggling.

Sensor overview:

table

Temperature graph:

Temp

Humidity Graph:

Humidity

Currently all sensors are polled every 5 minutes and saved into Mysql. Graphing is done with jpgraph in PHP which I need to spend sometime on to get looking right/nice.

Another database keeps track of each time the door bell is pressed and I plan on making a PHP front end for it that will link to the pictures, etc.

I’ve also ordered a cheap weather station with wind speed, direction, rain collection, temp and humidity that allows USB data collection which I will add in as well which will hopefully give a good location weather overview and will allow me to control sprinklers, etc based on rain, etc.

Door bell system has been put into it’s new case and is ready to be mounted just need to run the CAT5 to it’s new home which should hopefully get done over the weekend.

Raspberry Pi Doorbell and Camera Part 1

After missing several people knocking at the door it was decided a doorbell was in order but I didn’t just want some annoying ringing bell to drive me nuts so after seeing Ahmad Khattab’s project on Hackaday here planning began on my own Raspberry Pi based door bell.

You can find Ahmad’s original Github repository here and Google doc with build instructions here.

Parts List:

Raspberry Pi Model B

Raspberry Pi Camera

Cheap wireless doorbell

Weather proof Case

 

I downloaded the complete SD image from here and used Win32 Disk Imager to put the image on an 8GB SD-Card after boot I went in and modified the code slightly by commenting out lines related to the LCD as I won’t be using it and have added support for Pushover a service that allows for push notifications to be sent to iOS, Android and also desktop browsers.

I also modified camera.py to take two pictures one at 800×600 which is emailed and a second at full resolution which is later copied to my NAS for storage.

launch.sh is used to start it monitoring the GPIO pin, I added this as a cron job on reboot.

Can download the modified files here.

The files that need to be customized for use are:

send_email_fast.py – Set your email address and SMTP server

send_email_attachment.py – Set your email address and SMTP server

pushover.py – Set your Pushover User and App Key’s

run.py – Un-comment and set path if you wish to copy the picture to a network share

There is also Google hangouts, twitter and Zapier support but I have not used them here.

 

With the software sorted it was onto the hardware:

DSC_1198

I stripped the circuit board from the receiver unit and un-soldered the speaker and battery connectors and replaced them with new leads. Someone was even nice enough to silk screen the board with all the appropriate labels.

DSC_1199

I then connected the battery leads to 3.3v (Pin 1) and Ground (Pin 9) and the speaker leads to GPIO7 (Pin 26) and Ground (Pin 25) for my build I omitted the 10K resister and am yet to have any issues.

gpio

DSC_1200

DSC_1222

A quick test and seconds later both a pushover notification and E-Mail arrived:

notification

Open up the email and we find the picture attached:

email

I’m still awaiting my case from China after it arrives the next step will be to mount all the hardware in the case, run a network cable to the location and wire up PoE for the unit.

I also intend to add support for the camera to be triggered by the motion sensor out the front for when I’m away or asleep for security.

 

Read on in Part 2

Wolfson Audio Card for Raspberry Pi

I had no end of trouble trying to download the SD-Card image from the Element14 website. Downloads stopping half way through, page being unavailable, etc but managed to find another smaller image that had been compiled on the forum.

You can see the original post here and the direct download from Google drive here.

Got it all installed and booted only to find my Audio board was DOA, after a quick phone call to Element14 a replacement was sent out.

Once it arrived I booted up Raspberrian and installed Shairport this time the card was detected correctly and played sound 🙂

DSC_0744

DSC_0745

All powered up:

DSC_1162

This particular Raspberry Pi runs the speakers in the Kitchen and on the deck and the difference in sound quality from the onboard to the Wolfson card is significant. Will be looking at getting at least one more for the lounge.

Would certainly recommend it if you are using your Raspberry Pi for analog audio.

uRAD Monitor Flash Update

I recently received a firmware update for my uRAD Monitor so I thought I’d share my experience on it.

The new firmware adds a local web interface to few current stats as well as encryption back to the server.

You will need a ASP programmer that is capable of 3.3v, the firmware which you will have to request from Radu and avrdude for the flashing.

You can download avrdude from here.

I picked up a cheap ASP programmer from eBay for around ~$3 supporting both 5v and 3.3v.

Make sure the jumper is set for 3.3v.

DSC_1122

I then pulled down my monitor and removed the two screws on the back of the unit:

DSC_1127

Connected the programmer and powered it up, be careful as the orientation of the programmer may be different to mine!

DSC_1129

Fired up a command prompt and avrdude to download the firmware to the flash:

Command

Put the unit back together and reinstalled outside, after a few seconds the unit was back up and now responding with the new web interface:

web

Over all a pretty easy process, I look forward to future updates and am intending on building a weather station in the near future to be able to match weather data with the radiation data.

Front Door Electric Lock Part 2

Well after 2+ months of waiting for parts that never arrived I gave up and ordered new ones.
Rather annoying but did mean I went ahead and got better parts instead.

Instead of an all in one RFID/Controller I got a LAN connected controller board that supports up to four RFID readers and two doors.  This allows for more control in terms of users, time in/out and easy lock out of existing tags. Also means when I add in the garage door I’ve already got all the supporting equipment.

One extra feature that I plan on using is keeping an eye on the occupancy of the house so when everyone has taped out can switch off lights, heating, etc to save power.

I had already run a length of speaker wire to the door striker location and a length of CAT5 to the position of the RFID reader so hookup was pretty easy, the RFID reader uses 5 wires in total: +12v, GND, Data0, Data1 and LED

Was then just a matter of installing the software and entering the users. The wizard asks you to tap the tag on the RFID reader and then you add a name, department and any other information you want about the user.  You can then set access privileges on a per door and user basis. Software is quite overkill for this application (can support something like 20,000 users…) but for the price who cares 🙂

And onto the pictures… I plan on making a video showing the door operation as well.

Electric Strike lock wired up.
Electric Strike lock wired up.
Delivery :D
Delivery 😀
RFID Tag
RFID Tag
Control board all wired up
Control board all wired up
RFID Reader connected up
RFID Reader connected up
RFID Reader Mounted up
RFID Reader Mounted up

 

Outdoor Kitchen Build Part 1

With summer approaching thought it best to get started on the outdoor kitchen I’ve been planning for the last ~12 months.

Plan is to have BBQ, oven and sink all out on the deck save having to cook inside on the really hot days ahead.

On the electronics side got a 12″ sub mounted in one corner of the kitchen to back up the mounted line array and a 32″ telly mounted on a swinging bracket which will be driven from the raspberry pi inside via HDMI-CAT5 converter.

Most of the construction has been done, have to finish off cupboards, draws and put some paint on and some trim here and there. Also still got power and several runs of CAT5 to do.

Onto the pictures:

Base built
Base built
Coming together
Coming together
Placing parts
Placing parts
All screwed down
All screwed down
Bench all done
Bench all done
Cupboard doors hung
Cupboard doors hung

 

Back all on
Back all on

 

TV Bracket
TV Bracket
TV Mounted
TV Mounted

 

Relay Board Arrived

USB->Serial four channel relay board arrived on Friday and got a chance to start playing with it over the weekend.

Currently one relay is used to locking/unlocking the front door and the second for switching power to the amp which runs the Kitchen speakers. Deck amp and an extraction fan to cool the rack will most likely fill the last two.

Relays all off
Relays all off
All relays on
All relays on
Relays wired up in the cupboard
Relays wired up in the cupboard

Unit is nice and easy to control simply a case of sending the ASCII character for the command you want to the serial port.

Table of commands

I’m using Home Control assistant running on a Windows 7 virtual machine which allows control of Insteon, X10, serial and IP devices. Below is the interface on the PC.

Home control assistant running on the Windows 7 VM
Home control assistant running on the Windows 7 VM

For opening the door it runs this small script/program which unlocks the door then waits 5 seconds before locking the door allowing you time to open it.

Visual program for opening the door

Visual program for opening the door
Command for sending data to the serial port
Command for sending data to the serial port

And here is the interface on Android.

View of the Front Yard on the Android app
View of the Front Yard on the Android app
View of the Kitchen on the Android app
View of the Kitchen on the Android app

Other end connected to the electric strike lock. Apply 12v and the tongue moves freely.

Electric Strike lock wired up.
Electric Strike lock wired up.

Can read more on the install of the lock here.

RFID parts still are yet to arrive which is the final step for the lock.

 

Car Stereo Status 8-14

Bit of a different post this week. Just a look at the current state of the car stereo install which is soon to get some attention now the sun is out 🙂

System is 95% functional most of the work to be done is cleaning the install up and making it all fit back together nicely.

System consists of:

-Acer Aspire One netbook with screen removed

-Creative Sound Blaster Play USB sound card

-7″ Double DIN VGA touchscreen

-Swiss Line SL-Q400 EQ and crossover

-Rockford Fosgate POWER! 6.5″ speakers (Fronts)

-Sony Xplod 6×9″ (Rears)

-2x Pioneer 12″ champion series (Not sure on model)

-Response AA0460 1000w Mono Block running at 1ohm

-Response AA0458 5 channel amp 4x60w 1x225w

 

Screen was removed from the laptop to allow good fit in the glove box and easy access if keyboard/touch pad use is required, handy for passengers looking for tracks, etc.

A USB cable then runs into the dash to a hub which has the connectors for the USB sound card, touch screen, SD-Card reader.

Laptop with screen removed in glove box
Laptop with screen removed in glove box

From the USB sound card it’s connected to the input of the Swiss Line SL-Q400 EQ which splits the signal out to the 5 amp channels (Front, Rear, Sub).

Swiss Line SL-Q400
Swiss Line SL-Q400

The left power button on the screen powers the laptop on and the right button powers the screen and changes screen input.

 

7" touch screen
7″ touch screen

The current state of the dash as it stands now. I still have to wire in a relay and the DC->DC converter for the laptop power. It’s currently running from an inverter.

After that the dash can start to go back together.

Current state of the dash
Current state of the dash
Rockford Fosgate POWER! 6.5" speakers
Rockford Fosgate POWER! 6.5″ speakers
Power splitters and breaker
Power splitters and breaker

 

Current state of the boot.

 

Subs and amps
Subs and amps
2x 12" Subs
2x 12″ Subs

Hopefully I will get a chance this week to get back to the car and finish off the install.

 

To-Do List:

-Build panels and mount amps

-Dynomat front doors and boot

-Carpet boot

-Replace rear speakers

-Change 5 channel amp out for 4x100w version

-Dash back together

-DC->DC converter for laptop power

-Update laptop software to Centrafuse

 

 

Quick update 19-8

Still awaiting delivery of the RFID unit and power supply for the electronic lock so haven’t been able to make much progress on it other than running cables to the lock and position for the RFID reader. Hopefully should be here in the next few days.

In the mean time I have been playing with home automation software and think I have found the one I’ll use as it can interface not only with Insteon and X10 but any serial or IP connected device which will allow me to pull temperature, humidity, voltage and all sorts of other data into the system on which to make decisions from.

eg: turning the bathroom fan on when the humidity rises, cooling fan in the rack when the temp rises, email/sms notification of power outages, etc.

The software is called Home Control Assistant and is around $160.

I have ordered a USB/serial connect 4 relay board that I will interface with it to allow low voltage switching for things like the Kitchen amplifier, cooling fan in the rack and also to be able to unlock the door from the automation interface.  The unit is also capable of bluetooth or WiFi with a module but will be connected via USB. Picked it up for $35 on eBay.

Relay board 1

Relay board 2

 

Have also ordered a pair of DHT22 temperature and humidity sensors and a 5 pack of DS18B20 water proof temperature sensors.

DHT22 Temp & Humidity
DHT22 Temp & Humidity
DS18B20 Temp
DS18B20 Temp

DHT22’s will be mounted in the bathroom and laundry to allow automatic fan control when humidity rises.

DS18B20’s will be used mostly for data collection and also to trigger cooling fan for the rack.

More coming when the post man gets here 🙂