Monday, December 30, 2013

Garage Door Controller Tutorial - Step 4 - Putting it together

Now that your Garage Door Controller is all soldered together, and your programmed chip is installed, it's time to combine the main board and the Ethernet Shield.

What I used in place of a proper 'project case' is just a couple pieces of wood (a main platform, and a small strip to hold the Ethernet Shield in place):
(Don't worry about all the holes and marks - I'm using a piece of wood that I've used for other things. Additionally, I've already made the holes for everything for this project)


I don't think it really matters what kind of wood, or what the dimensions are, but the thickness matters for the piece that the Ethernet Shield is going to sit on. You'll see why shortly. That little piece to the right that I'm talking about should be about 5/8" thick:


So go ahead and place your board down on whatever you're going to use, but leave plenty of room to the right of it for the Ethernet Shield:


Garage Door Controller Tutorial - Step 3 - The microcontroller



This section assumes you know the basics of Arduino. If you don't, I referenced a few tutorials/guides in the introduction of this series. But in case you missed them, here they are again:


First you're going to need the source code (Arduino sketch). You can download it from GitHub here. When you get to my page, click on the 'Download Zip' button:



Garage Door Controller Tutorial - Step 2 - Soldering

Now we get to start the fun part - soldering!

Note that this step is assuming you're using the professional PCB that you purchased from my store. If you want to make your own PCB at home, I have the files @GitHub for a single-sided home-made board available if you want to make your own board. And a separate tutorial for soldering on it.

There are lots of great tutorials on basic soldering, so if you've never soldered, go check some out, then come back here. Here are a few:
Collin's Lab: Soldering - By Collin's Lab / Adafruit Industries
How to Solder Correctly - and Why (Curious Inventor)
Soldering Basics (Sparkfun)


Ready? Ok, here we go...

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.