Monday, December 30, 2013

Garage Door Controller Tutorial - Step 1 - Parts Gathering

Here are the parts:


BOM (Bill of Materials) in relation to above image:

A.N/A9V Switching power supplyPart# TOL-00298 @ Sparkfun.com1$5.95$5.95
B.N/AArduino Ethernet ShieldPart# 83-13141 @ MCMElectronics.com1$34.99$34.99
C.R2,R31/4W 10K resistorPart# CF14JT10K0CT @ Digikey.com2$.08$.16
D.R11/4W 220 OHM resistorPart# S220QCT @ Digikey.com1$.08$.08
E.R41/4W 1K resistorPart# CF14JT1K00CT @ Digikey.com1$.08$.08
F.IC128 pin IC SocketPart# 3M5480 @ Digikey.com1$.70$.70
G.IC1ATMega328 w/Arduino BootloaderPart# DEV-09217 @ Sparkfun.com1$5.50$5.50
H.U15VDC RelayPart# PB874 @ Digikey1$1.61$1.61
I.D1General Purpose 1N4004 DiodePart# 1N4004FSCT @ Digikey.com1$.18$.18
J.Y1Crystal 16MHzPart# X1103 @ Digikey.com1$.81$.81
K.C3,C422 pF Ceramic Disc CapacitorPart# 399-4344 @ Digikey.com2$.44$.88
L.C1,C210uF Electrolytic CapacitorPart# P5161 @ Digikey.com2$.20$.40
M.Q12N2222A TransistorPart# 497-3108-5 @ Digikey.com1$2.76$2.76
N.J2Power Jack 2.1mm x 5.5mmPart# CP-102A @ Digikey.com1$.92$.92
O.IC2Voltage Regulator 5VPart# 497-1443-5 @ Digikey.com1$.55$.55
P.LED1Basic LED (Red)Part# COM-00533 @ Sparkfun.com1$.35$.35
Q.X1-X4Screw Terminals (2 pos.)Part# ED2580 @ Digikey.com4$.42$1.68
R.J1Male breakaway headersPart# PRT-00116 @ Sparkfun.com1$1.50$1.50
S.N/AMagnet Cube (1/4")Part# COM-08643 @ Sparkfun.com1$1.50$1.50
T.N/AReed SwitchPart# COM-10601 @ Sparkfun.com1$1.95$1.95
U.N/APCBPart# GDC10PCB @ jamienerd.blogspot.com1$5$5

Total (before tax, S&H, etc.): $67.55

Prices tend to fluctuate a little bit, so don't be surprised if by the time you click those links, the prices aren't the exact same. (They may be a little higher or lower)

Technically, you will need a few extra things (you may already have some on hand), such as:

Wire (to run a couple of wires from your garage door controller to your actual garage door opener)
Electrical tape
Krazy Glue
Brackets and screws (to mount to your garage door for the reed switch and magnet)
Some Cat5/5e/6 network cable

And of course there are a few basic tools you're going to need:
Knife (or wire stripping/cutting tool)
Soldering iron
Solder
Small screwdriver

The 2 lists above are only a couple of general lists - what you will really need depends on the way you go about your project - you may need more or less tools/supplies.

You'll also need a way to program your microcontroller - an actual Arduino board would be an easy way.

If you want to save a little money, you could skip the screw terminals (Q). This would mean though that you would have to solder wires onto the PCB instead of having the convenience of having 'removable' wires. You could also technically skip the magnet cube (S), and reed switch (T) which is the 'sensor' that can tell you if your garage door is open or not. If you decide to skip those, the Android app would always show your garage door as 'open'. You should probably only skip this if you have another way of knowing the status of your garage door (camera, etc.).

I know this isn't the cheapest project, but to me, it's worth the awesomeness of being able to open/close your garage door with your Android cell phone/tablet! If you want some tips on how you can save yourself a little money, please check out my FAQ, under the 'Is there anything I can do to bring the total cost of the project down?' question

On the other hand, if you want to spend a little less time (but a bit more money), I have a few options in my store, including full assembled board, or a full kit, etc.

Once you have all your parts, let's continue to Step 2 - Soldering.

Return to previous - introduction.

Garage Door Controller Tutorial - Introduction




I call this project 'Garage Door Controller'. The hardware is based on Arduino, and the 'software client' is an Android app. I do not have any immediate plans to release an iOS version of the software as I have no interest in developing on that platform (I'm not a fan of Apple's closed source model). However, if there is someone out there interested in porting the program to iOS, you may contact me and we can discuss that.

With the hardware and the free Android app, you will be able to see if your garage door is opened or closed, and you will actually be able to open and close it...from anywhere in the world you have Internet access.

Before you go any further, let me just make a couple things clear:
  1. You need to have a working automatic garage door opener
  2. I'm assuming you have the ability to run an Ethernet cable from your network switch/router to your garage door controller device, which should be near the general vicinity of your automatic garage door opener. (Technically you don't have to run an Ethernet cable to your router/switch...if you have a wireless router and/or Access Point, you could use one of these. I explain this more in Step 6.)
  3. I'm assuming you have the ability to run (2) lengths of wire (light gauge/low voltage) from your garage door controller device to the vicinity of your garage door. This is your 'sensor' that will tell you if your garage door is open or not. (This is not required, but recommended)
  4. I'm assuming you have a way of programming an ATMega328 microcontroller. For example, you have a computer running Windows/Mac/Linux (to run the free Arduino IDE), a standard USB cable, and an Arduino board (or similar/compatible). If you are brand new to Arduino, you should check out some of the following links:

