

Turn a light bulb on with every new user or download  - rigoneri
http://rigoneri.com/post/49229364680

======
ra
BIG FAT WARNING: If you're going to relay your Raspberry Pi / Arduino to mains
electricity, be very, very careful!

Mains electricity can KILL. Make sure you learn about safe shielding,
connecting and grounding practices.

Above all, be extremely cautious!

I can't stress this enough.

EDIT: For more information: <http://tubelab.com/Safety.htm>

~~~
ars
Better yet: Don't connect your Raspberry Pi / Arduino at all to mains
electricity unless you use an opto-isolator, or you have training in designing
such circuits.

The usb relay is NOT designed for this! See the picture:
<http://www.circuitgizmos.com/products/cgu451/cgu451.shtml>

In a device intended for hybrid hi/low voltage there is a clear gap between
the high and low voltage components, and an isolation transformer or opto-
isolator between them.

~~~
glimcat
I have training in designing such circuits and I'd still use an opto-isolator.

This is not manufacturing. It's a one-off project. It's not a highly refined
design. You don't have to worry about finessing a marginally lower build cost
because of what it will mean in 10k unit quantities. Just use the opto-
isolator.

------
jacquesm
This falls - as others have already commented - in the 'knows just enough to
be dangerous' category.

Please use LEDs, don't even bother messing around with opto-isolators and so
on unless you have experience with both mains electricity and designing safe
circuitry.

~~~
tehwebguy
Agreed 100%. Not happy with the Pi's 3.3v pins and want to light something
brighter than a couple of LEDs? Try this:

\- 12v power supply (from like anything in your house)

\- 12v LED strip (super cheap on eBay or basically anywhere)

\- This awesome MOSFET from Adafruit <http://www.adafruit.com/products/355>

This is what I used for a cool RPi + RFID + LED project this year, write-up
coming eventually, here's a clip for now: <http://vine.co/v/bvZQVJLnemh> \- my
example only has a few LEDs but in the final product I used strips with about
30.

------
mnutt
This seems like a really great use for raspberry pi. I recently finished a
project involving a pi + a relay to activate a door buzzer, written in
javascript. It was surprisingly simple and straightforward.

Besides turning on lights, the cool thing about relays is that most things
involving physical push-buttons can be taken apart and easily wired up to a
relay.

~~~
stephengillie
Arduinos can (supposedly) host webpages, and pins can be powered or depowered
by (properly parsed) HTML POST commands. Combining this with a relay means we
can create WIFI website interfaces for anything that uses electricity.

The opportunities to improve current products are so endless that I become
overwhelmed whenever I think about this. We all have the parts to do this
today, but so few are assembling them.

\---

Want to set an outlet to turn on or off at different times? No need to buy a
timer, just goto that outlet's website on your WIFI LAN, and set it on a
timer. Or you could depower the outlet to make it child-safe.

Are you going on a trip and you're afraid you left the toaster plugged in and
your house might burn down? Just VPN to your home LAN, sign into your
kitchen's website and have it power off all outlets.

Locked out of your car? Pull out your phone, securely sign into your car's
website, and tell it to unlock the doors.

Power and depower garage door openers, sprinklers, RC cars, even industrial
equipment from a simple web interface.

~~~
noonespecial
Couldn't agree more. I wrote a blog post about it a while back demonstrating
my take on this. Here's common household appliances getting web interfaces
that can be accessed with any smartphone by QR Code. No arduino or soldering
mains current required. I think every electronic thing in my house should have
a little QR Code next to it so I can just point my phone at it and get its
interface.

<http://www.thesinglestep.org/thoughts/qrcontrol/>

The video halfway down shows it in action.

------
joshu
Working with mains power is stupid. Don't do it if you can avoid it,
especially if you don't know what you are doing.

You can get a small remote power switch for $100 or so.

~~~
john_w_t_b
Belkin WeMo is only $49 and programmable via IFTTT.

Edit: $45 on Amazon at present.

~~~
alex_h
We've had success with a WeMo and this project:
<https://github.com/issackelly/wemo> which lets you control the WeMo switch
from within your local network. A quick python script to query the database
for new users followed by calls to on() and off() works great.

------
ultimoo
This is when I feel envy toward engineers who can program hardware. I'm so
involved with Ruby and HTTP and CSS etc. that I have negligible knowledge
about Arduino, Raspberry Pi, and Beaglebone.

