Wednesday, October 7, 2015

Arduino Driven Current Activated Power Controller

I like things to be easy, and I would really like it if the shop-vac connected to my miter saw box (or router or table saw if I've moved it) would simply turn on when I cut something.  It would definitely get used a lot more often if it happened automatically, cutting down on the amount of dust in the garage and my lungs.  There are existing products that solve this problem like the i-socket Autoswitch, but I decided it might be fun to try and build one myself with an Arduino.  So I did :)

Parts list:
1x Arduino (I used a Nano)
1x 30 amp ACS712 Current Sensor
1x relay.  I used a 30 amp relay just to be safe.
1x project box, I used a fairly large one to make wiring easier.
2x modular power outlets, I bought a 12 pack.
1x modular receptable (like you generally see on a computer power supply)
1x USB Power Adapter (I used an old iPhone charger), or something like this
1x Pack of terminal connectors
1x 16x2 LCD, with an i2c adapter (I used a version from ebay/china)
1x 1x4 LCD button (I used a version from ebay/china)
Romex electrical wire, I used 12 gauge I had lying around but for a 15amp circuit 14gauge is fine.

Finished product:

For the assembly I took my dremel and cut holes in the sides of the box, then I used the dremel to trim the "ears" on the outlets because they were a little too long to snap in to place.

Then I fit each of the power outlets and receptacle in to the box, and ran the eletrical wire.  Here's a drawing of how I ran the electrical in the box.



Then I did a thorough "walk through" of the power to make sure everything was connected properly, nothing was touching anything it shouldn't, etc. and made sure I wasn't going to set the house on fire when I plugged it in.  Then I connected the Arduino to the ACS712 and the relay, wrote a basic sketch to turn the relay on and off and uploaded it to the Arduino.  The relay toggled on and off as expected, so all I had to do was figure out how to the current sensor.

I ended up using some example code from a thread on SparkFun to read the current going through the ACS712, and then basic logic to enable the shop vac when the amount of current exceeds the set limit, and turn it off (after a configurable delay) when there is no current.   The sketch is available here.  If you don't want to use an LCD or the membrane buttons you can carve that logic out of the code.  The top line of the LCD displays the current amount of amperage, the configured / trip current, and the current state of the mode button which toggles buttons 3 & 4 from changing the current limit to the sleep timer.  The bottom line displays the sleep time, the override state, and pwr which is the relay state.

The ugly insides.

What would I do differently?
I'd use stranded wire to make the wiring easier
I'd figure out how to better mount stuff in the box so it looked good
Use a different power supply, I just ordered this and this to see what works best.

Saturday, August 29, 2015

Custom Kitchen Pantry Barn Doors

As part of our kitchen model (becoming house renovation) we decided our kitchen needed a dedicated pantry, and the best place to build one was where we generally had a mess of piled food and kitchen appliances, or the "bar" as we called it.  Also, because we suck at taking before pictures, pretend this is a before picture and there's no door in it :p
Normal doors wouldn't work with the space we had, so it was folding doors or barn doors.  We immediately ruled out folding doors and after some research we decided on a simple barn door look.  We planned to build it with framing lumber from lowes, with the sides being 2x6, the top and bottom 2x8, and the center pannels 1x6.

The opening is 61.5" wide and we wanted the doors to overlap by an inch on each side, so we made each door 32" wide.  We didn't have an extra 64" of space to the left to open the doors so we opted to make it so only one door could be open at a time.  This will make more sense when you see the final pictures below.  We bought the hardware from ebay without a track, and then bought a 100" piece of steel from a local mill.  We also decided to make our own door handles, so we did that as well.  We totally winged it, we sat on the floor in the hardware store and pieced it together to see what size we liked.


So, parts list:
2x 2" x 6" x 96" whitewood board - $4/ea
1x 2" x 8" x 96" whitewood board - used scrap we already had
8x 1" x 6" x 96" whitewood board - $6/ea
1x 3/8" x 1.5" steel bar - $20
Barn Door Hardware - $119 shipped

Door Handles (these are not the exact items we bought, but are similar):
2x 6" 1/2" steel pipe
2x 1/2" elbow
2x 1/2" floor flange
Door Handle Hardware: $35

Rustoleum white primer: $5
Rustoleum hammered black: $5

We started out by cutting the pieces for the frame of the door to length, then used a router with a 3/8" rabbet bit to cut a 3/4" deep, and 3/8" wide lip all the way around the inside of the door frame for the 1" x 6" panels to sit in.  The frame is held together using Kreg pocket screws.

The assembled frames (I didn't take a picture of the rabbet'd back side):

Next up we cut the center panels to length, and because 4x5.5 = 22, and our center panel needed to be 20" wide we used our table saw to rip 1" off of 2 of the 1x6 boards (we put these on the outside).

Here's a quick test fit of the doors, with the panels temporarily fitted.

At this point we decided which door was left and right and which was the top and bottom of each, based on how well they fit together.  Then we cut half an inch off the bottom of the doors because they were going to be a tad bit too tall for the overhead piece to the top right.

Once we were happy with the fit we started the finishing process.  We're a fan of the weathered look, and a simple way to get that is by mixing steel wool #0000 and vinegar in a container and wait a few days.  Then we applied the resulting mixture to several wood scraps so we could try different combinations of vinegar and stain.  We were planning to stain the doors after the vinegar solution, but ultimately we settled on two coats of the vinegar solution followed by several coats of satin polyurethane.

As usual we didn't take pictures of the sanding and staining process, but here's a breakdown.

  1. Sand the doors so that everything fit nicely and there were no high spots.  We started with a belt sander where more material needed to be removed (I don't yet have a planer) and then moved to a random orbital to get a finer finish.
  2. We gave it a rough / aged look by beating them up a bit.  We used a 3' piece of chain, and then proceeded to drop tools, hit the doors with hammers, poke them with screws, etc.  
  3. "paint" the doors with water to bring up all the rough bits
  4. Sand the doors, then repeat with water and sanding a few times.
  5. Coat the doors with the vinegar mixture, wait a day and apply a second coat.
  6. Lightly sand the doors with 220 grit
  7. Apply 4 coats of satin poly, hand sanding with 400 grit between coats.  The resulting finish is incredibly smooth.
Once we had everything stained I glued the center panels together (I didn't use any screws) so they wouldn't warp over time.

We only had 2x 24" clamps so I used a ratcheting strap to help hold the middle together, and then glued the other panel together a few hours later.  Because of this I went and bought more clamps so I don't run in to this problem again.

Then I fit the center panel in to the door and attached it using 1.5" brads from an 18ga brad nailer, spaced about 8" apart.  

We cleaned the handle hardware with mineral spirits and then used Rustoleum primer and hammered black paint.  We used the same paint on the barn door hardware (track included).

I installed the 100" long steel bar by myself, it was a bit tricky but not too bad.  I figured out where the first bolt would go and then held the bar with one hand and the drill with the other (after drilling a pilot hole in the stud).  Once the first lag bolt was installed I used a level and then inserted the 2nd through 7th lags.  With the track up I shimmed the bottom of each door (you can see them in the picture) until I had them sitting where I wanted them, hung the hardware on the track, drilled pilot holes in the door and installed the hardware.  Then I removed the shims.  This allowed me to get the doors exactly where I wanted them.  I stood on the stool to attach the hangers to the doors (pre-drilling the holes).

Once the doors were hung we installed the handles and then did some touch up painting on the screws:

And the final look:



To see what we did for shelving/lighting, see Arduino Controlled LED Pantry Lighting

Arduino Controlled Automatic LED Pantry Lighting

We recently started a pantry project, and having just finished the new barn doors we needed to install the shelving and Arduino controlled lighting.

Parts List:
1x Arduino (I used a Nano I had lying around)
1x relay
1x reed switch
3x LED lighting
1x 1x8 DC splitter
1x 10pack DC pigtails
1x 10 amp power supply
1x 5pack 4' DC extensions
1x project box


I built an Arduino controller with a reed switch to know when the door are open/closed, and a relay to turn the lights on and off based on the reed switch  Testing the set up:

And the final set up wired in place:  
  • The wire coming out of the right of the box on the far right is the output from the power supply
  • The wire coming out of the right (middle) of the box is the relay-controlled power supply output.  This feeds a 1->8 DC splitter, which feeds the lights.
  • The wire coming out of the left side of the box goes to the reed switch which tells the arduino when the doors are open or closed.  


I wrote a 10 line sketch that checks the state of the reed switch and turns the relay on or off based on the state, pausing for 100ms between loops.  It doesn't even remember the state, it just sets the output pin to the relay either HIGH or LOW 10 times/second.

Now when you open the doors the lights turn on, and when you close them they turn off.  No light switch! :)

Here's what the lighting looks like in the pantry.
Notes:

  1. Only one door is on the track right now, and we're waiting for the new flooring before installing the lower portion of the pantry:
  2. the 3rd shelf from the top (second from the bottom) is slightly more yellow than the other 3 shelves.  All 3 reels of lighting were labeled the same warm white but one is definitely not the same color.  I ordered another reel and will replace it when it gets here.


Related posts:

Saturday, April 19, 2014

Our 5 gallon home brew hard apple cider

So we've brewed 4 batches of hard apple cider now, each time starting with 5 gallons of Tree Top apple juice in a glass carboy, and just sticking it in the closet.  The thing that takes the most time by far is cleaning and prep, it's infinitely easier than brewing beer.  Because I don't have a fermentation chamber I use a closet, so in the winter I use a space heater to keep it a constant 65f.  We don't have air conditioning so in the spring & summer the temperatures bounce up and down daily, which probably isn't great for it.

After it's done fermenting I transfer the cider to a corny keg, drop it in the kegerator, hook it up to Co2, and then bleed it a bit to let out any oxygen.  It takes around a week to carb at 8psi (set it and forget it), and I take a taste of it every now and then to check on it.  I've never been in a big rush so I haven't bothered force carbing.

Each batch has been super active for about 4 days, requiring me to clean the airlock twice a day.  There is so much activity that it has "painted" the walls of the closet, so I've taken to hanging a ziplock back upside down to avoid repeating that.

Here's the first batch where I didn't clean the airlock for 24 hours, and we painted the walls of the closet.

Each batch has costed me roughly $30 (yeast + cider).

Batch 1: 
Duration: 3 weeks
Temperature: 65-70f daily
Yeast: US-A05 Yeast
Result: came out a little dry and awesome.  Never checked the ABV.
Life span: 3 months

Batch 2: 
Duration: 4 or 5 weeks,
Temperature: 70-75f daily
Yeast: Nottingham Dry Ale Yeast #235.
Result: came out tasting like paint thinner so I back sweetend it and waited.
ABV: 8 or 9%
Life span: tried to age it for 6 months and it improved but it was still pretty bad.  Down the drain.

I'm really not sure what went wrong here, probably a combination of higher temperatures, a longer duration, and a different yeast.  It'd be interesting to do this batch at 65f for 3 weeks to see how the yeast compares "apples to apples".  Pun intended :)

Batch 3: 
Duration: 3 weeks
Temperature: 65f
Yeast: US-A05
Result: came out with less flavor then batch #1 but still pretty good
ABV: 6%
Life span: 6 months, was quite good.

Batch 4:
Duration: 3 weeks
Temperature: 65f
Yeast: US-A05
Result: Has more flavor than previous batches but is very similar to batch 3.
ABV: A hair under 6%
Life span: Aged 4 months before tapping it last night, tastes pretty gooood.

Batch 5: 
Duration: 19 Days
Temperature: 70-74, avg 72?
Yeast: US-A05
FG: 1.012
ABV: 5-6%, didn't take OG.  Probably similar as before ~1..06
Result: tasted good straight out of the fermenter

Sunday, October 27, 2013

Frontier lowered my service, raised the price, and cancelled my contract!

Did you know that you can sign a 2 year contract with frontier, and only they have to abide by it?  Neat huh?

I used to have 35/35 FiOS in the Seattle, WA area for $44.99

One day I called in because my internet had died (as happens once a month like clockwork).  After that call, the rep I was talking to apparently noticed my account had a "fictitious account number", and decided to fix it for me.  In the process, the rep failed to tell me they were doing it, changed my service from 35/35 to 35/15, changed my price from 44.99 to 49.99, cancelled my contract, and didn't move the billing from the old account to the new account.

I didn't know any of this happened until 2 months later when I got a call from a frontier collections person who accused me of not paying my bill, and would not listen when I said according to my credit card I've been paying.  He told me he couldn't see where the payments were going, and rudely demanded that I pay him or my service was going to get shut off.

I ended up calling back and talking to a normal billing person, and after some digging searching they found my new account and informed that because I was a new customer, I would need to set up billing.  New customer?  I've been a customer for a year and a half!  Eventually they figure it out, and move the credit from my old account (which was still billing even though it was closed) to my new account.  They never mentioned my speed had been lowered, my contract had been cancelled, or my price had gone up.

It's nice out, I play outside all summer, calling in once a month to have my internet fixed, and finally they send out a tech.  He says hey, i see you have 35/15 and I'm confused because I have 35/35.  Run a speed test, yep, 35/15.

Today I called because my internet went down (yesterday too, then again today), and they transfer me to billing, who says yep, we changed your account and lowered your service.  After 20 minutes on the phone with a supervisor who did everything in her power to "compromise" with me, I got the discounted price I was supposed to get, but not the service I was supposed to get via contract.  Great compromise huh?  I signed a 2 year contract to get something, and they decided that they would cancel my contract, raise my price, and lower my speeds.

According to the supervisor they don't provide that service anymore, only grandfathered accounts get 35/35 and there is "nothing they can do".  But she wants to compromise by giving me half of what my contract guaranteed me.  Nice compromise I got huh?

Thursday, May 23, 2013

Windows Phone 8 Can't Connect to Exchange 2013


On an HTC 8x with Windows Phone 8 we were unable to connect to Exchange 2013 (but it connected to another exchange 2010 deployment just fine).  An iPhone was able to connect to both (just a bit of irony there for ya). After googling around a bit I found somebody suggest exporting the certificate with the private key, and lo and behold that actually worked.  Crazy that it's so difficult, but it did the trick.

We are using a Godaddy UCC cert on a brand new Exchange 2013 server.

The error on the HTC 8x:

You'll need a personal certificate to connect to mail.domain.com
last tried 2 minutes ago
error code: 85030027

Solution:
Export the cert with private key; I put it in a web accessible folder, and then went to that path from the phone, installed the cert, and it worked right away.

HTH

Sunday, April 14, 2013

Arduino Based Kegerator / Keezer Build

So I decided it was time to build a kegerator... Due to space (front to back depth) constraints in my garage I couldn't use a normal fridge/freezer like I wanted, so I had to use a chest freezer.  I needed something less than 25" deep and with a bit of research the GE 7 cubic foot chest freezer - Model FCM7SUWW - fit the bill perfectly.

It will fit 3 home brew / ball lock corny kegs on the bottom (the 4th one just BARELY doesn't fit), and with a 10" collar you can fit another on the hump.

More importantly, because I'm a nerd and I've never worked with an Arduino I decided it would be fun to play with one.  I ended up with an Arduino controlling an LCD for each of the 3 taps I installed, displaying what beer is on tap and how much beer is left in the keg.  For funzies I added a couple temp sensors, one to measure the keezer temp, and one to measure the outdoor temp (I plan to move this to my deck in the summers)

I also decided I wanted to do this without making any permanent modifications to the chest freezer so I can easily put it back to original condition.

Planning:
  1. Buy a chest freezer and all of the keg equipment (CO2, regulators, taps, etc.).
    1. I used 12' of 2x10 to build my collar, making it tall so I could fit another keg on the hump if i needed, and to give me room to install the taps/LCDs.  Measure and make sure you get what you need.
    2. I used L brackets to help assemble the collar and make it more sturdy.
    3. I used a 80mm computer case fan and an old 12v AC adapter to circulate air so the air temperature is consistent across the entire keezer.
    4. I also used two Eva-dry E-500 dehumidifiers to prevent puddles in the bottom of the kegerator
  2. Buy a temp controller that can regulate the temperature of the chest freezer at beer temps, I used the STC-1000 which is a popular choice for this task.
  3. For my Arduino build I used:
    1. Arduino Mega R3
    2. Ethernet Shield
    3. 16gb Micro SD Card from an old phone
    4. 3x Flow Sensors
    5. 6x 1/2" to 1/4" adapters
    6. 3x LCD's
    7. 2x DS18B20 Temp Sensors
    8. 2x Breadboard / jumper wire / 22 gauge regular wire
Tools Required:
  1. Circular, table, or miter saw (I used a miter saw)
  2. Jigsaw to cut the LCD holes for the LCD's
  3. Router w/ Rabbet bit to make the LCD fit in the hole flush (I used 1 & 3/8, 1 & 1/2 would have been easier to work with, the LCD's just BARELY fit)
  4. Drill w/ 1" spade or forstner bit to drill holes for the tap shanks
  5. Soldering iron for the Arduino work

Getting started:
  1. Build the collar
    1. Using the chopsaw I cut my lumber to the dimensions I needed (20.75" on the sides, 37" on front & back), using Miter cuts so it would look clean
    2. With all the cuts made I test fit my collar to make sure it was perfect
    3. To make life easier, before assembling the collar I did all of the work to the pieces
      1. Drill the holes for the taps
      2. Drill a hole in the back for wires to pass through, including power for the arduino and fan, and a temp sensor. Later we will caulk this hole.
      3. Use a Jigsaw to cut a hole for the STC-100 Temp controller
      4. Use a Jigsaw cut the holes for the LCD screen
      5. Because the LCD is smaller than the PCB it is attached to I used a router to carve out the back side of the 2x10 so the LCD would be flush mounted in the board.  
    4. Apply wood glue to each miter cut, assemble the collar and line it up just the way you want it and use a ratchet strap (I saw somebody else do this, great idea) to hold it together and keep it square while the glue dried.  I did mine directly on the keezer so I could control exactly how it lined up.  I wiped up the excess glue after a few minutes, and then again the next morning.
    5. For added strength, once the glue dried I cut some 1.5x1.5x8 strips and screwed them in to the corners, letting them hang a little low in to the freezer to help hold the collar in place.  This seems to work quite well.  I didn't account for the freezer lid fitting properly so I had to remove them, cut them an inch shorter, and reinstall.  Make sure you pay attention to that :)
    6. I applied the first coat (of two) of primer to the inside and while that dried I tested the temp controller
    7. To wire the STC-1000 I removed the side plate from the freezer, popped out the built in controller, disconnected all the wires from that, and wired it like so (I used butt connectors on the freezer side to tap in to the existing wiring without having to modify it):
      1. Black from power plug - Pin 1
      2. White from power plug (shared with white to compressor) - Pin 2
      3. Black to compressor - Pin 7
      4. Jumper wire from Pin 1 to Pin 8
      5. It works :)
      6. I put 2 coats of primer on the inside, and then stained the outside:
  2. With the collar built it's time for final construction.  I ran 3/16" white weather stripping around the top of the freezer and then installed the collar with the original hinges making it easier to get kegs in, and purchased generic indoor door hinges to attach the freezer lid to the collar.  I drilled a couple new holes in each door hinge to match the layout of the holes on the original lid.  When I want to open the main collar I have to be careful because the lid falls open, so I use a piece of tape to temporarily hold it shut.









  3. I ran all the wires and stapled them (BAD idea, the staples ended up bridging some of the smaller wires so use tape instead) to the inside of the collar, and then cut channels in the back of the styrofoam so it would fit flush, then attached a second piece over the first so it is well insulated.  I used  the expanding spray foam stuff to insulate the back of the LCD's and hold them in place.  Don't get it on your hands, it's suuuper sticky and impossible to get off.









  4. An 80mm PC fan to help circulate air so the temp is consistent from top to bottom, and a mini breadboard to easily connect the flow sensors to the Arduino.  This is important, without it the top of the freezer is considerably warmer than the bottom and the beer pours foamy (I turned it off to see how much of an affect it has, and it's quite drastic).









  5. And a final view of the rats nest / co2 tank.
  6. The last thing I did was put one of the baskets in the freezer (I stacked them together), which works great for holding chilled glasses. It currently rests between the power controller on the front and the sytrofoam on the back, but I plan to come up with a more permanent solution.
The final product, ready to be moved to the deck.  I haven't decided what to do for a drip tray yet.


Arduino

To simplify debugging I built the Arduino in stages.  First I worked with the LCD's, figured out how the pinouts worked and how to address them.  I read a post about which pins could be combined but had other issues and ended up running all of the wires directly to the arduino (except power, those all went to the breadboard).  I did combine the contrast pins so one pot can control them all. Then I attached the flow sensors, and modified the sample code from adafruit.  I simply blew through a flow sensor to make the wheel spin and test it. Once I had that working I fully wired the 3 LCD's on the kitchen table just the way it would be installed, and then carefully moved it to the collar and put it in place.  One at a time I positioned each LCD the way I wanted it, and then used expanding sprayfoam insulation to insulate and hold it in place (be careful, don't pack it in too much or it might ooze in to the LCD display).  

For the collar to hinge I had to put a breadboard in the back corner so the flow sensors wouldn't be pulled on when the lid was opened.  The flow sensors terminate to the mini breadboard which has jumper wires to the main breadboard and arduino input pins for the flow sensors.

Finally, I wanted the Arduino to be fully self contained, so I used a webserver (available in the comments on this page) for configuration, and an SD card for persistent memory.  This was tricky to work with, at one point I broke the webserver by using pin 51 for a flow sensor, which interferes with the ethernet module. whoops.

Once I finish the code I will post it.  In the meantime if you would like a copy contact me and I'll be happy to share it with you.