{"id":12,"date":"2010-12-07T17:32:54","date_gmt":"2010-12-07T22:32:54","guid":{"rendered":"http:\/\/ahdesign.us\/blog\/?p=12"},"modified":"2012-01-12T15:14:52","modified_gmt":"2012-01-12T20:14:52","slug":"wifi-webcam-hardware","status":"publish","type":"post","link":"https:\/\/ahdesign.us\/blog\/wifi-webcam-hardware\/","title":{"rendered":"Wifi Webcam &#8211; Hardware"},"content":{"rendered":"<p>Now on to the hardware for the wifi webcam.\u00a0 I wanted to keep the whole &#8220;remote webcam&#8221; portion of the monitoring system under $75.<\/p>\n<p>The heart of the wifi webcam is the <a title=\"Seagate Dockstar\" href=\"http:\/\/www.seagate.com\/www\/en-us\/products\/network_storage\/freeagent_dockstar\/\" target=\"_blank\">Seagate Dockstar<\/a>, which has been heavily modified. The following hardware mods have been done to the Dockstar: A serial debug header, a micro SDHC card slot, missing RTC parts, internal 802.11b\/g wifi, and CPU heatsink.\u00a0 The only external piece of hardware is a plain old webcam.<\/p>\n<p>Here&#8217;s the modified Dockstar:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone\" title=\"Modified Dockstar w\/ micro SDHC and RTC\" src=\"http:\/\/thehoneckers.com\/var\/resizes\/AndyProjects\/IMG_6599.jpg?m=1317676627\" alt=\"Modified Dockstar w\/ micro SDHC and RTC\" width=\"427\" height=\"640\" \/><br \/>\n<!--more--><\/p>\n<p>The serial header has been added so that the bootloader, linux system in NAND, and linux system on the micro SDHC card could be changed.\u00a0 It also comes in handy for figuring out what IP address the device is using without having to log into the router to see what DHCP lease was assigned to the device.<\/p>\n<p>The micro SDHC card allows for fast internal storage of the whole operating system (debian squeeze).\u00a0 Luckily Seagate was kind enough to expose all the necessary pins for the SDHC controller on the Kirkwood. Using some reverse-engineering done by some guy called MindSmith at this forum: <a title=\"Dockstar SDHC Pinout\" href=\"http:\/\/plugapps.com\/forum\/viewtopic.php?f=6&amp;t=258\" target=\"_blank\">http:\/\/plugapps.com\/forum\/viewtopic.php?f=6&amp;t=258<\/a> and some of my own knowledge, putting a micro SDHC card on the Dockstar was pretty easy.\u00a0 The only &#8220;hard&#8221; part was modifying an already modified version of U-Boot to make it support booting from a SD\/MMC card.\u00a0 More on that in another post&#8230;.<\/p>\n<p>Also in the link above are the locations for where necessary connections are to enable the RTC in the Dockstar.\u00a0 I theived some 32.768KHz crystals from junk boards I had lying around, grabbed some 15pF caps for loading the crystal, and ended up having to buy some 33pF caps and 10M-ohm resistors (the resistor is used for oscillator feedback&#8230;.basically speaking).\u00a0 Since I had no idea what the part number was for the crystal I used, I had to guess on the load caps.\u00a0 Usually 15pF-ish is plenty to load it, but when booting Linux, the debug output kept saying the RTC was not ticking.\u00a0 Strangely putting a scope probe on the crystal&#8217;s lead made it start oscillating.\u00a0 Usually putting the probe on the lead makes the crystal stop oscillating due to the extra load the probe puts on the crystal.\u00a0 I could actually see the crystal start after I put the probe on.\u00a0 So I increased the load cap from 15pF to 33pF and everything was fine.\u00a0 I also added the lowest Vf\/cost schottky diode and 1F super cap with the lowest ESR\/cost for RTC power backup.\u00a0 I ended up finding a suitable diode for &lt; $1, and a nice low ESR supercap for under $3.\u00a0 I had a 0.47F cap w\/ a ESR of about 350 ohms, but as I found out a few years back here at work, that ESR translates into an immediate drop of capacitor voltage when main power is removed.\u00a0 Simply put, the lower the ESR, the lower the immediate drop of capacitor voltage. The ideal supercap was this Aerogel capacitor whose ESR is under an ohm, but the thing is physically large and expensive.\u00a0 The cap I found has an ESR of about 2 ohms and is fairly small (it&#8217;s max working woltage is only 2.7V, which keeps the cap small).\u00a0 The other thing w\/ the low ESR is the large inrush current needed to charge the cap.\u00a0 When the cap is empty, it looks like a resistor to ground when power first gets to the cap.\u00a0 Obviously the lower the resistance of this resistor (the cap&#8217;s ESR), the larger the inrush current is.\u00a0 With a 2 ohm ESR, that looks almost like a short to ground to the power supply (initially anyways).\u00a0 I hoped the Dockstar supply could provide a quick shot of ~900mA (1.8V\/2 ohms) to the cap the 1st time it&#8217;s powered.\u00a0 I also had to find a diode that had a low forward voltage drop, while allowing sufficient continuous current to pass through it without blowing up.\u00a0 Unfortunately, these two parameters are mutually exclusive.\u00a0 In other words, the lower the forward voltage drop of the diode, the lower the continuous current it can handle, and the more current you want to pass through the thing, the higher its forward voltage drop.\u00a0 I found a suitable diode with a low Vf and sufficient surge current handling ability.\u00a0 The diode I chose was a STMicro STPS0520Z and the cap I chose was a Nichicon JUMT1105MPD.\u00a0 The purpose of the diode is to allow current to pass to the capacitor and power the RTC&#8217;s power pin, but block current from flowing back into the system depleting the capacitor&#8217;s charge very quickly.\u00a0 The Marvell reference schematic shows a 1.5V watch battery powering the RTC, but the cap solution is cheaper and easier to hack into the dockstar with the downside of less backup time.\u00a0 I just needed a little time to backup the RTC in case power is lost quickly.\u00a0 The default date may cause the EXT3 filesystem to not mount if the current date is older than the journal creation date. I don&#8217;t know how true this is&#8230;.but still, the RTC works. Yay!<\/p>\n<p>The internal wifi needed to be a dirt cheap USB wifi adapter that was already supported by linux and could authenticate using WPA (this is a software thing rather than hardware actually&#8230;)\u00a0 A suitable adapter was found that has the Realtek RTL8187B USB chipset onboard: <a title=\"Rosewill 802.11b\/g wifi\" href=\"http:\/\/www.rosewill.com\/products\/1602\/productDetail.htm\" target=\"_blank\">RNX-G1LX<\/a> This turned out to be really easy to hack an external antenna on as the case of the dockstar has a tin shield lining the inside of it, thus blocking any internal RF (although I don&#8217;t think this shield will help w\/ EMI too much as there&#8217;s too many ways EMI can escape out of the box).\u00a0 Plus stripline antennas (antennas etched on the PCB) perform poorly at long distances from the access point.\u00a0 This enables me to use an antenna with a little gain so that I can use the wifi over 100 feet from the access point and through multiple walls.\u00a0 Basically to mod this, I removed the trace that goes to the stripline antenna and put a U.FL connector on the PCB instead.\u00a0 The series capacitor was left in circuit though.\u00a0 I had some U.FL to RP-SMA pigtails from a previous idea that I never used, so those worked well.\u00a0 The RP-SMA jack is mounted on the side of the Dockstar.\u00a0 I also had to remove the USB jack from the wifi card and cut the etched antenna off so the PCB would fit inside the Dockstar.\u00a0 The Dockstar has an internal USB port, so the wifi card is connected to that.\u00a0 Linux detected the card right away, and after a little screwing around, it connected easily to the access point using WPA (by means of wpa_supplicant).<\/p>\n<p>Lastly, I added a small aluminum heatsink to the Dockstar&#8217;s CPU as it tends to run a tad hot.\u00a0 One of my Dockstars is destined for the garage, which gets pretty toasty in the summer.\u00a0 Anything to keep the heat down inside the Dockstar will be helpful.\u00a0 This heatsink was cut from a larger heatsink (actually I cut 4 heatsinks from a single heatsink I had that was short enough to fit in the Dockstar case).<\/p>\n<p>For the webcam, I needed something that had a resolution over 640&#215;480, good low-light performance, was relatively small, and most importantly, dirt cheap.\u00a0 I initially tested a Logitech C200 which doesn&#8217;t meet any of my requirements except physical size.\u00a0 Its max resolution of 640&#215;480 was crappy at best, low-light performance wasn&#8217;t great, the manual focus was a pain, and $20 was expensive for this in store.\u00a0 However, it did serve to prove out my concept before springing on webcams that would meet my requirements.\u00a0 The biggest plus to the C200 from Target was that it was easily returnable =).\u00a0 I finally settled on a used <a title=\"Logitech C500\" href=\"http:\/\/www.logitech.com\/en-us\/webcam-communications\/webcams\/devices\/6303\" target=\"_blank\">Logitech C500<\/a> It supposedly has good low-light performance, good max resolution (granted not at 30fps, but I don&#8217;t need 30fps for watching doors), auto-focus, and best of all, they were $13 each, shipped (I bought 4).\u00a0 The low-light performance still isn&#8217;t superb, but I may be able to make it infrared capable (a filter inside the camera needs to be removed so it can see in IR).\u00a0 Other than that, the cameras have been excellent.\u00a0 I can also steal the camera for use on Skype if I want to.\u00a0 The thing looks really nice over Skype actually.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Now on to the hardware for the wifi webcam.\u00a0 I wanted to keep the whole &#8220;remote webcam&#8221; portion of the monitoring system under $75. The heart of the wifi webcam is the Seagate Dockstar, which has been heavily modified. The &hellip; <a href=\"https:\/\/ahdesign.us\/blog\/wifi-webcam-hardware\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-12","post","type-post","status-publish","format-standard","hentry","category-wifi-webcam"],"_links":{"self":[{"href":"https:\/\/ahdesign.us\/blog\/wp-json\/wp\/v2\/posts\/12","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ahdesign.us\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ahdesign.us\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ahdesign.us\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ahdesign.us\/blog\/wp-json\/wp\/v2\/comments?post=12"}],"version-history":[{"count":8,"href":"https:\/\/ahdesign.us\/blog\/wp-json\/wp\/v2\/posts\/12\/revisions"}],"predecessor-version":[{"id":17,"href":"https:\/\/ahdesign.us\/blog\/wp-json\/wp\/v2\/posts\/12\/revisions\/17"}],"wp:attachment":[{"href":"https:\/\/ahdesign.us\/blog\/wp-json\/wp\/v2\/media?parent=12"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ahdesign.us\/blog\/wp-json\/wp\/v2\/categories?post=12"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ahdesign.us\/blog\/wp-json\/wp\/v2\/tags?post=12"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}