What You Can Do When A Raspberry Pi Teams Up With An Arduino

We thought that connecting an Arduino to a Raspberry Pi was overkill, but one thing caught our attention. [Jan Stevens] mentions that the RPi is less expensive than the Ethernet Shield. Interesting. As we looked into his writeup a bit more we began to think he’s onto something. [Jan] uses the PHP serial class to communicate between the RPi and Arduino (dead link; Internet Archive). This ends up being a very inexpensive way to bring some of the more powerful web programming options to your hardware devices.

Sure, he’s just driving three RGB LEDs. But the demo video after the break gives us a glimpse as some of the interface options that become available when an embedded Linux machine is in play. He’s using jQuery, AJAX, PHP, and JSON to name a few. If you want to give this a try yourself you can grab the code from his Github repo. Of course we’re going to want to hear about any projects you develop from this starting point!

Continue reading “What You Can Do When A Raspberry Pi Teams Up With An Arduino”

Turning A Light Off Over The Internet

Because reaching over a few feet to turn off a switch is too much to bear for [Bruce], he connected his desk lamp to the Internet. It’s a pretty cool build that’s the perfect tutorial for connecting just about anything to the internet.

For his build, [Bruce] used an Arduino with a relay attached to an output pin. When the Arduino receives a signal on its serial port, a tiny voltage is applied to the relay, turning on the light.

This could have been done with an Arduino Ethernet, but the PHP script [Bruce] went with is a little more versatile. Whenever someone pulls up this digital light switch web page, they can turn [Bruce]’s desk lamp on and off.

For an introduction to connecting bare bones projects to the Internet, we’re really liking [Bruce]’s build. Just try no to go crazy with that link and leave the failure testing to the professionals. You can check out the demo video after the break.

Continue reading “Turning A Light Off Over The Internet”

Detecting ASCII Art Across The Internet

As a web developer and designer, [Victor] has a habit of putting a very nice ASCII signature in an HTML comment at the top of every web page he designs. He was inspired by seeing others do this,  and this piqued his curiosity to see who else was doing this. His idea was to scan through a chunk of the Internet and see what other web pages had ASCII signatures in an HTML comment. With a lot of very clever work, [Victor] managed to grab some interesting ASCII art that would have been missed without looking at the source of millions of web pages.

After gathering a list of the top million top-level domains from Alexa, [Victor] wrote a script to download the HTML for all the pages in parallel. After that, it was just an issue of detecting the ASCII art in all the HTML files. There were a few earlier ASCII art detection algorithms, but nothing that suited [Victor]’s use case. The best result came from only looking at the first comment (otherwise the signatory wouldn’t want you to find it with a quick glance at the source) that were at least 3 lines long and 40 characters wide. After discarding everything with HTML tags in it, [Victor] had an awesome gallery of the ASCII art from webpages all around the Internet.

What did he find? Well, there’s far too many ASCII signatures for [Victor] to put up on his webpage, but he did provide a nice sample of what he found. They’re mostly logos, although there is a Hypnotoad and Aperture Science sentry turret in there.

If you’d like to try out [Victor]’s script, he made everything available on GitHub.

Smartphone Operated Garage Door Is Beginning Of Arduino Home Automation System

[Tim] is showing off the first step in his home automation projected with this smart-phone garage door interface. In the video after the break you can see him open and close the garage door with the touch of a button. There’s also an open or closed indicator that he can check when away from home.

An Arduino takes care of a portion of the control for this project. Like the post we saw yesterday, he’s using PHP code on a webpage to manipulate the Arduino via its USB connection in order to open and close the door using a relay. The door status is also monitored by the Arduino and sent to the PC over the serial connection. The computer uses a Python script to monitor the incoming data and update a text file which is merged into the web interface using a PHP include. Future plans for the system include adding control for heating and air conditioning systems.

If you’re looking to do something like this but wirelessly here’s some advice on ditching the Arduino and using an XBee module instead.

Continue reading “Smartphone Operated Garage Door Is Beginning Of Arduino Home Automation System”

The Basics Of Controlling An Arduino With PHP

You can easily add Internet-based control for your Arduino if it is close enough to your server to be connected via USB. This tutorial will give the basics you need to get it working.

The gist of this method involves a webpage that includes PHP elements. When one of those elements is manipulated, a command is sent via serial connection to the Arduino which then reacts based on what it received. This example uses an Ubuntu box that is running an Apache server. The Arduino sketch sets up the serial connection and then listens for incoming traffic. Whenever it receives a non-zero character an LED will blink. On the server side of things you’ll need to make sure that the system user that runs Apache (www-data) has permission to write to a serial port.

This base example may seem extremely simple, but there’s no end to what you can build on top of it. Different PHP events can be added to push new commands over the serial connection with matching test conditions added to the sketch.

[Thanks Jarryd]

PC Monitor Sleep Mode Using IPhone

[Mike Silverman] rigged up a way to make his monitor sleep from an iPhone. Working with a Windows system, he installed QuickPHP and NirCmd to add PHP and command line controls. Some quick PHP code writing and this has the effect of creating a sleep button toggled via a network address. He loads up the IP and port information in the Safari browser of his iPhone, creating a Home Screen short cut seen in the image above. Now he clicks on the button and puts the screen to sleep.

It’s not that we find this functionality useful since most monitors sleep after a few minutes of inactivity. But we like the methodology and you can bet we’re already planning uses for this. Any PHP server (like the copy of Apache running on this machine) will do as long as it’s on the same LAN as the iPhone’s WiFi connection.

Network Enabled Window Air Conditioner

It’s no secret that the central US is feels like a very humid oven right now. [Erik’s] window AC hack might help you out if you’re coping with triple-digit temperatures. He added network connectivity to the unit above but the picture is a bit deceiving. The blue CAT-5 cable that enters the bottom isn’t connecting directly to the network, but extends the up and down button connections for the unit to an external relay board. From there he uses an SNMP board to connect it to the network and uses PHP commands to reset the temperature. The unit has a working range of 66-88 degrees Fahrenheit so he cycles enough button press to reach the maximum or minimum level, then sets the desired temperature (avoiding the need to know what temperature the unit is currently set at).

If you’ve got an AC unit with a remote control you could always use an IR device to patch into the system for similar functionality.