Introduction: Facebook LED Blink on New Notifications and Messages

In this instructable I will show you how to make a LED blink when you have a new notification or message on Facebook via the parallel port. Check out the following video for a demonstration:


It is a quick and easy project to do, provided you have the required stuff.

Step 1: How Does It Work?

There are two parts that power this project.

The first part is a small program that turns on or off the LEDs that are on a parallel port using inpout32.dll. The program hosts a tiny server that its one and only purpose is to understand HTTP requests.

The second part is a Greasemonkey script that detects when you have a new notification/message.
If you have a new notification or a message, the script will request a URL from the server the program described above hosts, and the program will understand the URL, and will start blinking the requested LED.
After you read your new notification/message, the script will request the same URL as before, which tells the program to stop blinking the LED.

Simple eh?

Step 2: Requirements

You will need:
- Windows (also works with x64 versions)
     It should be possible to make this work on Linux, but not on a Mac, because as far as I know, Macs do not have a parallel port
- A parallel port
     Most new computers don't have an integrated parallel port, so you'll have to buy a PCI-to-parallel card yourself. From what I read on the internet, not all cards will work, and USB-to-parallel also won't work.
- Mozilla Firefox with the Greasemonkey extension installed or Google Chrome (Opera might work too)
- 2 LEDs
- Centronics Printer cable (optional; I use it as an extension cable)

Step 3: Download and Configure the LED Blinker

Download the LED Blinker from this step's attachments, and unzip it somewhere.

Open Device Manager (you can do that by pressing WindowsKey+R and typing devmgmt.msc in the window that comes up), double click on Ports (COM & LPT), and then double click on your parallel port (it is usually listed as ECP Parallel Port or Printer Port or something similar).
On the new window that comes up, click on the Resources tab and note the first part of the I/O Range setting (check the attached screenshot). *

Once you have that, go to the folder where you unzipped the application, and open the address.txt file. Replace the contents of that file with the address you noted above (again, check the attached screenshot), and save it.

Once that's done, double click on LEDBlinker.exe to open the application (note: On Windows Vista/7 you must run it as an administrator for the first time!). You won't see anything, but you can verify that the program is running by looking for it in the Task Manager. If you have a firewall, it might warn you that the program is trying to listen on port 4012. You must allow it for the program to work (for more information check step 1).

Note: If you are getting an error when you run the application saying that it can't find mswinsck.ocx, then download it from here, and place it in the same folder as the program. It should work then (again, if you're using Windows Vista/7 you'll have to run it as an administrator for the first time).

*: If there are more than one I/O Ranges, then try them all until you find the one that works. Make sure you terminate LEDBlinker.exe via the Task Manager every time you change address.txt.

Step 4: Connect the LEDs to the Parallel Port

If you are using a printer cable, check the third picture for reference, otherwise, check the second.

