Showing posts with label Arduino. Show all posts
Showing posts with label Arduino. Show all posts

Saturday, August 04, 2012

ARDUINO GOES NETIO

Has anybody of you ever had the idea to have an Arduino board remotly controlled!? If the answer is yes the good message is: there is an wonderful iPhone / iPad / Android App for that called NetIO. It's a very powerful and besides that generic solution (it's not just the App!!) to get your friends Arduino and iPhone connected. It communicates via a socket interface, http request will be supported soon. It comes along with a very nice webtool to design the iPhone App frontend and function. The outcome is a configuration file which will be loaded to the iPhone by using the simple fileshare mechanism of iTunes (in the Apple case of course).


I did a simple test setup to control a LED or whatsoever by using NetIO


First thing I did was to do a bit of Arduino coding on the IDE version 0022 based on the code examples on the NetIO website. The hardware that's needed is the Arduino board plus a connected ethernet shield (see setup below). I adapted a view parts an ended up with the following sketch:


DROBBOX LINK of IDE 0022 Arduino sketch for remotely control a LED via the iPhone

Then I thought of the following hardware setup:


circuit setup

...and ended up with this:

layout

Of course it's not necessary to use the opto device. But the secondary circuit can simply be removed and the output could be used to connect to e.g. a remote control. In that case both circuits will be completely separated. You need to connect the ethernet cable and the power source for the Arduino.

layout in detail


As soon as that's done you can log on the NetIO webpage and design your App as described on the website.

NetIO Configurator screenshot



You can download my default.json file here:


DROPBOX LINK of default.json


After that you can download the xxx.Json file and add it to your iTunes library in the App/NetIO section. As soon as it is transferred to the iPhone correctly, the App connects to the Arduino and that's it. I know there is a bit more than that, but honestly: as soon as you worked out the system it's easy to adapt.


NetIO iPhone App screenshot


The good thing is that you can connect to multiple sources, also PC connectivity is given. And as soon as http requests are available with the App version 1.4, you could possibly control everything.


My next step will be to control a bit of my power stuff via FS20, like turning the lights on and off. My final goal is to setup a home automation server. And I guess it will be controlled via NetIO.

Sunday, April 03, 2011

ARDUINO OFFICE MAIL PUSH ALERT

Inspired by the MAKEZINE guys I was getting more and more interested in the Open Source ARDUINO project. I was Especially interested in the SNAIL MAIL PUSH ALERT notification, previously presented by MATT RICHARDSON.
So I ended up with the idea of doing some kind of home office notification stuff. I wanted to get iPhone notifications if mail had been delivered to my office in-tray:





It works like that:

  1. mail is delivered to in-tray
  2. sensor connected to Arduino is detecting this action
  3. Arduino send’s http request to webserver
  4. Webserver queries PHP script / PROWL API
  5. Prowl is forwarding the notification to my iPhone

1 Basic Setup:

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.

Thirdly I ordered the ARDUINO UNO with the ethernet shield.

Fourthly I obtained a few additional components:
-          an in-tray to work on
-          a 10k resistor for the photo transistor
-          resistors (10k, 270) for the infrared LED
-          some wires
-          a housing for the Arduino
-          a circuit board
-          an angled piece of plastic

2 Hardware installation:
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.

If you got questions, simply shoot me a mail: spinout@freenet.de