I don't even know where to start and whether it will be a fruitful exercise
(i.e. will I be able to devote sufficient time to it to actually learn
something worthwhile).

Anyway, this is a neat project and I wish you good luck OP!

~~~
izak30
With any of these three platforms you could be doing this project in an
afternoon. Processing isn't any harder than Ruby. You can do it.

Check out <http://Raspberry.io> for some resources the python community put
together to use Raspberry Pi

Check out makezine for resources designed for people who aren't even familiar
with programming. It doesn't take much to get up to speed with some basic
on/off circuits. With a little high-school physics or just some asking around
of friends you can get custom devices going.

------
stillmotion
I built something similar recently to flash a light every time someone buys
something on Creative Market (video here <https://vine.co/v/bTnnTVmH5eD>). I
know nothing about mains electricity, so I pulled together an Arduino and a
LED with a bit of socket work to get a green light flashing. Once someone
completes a sale, a piece of Javascript is requested from a Node.js HTTP
server I setup. The server then pings the computer with the Arduino plugged
into it over UDP and the client sends a serial response to the Ardunio,
flashing the light. It's pretty simple, but it was fun to get all the
components together and learn more about hardware development. Since a flash
of the LED is requested on every sale and the UDP responds pretty quickly, it
acts as a great thermometer during high sales peaks.

I'm now in the process of abstracting the entire thing into a self-contained
box that communicates over wifi and uses mains electricity. Hopefully I don't
kill myself.

------
droopybuns
Cool project!

Maybe iterate it to use LEDs instead of incandescents.

For hardware hacking- you have 3 types of hardware that can make life easy-
but there are tradeoffs:

1) Arduino 2) Raspberry PI 3) Beaglebone

Arduino is great when you want low power, but it isn't an awesome internet
platform.

Raspberry Pi is great when you're going to leverage a full blown PC Monitor,
but using it for hardware hacking requires a bit of elbow grease

The Beaglebone is great for when you are doing something internety & hardware
hacky, but without a full blown pc monitor.

I would have done your project with a beaglebone, fwiw. I'd also have used
LEDs instead of incandescents. But this is a great project! Nice work!

~~~
nkozyra
Never forget the MSP430, which is either $5 or $10 depending on when you hit
it.

------
sly010
Nice one! When I did something similar, I found the clicking sound of the
relay more satisfying, than a lightbulb, so I eventually completely removed
the lightbulb.

At the time I used MacMini, which was a tiny bit expensive for this very
purpose (also not everyone in the office likes a blinking light 24/7) then
eventually I came up with the following oneliner:

tail -f "<access_log>" | grep --line-buffered "<whatev>" | sed -ue
"s/^.*$/\x07/"

I also needed to set the terminal bell to be a "click" instead of a "bell" for
this to sound acceptable during moderate traffic.

------
nhayes-roth
For a larger company with more signups/uploads, I'm envisioning a wall of
LEDs, controlled by an Arduino board.

~~~
masonhensley
Or better yet, make it interactive with something like this:

[http://shop.evilmadscientist.com/productsmenu/majors/150-pan...](http://shop.evilmadscientist.com/productsmenu/majors/150-panelkits)

Peggy's could be fun too:

[http://shop.evilmadscientist.com/productsmenu/tinykitlist/75...](http://shop.evilmadscientist.com/productsmenu/tinykitlist/75-peggy2)

~~~
nhayes-roth
The Peggy 2 looks really neat. I just might spend some time on this during the
summer...

------
rschmitty
Hook up a USB Flashing Police light to failed CI builds

[http://www.amazon.com/Rhode-Island-Novelty-Police-
Beacon/dp/...](http://www.amazon.com/Rhode-Island-Novelty-Police-
Beacon/dp/B0011CZV5A/ref=cm_cr_pr_sims_t)

------
roycehaynes
I think a blend of raspberry pi + phillips hue lights + data + code = awesome
product.

~~~
lostlogin
Newman 314s idea of email tags triggering a different light colour, combined
with this...

------
newman314
I would build one for new email alerts, a different color for each account...

------
rocky1138
I wonder why he didn't use something like IFTTT.

~~~
rowborg
I built this for our company using IFTTT; we have a little blue siren that
goes off when a user converts. It's powered by the production app sending an
email to IFTTT which power cycles a Belkin WeMo. Very simple, and it works
quite well (excepting for a 10 second or so delay between the conversion and
the siren going off).

------
sugandhan
Awesome! :) \m/