All the source code for the Arduino and the Android app are linked below. The Android app is called 'Garage Door Controller' and is available for free on Google Play.

There is a possibility that you may run into a slight inconvenience when using this system if your router does not support loopback. Please check out my post, Garage Door Controller Tutorial - Using the app away from home for more info on this.

The project cost can vary wildly, so a very rough estimate would be around $40 - $85. It depends on several factors. Please see my FAQs page under the question, 'Is there anything I can do to bring the total cost of the project down?'. Obviously the more components you already have on hand, the cheaper it will be (it may actually only cost you a few dollars!).

How does this device work? You connect your garage door controller to the Internet by connecting it to your network. Connect the garage door controller to your automatic garage door opener. Install a reed switch and magnet on your actual garage door, and the (2) wires that come off of that connect to your garage door controller. Download and install my free Android app to connect to the garage door controller over your network and/or over the Internet to check the status of the door, and open and close it.

Here is a video of my device in action:




Downloads/links for this project (all on GitHub):
  1. The Arduino sketch (and supporting files)
  2. Android app source code
  3. Circuit board files (for submitting to professional board house)
  4. Circuit board files (for making your own circuit board at home)

I tried to break this project down into several smaller steps:
  1. Step 1 - Parts Gathering
  2. Step 2 - Soldering
  3. Step 3 - The microcontroller
  4. Step 4 - Putting it together
  5. Step 5 - Testing
  6. Step 6 - Opened / Closed sensor (optional)
  7. Step 7 - Your network
  8. Step 8 - Mount and connect
  9. Step 9 - Smartphone app
  10. Using the app away from home (supplemental/optional)


In the next step, I provide direct links (to Digikey, Sparkfun, etc.) to the individual parts you'll need. As an alternative, you can check out my store which includes the full kit, fully assembled device, etc which may be more convenient for you.

Ready? Let's go - Step 1 - Parts Gathering!


Disclaimers:
1. I am not responsible for any damage/harm you may do to your garage door, your phone, yourself, or anything/anyone else during this project.
2. I am not a professional electronics engineer, or a professional programmer. I have had no prior Android development experience, so I picked up a couple of books and started learning for this project. In other words, please don't laugh at my code. On the other side of the coin, I would love to hear ideas/suggestions from the more experienced programmers out there.
3. Even though I've implemented a 'password' requirement for the Android to be able to send commands to the Arduino to open the garage door, it's not very strong security. It's sent as plain text over the internet, so anyone with the right software and know-how could intercept it, and start opening/closing your garage door with just a little more info. I do have some ideas about implementing better security, so in future Android/Arduino releases I may implement something...but can't make any promises.

Saturday, May 25, 2013

Nerd verification - A+ Certification

This is just a quick post to prove my 'nerdness'. I recently became A+ certified. What does that mean? Well, let me just quote from CompTIA's website regarding just that:

"In order to receive the CompTIA A+ certification, you must pass two exams.

CompTIA A+ 220-801 covers the fundamentals of computer technology, installation and configuration of PCs, laptops and related hardware, and basic networking.

CompTIA A+ 220-802 covers the skills required to install and configure PC operating systems, as well as configuring common features (e.g. network connectivity and email) for mobile operating systems Android and Apple iOS."