Connect the longer lead* of the first LED to bit 1 (check the pictures mentioned above), and the shorter to any of the ground (GND) pins (it doesn't matter which one you choose). This will be the LED that will blink when you have a new notification.**

Connect the longer lead of the second LED to bit 6, and the shorter to any of the ground pins. This will be the LED that will blink when you have a new message.

To check if the notification LED is working click here (stop blinking).
To check if the message LED is working, click here (stop blinking).
If the LEDs aren't working, make sure that the LEDs are correctly inserted (try moving them a little), and that the LED Blinker is configured correctly and running.

*: If the leads of your LED have the same length then find the flat side of your LED. Connect the lead of that side to any of the ground pins, and the other to the bit pin.

**: It is possible to change that, but you will have to make a tiny change to the Greasemonkey script.

Step 5: Install the Greasemonkey Script

After you make sure the LEDs are working correctly, it's time to install the Greasemonkey script. The Greasemonkey script can be found here: http://userscripts.org/scripts/show/82985
Click the above link, and then click the Install button and acknowledge the warning.
After you install the script, reload Facebook.

You're done! :)

Step 6: Some Things to Keep in Mind...

LEDBlinker.exe has to be open at all times, so it might be a good idea to have it run on startup when Windows boots.

Your browser also has to be open at all times, with a Facebook tab open.

The part that detects new messages has a limitation: You must already have a chat window open and minimized with the person that sends you the message; otherwise, the new message will not be detected.

Comments

author
Matthay213 made it! (author)2013-03-13

Hello, My message light don't work with the message box up and minimized. It will turn on with the link provided but not when i get a new message. Any ideas?

author
brunoip made it! (author)2012-07-04

Can you upload the LED Blinke again? The link is not working

author
Stonos made it! (author)Stonos2012-07-04

Sorry about that. I attached the zip to step 3.

author
webart made it! (author)2010-08-06

hi guys I just wonder, can I use this and make it work same way ? http://www.dcs.dk/CNet/digitalcontent/ccs/6D1382DF-846B-4B5A-B64C-85D337E875AF.jpg

author
Stonos made it! (author)Stonos2010-08-06

Sorry, as far as I know, USB-to-parallel cables won't work :(

If your computer doesn't have a parallel port, then you'll have to get a PCI-to-parallel controller (unless you are on a laptop, so you're out of luck). I use this one, but if you can't find that particular model in your country, then you can try this one, which should work, since it uses a chip similar to my card.

author
cooltech786 made it! (author)cooltech7862010-08-07

any chance this can be done with a serial port (unfortunately dont have a parallel port or any open PCI ports) - Thanks!

author
Stonos made it! (author)Stonos2010-08-07

Unfortunately, I don't think it can be done with a serial port. Sorry :(

author
DarkStar851 made it! (author)DarkStar8512010-08-07

Yeah, Serial ports are strictly rx/tx data transmission pins. No voltages suitable for LED fun. :(

author
AZsid made it! (author)AZsid2012-01-29

Oh, it can be done. I don't know about this script but I've been doing it in VB by switching the DTR and RTS pins on and off to tell me if I have email. I've also been doing it with a USB to Serial adapter so I don't need an on board serial port.

I guess the first step is to see if inpout32.dll ca handle serial port action or if it strictly does parallel ports.

author
JTigchelaar made it! (author)2010-12-29

the message light doesnt work? plz help

author
Stonos made it! (author)Stonos2010-12-30

As described in step 6, there are some limitations regarding the message LED: "The part that detects new messages has a limitation: You must already have a chat window open and minimized with the person that sends you the message; otherwise, the new message will not be detected."

Make sure that the LED is correctly connected (does the message LED start blinking when you visit http://127.0.0.1:4012/6/on ?). Also, make sure that you're using version 1.2 or newer of the script.

author
JTigchelaar made it! (author)JTigchelaar2010-12-30

oh its for chat not an actual inbox! Is there an way to modify the script so it detedts inboxes?

author
Stonos made it! (author)Stonos2010-12-30

Replace line 12 ("var notifCount = jc.getElementsByTagName("span")[0];") with "var notifCount = document.getElementById("jewelInnerUnseenCount");".

Keep in mind that this will replace the new notification blink function. If you want to keep both functions, I can modify the script for you to include both functions.

author
JTigchelaar made it! (author)JTigchelaar2010-12-30

please do

author
Stonos made it! (author)Stonos2011-01-01

The script has been updated :)

author
JTigchelaar made it! (author)JTigchelaar2011-01-01

does the new code only use the one LED becasue the one still wont flash when i get a message

author
Stonos made it! (author)Stonos2011-01-02

Yes, it's still on LED 1.

Some questions:
Does the LED blink when you go to http://127.0.0.1:4012/1/on ?

When you receive a message on Facebook, does it say that you've got an unread message at the top of the page (where the friend requests and notification buttons are)?

author
JTigchelaar made it! (author)JTigchelaar2011-01-02

Yes they both work when i test them with the link but not when i recieve a message i doesnt flash

author
Stonos made it! (author)Stonos2011-01-02

That's weird. Does Facebook show you that you have an unread message (the same way that it shows you that you have an unread notification)? Also, does the script work for notifications?

author
JTigchelaar made it! (author)JTigchelaar2011-01-02

ya it shows when i have an unread message and the LED notification light works fine

author
Stonos made it! (author)Stonos2011-01-03

I'm not sure why it's not working for you :/

Any errors in the error console related to my script (in Firefox, go to Tools -> Error Console and click Errors. Do that after Facebook has finished loading)?

author
oldsmarracin made it! (author)oldsmarracin2011-12-20

i get an error in chrome
uncaught type error: can not read property 'location' of undefined

please help

author
JTigchelaar made it! (author)JTigchelaar2011-01-01

Thanks so much

author
Origommi made it! (author)2011-11-06

Anyway to make this talk to a USB LED instead?

author
mlakhwani made it! (author)2011-08-27

dear sir,
in my case both the led's are working with your given link but not with gresemonkey script...is that due to new facebook pattern or some thing else..please help me out....

regards

author
areyie ahmad made it! (author)areyie ahmad2011-10-09

me too. :(
help me pls

author
Stonos made it! (author)Stonos2011-10-17

I made a small change to the Greasemonkey script which might fix your problem.

I have also released an update to LEDBlinker (same URL).
Please try it and tell me if it fixes your problem.

author
areyie ahmad made it! (author)areyie ahmad2011-10-21

Works excellent.!
thank a lot Stonos.!

author
Stonos made it! (author)Stonos2011-10-17

I made a small change to the Greasemonkey script which might fix your problem.

I have also released an update to LEDBlinker (same URL).
Please try it and tell me if it fixes your problem.

author
'главчев'' made it! (author)2011-10-16

I have a problem. Everything works properly, manually start and stop the LEDs. When I start the plugin with Facebook lose manual control. Nothing flashes and can not run LEDs manually. I can restore manual control only when I stop the plugin and process from Task Manager and start again LEDblinker. Guess the plugin is out off date, but don't know what needs to change.

(I try the plugin both on Mozzila and Chrome. Also, i use Windows 7, if there matters)

author
Stonos made it! (author)Stonos2011-10-17

I have released an update to LEDBlinker (same URL).
Please try it and tell me if it fixes your problem.

author
'главчев'' made it! (author)'главчев''2011-10-19

Works excellent! Thank you very much. :)

author
huang.wencong made it! (author)2011-03-25

Can you do the same thing for Twitter? Like Twitter replies (@mention) and Twitter Direct Messages?

author
baven made it! (author)2011-03-14

I have built one

LED Blinker.jpg
author
asasklfjklasfkljasklfjaklfsjkl made it! (author)2010-11-13

Before I embark on this, has anyone had any success using this with a USB-to-Parallel adapter? I can use this on a computer which has a parallel port, but I'd prefer if I could use this on my laptop, which doesn't have a parallel port.

author
tuckersaspy made it! (author)tuckersaspy2010-11-29

Usb to parallel adapters do not work on anything but printers, i did a project last year making a cnc driver and did extensive research on the topic because i too wanted to use it on my laptop, there were a few models that claimed to be "fully intigrated" or whatever but the cheapest one was 465 usd

author
account3r2 made it! (author)2010-09-28

what are the other holes for?

author
atilimizgu made it! (author)2010-09-08

i just finished project that works really good :)) but my green led is blinking on only chat window when somebody post some thing..

author
beehard44 made it! (author)2010-08-29

it works! i added a parallel port switch to switch from printer to "FB Notificationator"

author
beehard44 made it! (author)2010-08-29

it's so weird how nearly everyone of you aren't reliant on your parallel ports...

i just can't let go of my canon BJC1000SP....

author
comsa42 made it! (author)2010-08-24

Can this work with gmal?

author
account3r2 made it! (author)2010-08-13

Oh, also is there some program or something that can just make it turn on or off or just make it blink on or off?

author
account3r2 made it! (author)2010-08-13

what kind of led? like a 3v?

author
account3r2 made it! (author)2010-08-13

can this work with twitter?

author
9ale7 made it! (author)2010-08-13

MUST TRY!! really great :)

author
godofal made it! (author)2010-08-05

i don't know how many V comes out the paralel port, but in any case u want to add a resistor to those LED's

author
Stonos made it! (author)Stonos2010-08-05

About 3.3V in my case.

author
DarkStar851 made it! (author)DarkStar8512010-08-07

3.3V is more than in the safe range of most standardized LEDs, no resistor is required.

author
nepalese made it! (author)nepalese2010-08-07

A resistor isn't required for voltage control; but instead for current control. A good design would be one where the current through the LEDs are limited to about 20mA.

author
der_fisherman made it! (author)der_fisherman2010-08-13

20ma is more than any printer port can source safely.....Guaranteed is only up to 2.6ma. Its a TTL output. There are ports around that can source more, but how will you find out if it can or not? I do not know of a safe way other than accept that TTL values will never damage it. Regards Andy

About This Instructable

39,253views

104favorites

License:

More by Stonos:Facebook LED blink on new notifications and messagesFacebook LED blink on new notifications and messages
Add instructable to: