First of all I had to answer the question, which sensor type should be best, because obviously a snap action switch wouldn’t work for an in-tray. Also PIR sensors aren’t very useful – they just detect motion. LDR’s have the disadvantage of reacting to ambient light. Finally I ended up with integrated reflective sensors, in detail I choose the APDS-9103. They work on basis of an infrared LED and a photo transistor, both placed in the same housing. As soon as a reflective surface is placed to it within a 10mm range they react. This sensor type is typically used in copy machines or printers. During my testings the sensor worked perfectly. Furthermore you can get it for just about 1 Euro.

Secondly I needed a webserver, because the Arduino itself isn’t capable of doing ssl encryption, which is required by the Prowl API. I decided to choose the MAMP software, it comes along with the webserver itself, but furthermore MySQL and PHP is already included.

In-tray: it’s simple: drill a whole into the middle part of the in-tray, about 10mm in diameter. Glue the angled piece of plastic to the bottom of the in-tray, nearby the drilled whole. Glue the sensor to the angled piece of plastic. Solder the wires to the sensor to cover the distance towards the Ardunino. Cover the bare pieces with tape, better is heat shrink tubing. Install the wires towards the Arduino.

Arduino: You could do the wiring stuff with a breadboard or directly on the Arduino connectors. I decided to setup a permanent housing with a circuit board for future extensions. Place the etehrnet shield on top of the Arduino an connect it via RJ45 to the network.

That’s all that need’s to be done in terms of hardware.

3. Webserver Installation

Of course there are many webservers out there. For Greenhorns like me, the Mamp Server has all I need and is easy to install.

4. Prowl API

First of all you need to subscribe for a PROWL ACCOUNT. It’s for free. Download the PROWL API and follow the setup instructions. I decided to use the port 8888 within my internal network. Adapt the directory path, matching to your setup.

5 Arduino Configuration

I can provide the code sketch via eMAIL. Don’t get confused – it contains another code piece for detection activity of my network attached storage (NAS) device. What does the code for the Mail part do!? It measures a series of multiple values of the sensor input. If more than a definable amount of values are above the threshold a variable will be set to active. That’s just to be sure that not just a glitch will set the sensor active. Further more the Arduino code will just react for status changes from 0 to 1 from one period to the following one. If this is the case, the http request will be sent.

6 iPhone Setup

You just need to download the Prowl App from the App Store and enter your account details. That’s it.