Soooo, does this make me a certifiable nerd? Idk (I don't know).

What, you want proof that I'm certified? Ok, well you can verify here. My code is:
7C8ME3Z10341SD5N.

Finally, here's a copy of my certificate:


Saturday, March 23, 2013

Philips Norelco shaver guts

Ever want to know what the electronics looks like in a Philips Norelco shaver? Ok, so I'm pretty sure not many people care, but I did (and I had a reason). I have been using one of the cheaper models (purchased from WalMart for about $40) for about 2 years now and it finally pretty much died on me the other day.

I won't go into much detail, but because I was interested in salvaging the motor, I tore the thing apart until I got to the bare electronics. Here's what it looks like:



If you're not sure what these look like before they're massacred, here's a photo of the one I bought to replace it, which is pretty much what the old one looks like, just a little more modern looking:



What's that? Why did I want the motor you ask? Well stay tuned...

Saturday, January 26, 2013

Keeping a cell phone out of the land fill

My sister recently came to me because her cell phone didn't seem to want to charge its' battery anymore. Verizon wasn't able to fix it. I ruled out the battery being the problem by plugging in a similar (known good) battery.

Apparently something is wrong with the charging circuitry. In the meantime while I'm figuring something out, we bought her a new OEM battery from eBay for less than $5 shipped. She used a spare cell phone in the meantime (which she doesn't like) to keep her going, but it is not a good long-term solution. So, I put on my little thinking cap as this was a challenge I was looking forward to taking on.

After much searching the 'net, I found a particularly useful web page:
http://circuitsdiy.com/usb-li-ion-charger-revision
What I liked about this one is that it doesn't use a dedicated lithium ion charger IC, which mostly seem to be SMD as opposed to through-hole. I don't have the tools/experience/knowledge to solder those kinds of components (yet), so was happy to find this circuit.

I already have half of the components required for the circuit, and it was only a couple of dollars to order the ones I didn't have, so I placed the order with DigiKey, and a few days later, I was ready.

First order of business was to breadboard the circuit based off of the schematic from the link above:


Then I needed an easy way to connect the battery non-permanently. I have a bunch of old cell phones in my 'junk bin', so I found one that might work, and disassembled it:


The part I needed is not shown above, but shown below after I soldered a couple of wires to the appropriate 'spring terminals' (not sure what they're really called):


Closeup of the soldered wires on the 'spring terminals':


Now we just need to connect the 2 wires to the breadboard:


And put the battery in:



Doh!! It doesn't work - FAIL! It only charges for a few minutes and not up to the voltage it should, so is no good. :(

I contacted the creator of the circuit and he gave me a couple of suggestions but it still didn't work. He ended up sending me a professional circuit board. When I got it, I soldered the components onto it:


So then I connected those 2 red/black wires from the top-left corner of the photo to the other 2 wires from my 'battery holder', connected the battery, and was another FAIL. :(

Not being the electrical engineer I would love to be, I didn't know what to do, or how to troubleshoot. I turned to one of my favorite online retailer of electronic components/widgets (Duh - Sparkfun!), and found the perfect thing. I wanted to avoid going this route (buying a pre-made product) as it costs more money and isn't as fun and educational as DIY. But, I had no choice.

Here's the board from Sparkfun with a Micro USB cable plugged into it (for supplying power) on the left, and a JST connector coming out on the right (to connect to the battery holder):


I know you probably can't tell, but this thing is small! It's so small I don't know if it's a good thing or a bad thing, but it works! When a battery is charging, there is a little red LED that lights up...when the battery is charged, it turns off. It's simple and small, and again, it works, so I'm very happy with it. Thank you Sparkfun. :)

To wrap this up, I performed a few more steps. I added a little bit of solder to the wire connections to make sure they stay together (circled):


Added some hot glue to keep the wires in place (they would never survive in my sister's bag otherwise):


Covered the bottom section with electrical tape in addition to the hot glue to help keep the poor wires from moving in her bag:


Then wrapped the exposed wire connections up with some electrical tape to avoid shorting the charger/battery:


All done! Instead of throwing her half-broken cell phone that won't charge the battery anymore into the garbage, she can now keep one charging/charged outside of her cell phone while the other battery allows her to actually use her cell phone!

Monday, December 24, 2012

Linksys WVC54GCA camera useless from a dead power supply?

My poor little Linksys WVC54GCA network camera recently stopped working on me. After doing a couple of tests, I figured out that it was the ac adapter (power supply). It's supposed to supply 5V, but was outputting about 3.5V. What to do?

After not finding any replacement power supplies on Linksys' website, I decided to try their 'chat support'. I highly DO NOT recommend it. It was an irritating experience. I thought I was being pretty clear in what I was asking, but they were just not getting it, directing me to other strange products. Finally after they realized what I was looking for, they told me that they don't carry replacement power supplies for my camera. Thanks for nothing!

eBay had a bunch of options...ranging from just a few dollars to about $15. Most of those adapters looked a bit sketchy so I didn't really want to take the risk.

A little more thought and I remembered that I have a few 5V adapters that I bought from Sparkfun already! I checked the polarity on the camera and the power supply, and the amps, and they actually match!

Linksys Camera specs

Sparkfun AC Adapter specs - they match!

However, it did not fit in the barrel - the camera's jack is 5.5mmX2.5mm, but my adapter has a 5.5mmX2.1mm barrel connector. :(

First what I tried doing was drilling out the hole in the adapter's connector, but ended up runing the whole thing. :(

FAIL!

Eventually I remembered that I have a bunch of 'barrel' connectors laying around somewhere. I test fitted them, and sure enough, I had a 5.5x2.5 barrel connector. Cool!

Sooo...I cut the end off of my AC Adapter since I ruined the connector anyway, and stripped back some of the wiring. Then I took a pigtail that mates with the 5.5x2.5 barrel connector that I found and connected it. Then I stripped back some of the wiring on the pigtail. A few twists, solder and electrical tape later, I had a functioning power supply for my camera.

Sparkfun adapter with the proper connector now!

I plugged it in, and it worked! Woohoo!

Happy camera (see the blue led?)

Saturday, December 8, 2012

7-Zip saves my hide (at least got me around long paths)

Recently I had the simple task of adding more storage space to a Windows server. As usual, everything went well as far as the hardware installation and the software preparation. However, when it came time to start 'moving' network shares (folders) over to the new drive, I had one (folder) that did not want to copy, giving me the following error almost right off the bat:


Oh snap!

Fortunately, my friend Google never leaves me hanging. The first quick thing to try was to run CHKDSK with the '/f' (fix any errors) option on the source drive. I did, and there were a few corrections made. However, when I tried to copy that folder again, I got the same error. Uh oh.

After more searching I found a helpful Microsoft article:

It presented several possibilities, but only a few that were relevant to my situation. I was able to rule out 1 possibility - file names that had 'reserved names'. An example would be LPT1 or PRN or COM1. I ruled it out by searching for files/folders with those names in it. Of course nothing came up, but that was one of the simplest checks against the possible relevant issues.

Now things were getting a bit ugly. It was down to 2 possibilities: 1. There are one or more files that contain an 'invalid name', or 2. There are one or more paths to folders/files that exceed the 256 character limit. As far as I know, there are no built-in Windows utilities to check for either of these conditions. After poking around in my problem folder's subfolders, I started noticing that there were a couple of folders that had many, many subfolders. It looked like I found the culprit. This is a good and bad thing. Good because now I know what the problem is, but bad because I'm not sure how to get around it.

A little more searching around on Google for programs that could copy folders without the restriction that Windows itself has found me a possible solution - 7-Zip! It is a program that I already have on this particular server as it is the destination file format (.7z) for the nightly/monthly backups. Upon opening the program and initiating a folder copy of that annoying little (ok, not little - it's about 25 GB) folder, it started copying with no problem! Yaaayyy!

Real quick, I'd like to say that 7-Zip is a great compression/decompression utility with better compression than .zip files, supports a bunch a formats, and is free! Check it out - it's better than the other ZIP/compression utilities that I've tried (including commercial ones).

Well, I hope that this helps someone out there. Feel free to leave any comments/suggestions below.

Friday, November 23, 2012

Philips Pronto TSU3000 Universal programmable remote resurrected

Update 1/26/13 - I just uploaded a full video tutorial on how to take apart your remote, perform the fix, and re-assemble. See the very bottom of this post for the video.

The beautiful remote shown below is the Philips Pronto TSU3000 remote. It is an incredibly flexible and powerful remote. Brand new I think they sold for around $350-$400 (depending on where you bought them). I picked this one up on eBay a few years ago for around $230. Unfortunately Philips doesn't make them anymore. And even more unfortunately, for mine, the touchscreen stopped working a couple years ago, rendering it pretty much useless.

Philips Pronto TSU3000
Philips Pronto TSU3000
I opened the remote up when it happened a couple of years ago, and had no idea what to look for. I also searched the internet and found that this was a fairly common problem for this particular model of these remotes. (There are several other models, ranging in price and features, but this one is the most common it seems).

The problem, specifically, is that you touch the screen, and it turns on as it should, but after that, is unresponsive to anything else - any buttons that are on the screen will not work. :( The 'hard' buttons still seem to work, but that does no good if you can't select your 'device' from the touchscreen.

Below is a brief video demonstrating the remote's problem:


If you have this remote with this particular problem, read on to learn how to resurrect it...I just resurrected mine, saving me a couple hundred bucks (buying another used one on eBay).

A couple words of caution: You should wear an anti-static wrist strap when performing the following steps. At the very least, don't rub your feet around on the floor (especially if your floor is carpet) while working. If you don't wear the anti-static wrist strap, touch something metal once in a while. Also, try not to touch any of the circuitry/electronics of the remote...only touch edges of the circuit board if you have to. Only touch plastic parts where possible.

Disclaimer: I am not responsible for any damage you may cause to yourself, your remote, your pet chinchilla, or anything else while performing any of the below work. That being said, it's pretty straight forward, and if you use common sense and caution, everything should go well without any 'incidents'.

One more thing: I am not guaranteeing that this hack will work for you. Even though the 'symptoms' may seem the same, the 'cause' may be different. Or, you may not follow the procedure properly.

Now that all of that stuff is out of the way...click the 'read more' link below to get started!

Wednesday, November 7, 2012

Arduino - burning chips, saving money...and an important tip!

No, not potato chips...'computer' chips you silly goose!

I'm always looking for ways to save money, and I recently used up one of my last ATMega328 (with the Arduino bootloader pre-programmed on it) chips in a project. I've always been under the impression that to burn the bootloader, it takes extra hardware (pre-built from a retailer) and complicated software configuration/setup.

It turns out it's pretty easy to burn the bootloader yourself. There's a great tutorial that shows you how to do it right on Arduino's website. All you need is an Arduino, a 16MHz crystal, a 10K resistor, and 2 18-22 picofarad (ceramic) capacitors.

Here's a screenshot of the part of the page that shows how to hook everything up:

Here's what it looked like on my breadboard(s):
(You don't need to use 2 breadboards...I was just running out of empty breadboards, so I used the mini-red one and one side of a pre-occupied one)

Where does the money savin' part come in? Well the point of all of this is that you can buy an ATMega328 pre-loaded with the Arduino bootloader on it @ Sparkfun for $5.50. (Note that this is for the Arduino Uno). Orrr, you can buy the chip with no bootloader @ Digikey for $2.88. So would you rather pay $5.50 for a chip with the bootloader already on it, or spend a couple of minutes and pay half that price? I personally would rather pay half the price...I have 2 minutes to spare usually. ;)

I do have 1 tip if you go the route of burning your own bootloader though. There are 2 ways you can set up your new chip on a breadboard. 1 way uses no external parts - just the ATMega328 itself (described at the bottom of their page). The other way (described at the top of their page) uses a few external parts which I mentioned at the top of this article. Go this route! It's a few extra parts to hook up, but it's worth it.

The reason I say go the route with a few extra parts is that the timing will match up with the Arduino board. I first tried the method without any extra parts, and when I put the chip back on my Arduino and uploaded a simple 'blink' sketch...it ran at what appeared to be 1/2 the speed. :( I'm assuming that because of the internal 8MHz clock of the chip 'conflicts' with the 16MHz crystal on the Arduino. But when you burn the bootloader the way I recommend, you use a 16Mhz crystal for timing, and I had no problems when doing it this way.

If anyone has any questions or comments about this, feel free to leave them. I am also curious if my theory about the timing difference is correct or not. (Regardless, the results are what matters in the end and now I know how I am going to burn the bootloader in the future)


Saturday, November 3, 2012

Git is Great!

I've been hearing a lot about Git which is a 'free and open source distributed version control system' (according to Git's official web site), so I dug in a little bit:

There is a lot of great documentation on their site, so I read a little bit. It was a bit confusing to myself not having any background in any kind of version control systems. However, I started to appreciate the potential power of it, so wanted to learn more. I happen to have a Lynda.com subscription, and they happen to have a 6 hour course on it. Over the course of several weeks, I completed the course and now have a greater understanding of it. I just started using it at work (I created and maintain the company's Intranet and Extranet).

The real power of Git is how it allows multiple people to work on a single project. They can all be at the same physical location, or separated physically by thousands of miles. Git is very fast, powerful, takes up little space (the 'program' itself, and the revision history), and to use the basics, it's pretty easy to get started. Oh, and it's available to Linux, Mac and Windows...and did I mention it's free?

I highly recommend it to any kind of coder - web developers, application developers whether you're just one person or on a team.