Tuesday, September 18, 2012

Gen 2 Electronics

This has been sitting in the draft box for 12 months because the Lexan got destroyed in a storm so I never got to implement the whole system.

A side goal of Gen 2 is to make the electronics a little cleaner and easier to deal with.  So I found some really nice perf board at work and cut a small piece to make a shield for the Arduino.


 Bottom of the board.  Tried to be a clean as possible.  Have a great soldering iron really helps, I used the professional Welder at work.  Compared to the work, I did last time with my fat tipped one this is amazingly clean.
Top of the board, has connectors for 4  2 pin sensors and a 6 pin header for the relay board.

 Last time around I created this crazy sensor stalk.  It had all of the sensors going into a 8 pin header I think.  It was a mess to solder and dealing with placing the sensors in the system was a pain.  This time around each sensor is discrete and has heat shrink  and a crimped two pin connector.

The whole system put together with the Open Squid.  I used an old 4 pin cd-rom audio cable(is a tad bit too long) for the 4 IO lines and a 2 pin jumper for 5V and Ground.

I will need to add the transistor circuit for the 12V fan.  There should be enough to add this to the bottom of the shield.

Tuesday, February 15, 2011

Working with Lexan

Well, after waiting over a year for my 4' x 8' sheet of Lexan that was my "Christmas present," work began on the Germination Station Gen 2. Since Lexan is quite expensive, I scaled the station down to a 2 foot square from the original 4 foot square.

My dad and I trimming a piece of Lexan on the table saw.

We found out pretty quickly that cutting a huge sheet of Lexan on a table saw is not easy. I tried to take into account the width of the blade when making all my measurements but it was hard getting precise cuts because the Lexan would warp and bend as it was being cut. I messed up the roof by 1/2 inch because when I calculated the hypotenuse, I forgot to add 1/4 inch on both ends of the roof where the front and back pieces would meet. In the end, it was a good learning experience. A laser cutter would have been nice :)

I set up a jig in my garage to glue the pieces of Lexan together. The glue wasn't really glue; it was a solvent that kind of melted the pieces together.

The box all glued up and taped.

The finished box
I put a bead of clear water proof silicone on all of the jointing edges. I haven't done a water test yet.

The box is pretty solid, and I am surprised by how much it weighs. I need to put some brackets on the inside for the lights, and I have to figure out how to put a vent in the back so that the box can be cooled.

Tuesday, July 20, 2010

Mixed Feelings

So I started reworking www.mymakespace.org a couple of weeks ago.  It has been laying dormant for awhile and I haven't taken the time to upgrade to the latest version of BuddyPress.  In the meantime, a couple of really cool addons have reached a good level of maturity so I decided to implement them.  This leaves only one big feature missing, a Help Wanted section.  The update broke my translation and some of the color scheme but that's ok for now.

Back in February, My Make Space had become fairly stable, but very raw.  I had posted my pcb design and had gotten some feedback, but barely any traffic.  So since I am a noob php programmer, I decided to solicit help from a couple of my favorite hack/make sites.  I sent emails to Dale Dougherty at Make(I had some nominal contact with him about a Make Ning group a couple years ago), Hack-a-day and Chris Anderson at Wired.  I didn't expect anything to come of these emails but I figured I would give it a shot.

So the owner of Hackaday made an interesting post last week on the 12th.  The jist was the he really wanted Hackaday to expand its mission statement.
Quote:  "Expand the mission statement to something along the lines of “hack everything” (or maybe “hack anything” sounds more ambitious/fun?). Perhaps best said is: “hack everything, and inspire and help others to do that same.”"

This is not 100% like what I envisioned for mymakespace but it is really close especially the quote/slogan that I had on the welcome page: "Hacking Anything for Everyone".

On Saturday, I got an very interesting Blog post in my RSS feed.  Basically it was Make Magazine announcing that they are going to be starting a "Projects" section to the site.  They currently have a projects section but it is just posts about internal projects. 

Quote: "The new Make: Projects platform will be a place where we, Maker Media, can post our step-by-step projects, and a place where you, the maker community, can too (and we can all add to and improve each other's content)."

This is basically what I have been laying out of the last 3-4 years.  You can still find a post I created in 2007 on the make forums.  I know this is not an unique idea and probably multiple people have thought of this simultaneously.(heck if it can happen with Calculus).  I am really glad this is avenue is available but it is frustrating because this idea has been a passion for me over the last 5 years.  I know that I haven't put as much work into it as possible but it does seem like it has been poached to some extent.  Well now I can get on with my hardware/garden hacks:)

Sunday, January 24, 2010

Open Squid is Released!!!

Well, right before Christmas, I ordered another set of PCB's.  I seriously messed up on my first attempt, so I made sure that the second time around, the board was laid out correctly.

The whole idea came from the Squid Relay from Liquidware.  I created the first version which worked but was messy and kind of dangerous.

Here are some pics of the PCB:

Just the PCB.  I added some text and mounting holes.  More on that later.



Board fully assembled with cables attached.

Got a couple Power Strip Savers from Jameco.

Fully assembled Open Squid with cables attached.

I wanted to add some helpful features to the Squid, so I added mounting holes that will allow you to mount the Arduino above the Open Squid.  One of the guys at work helped me find some standoffs.
Here are a couple of pics:

I didn't realize that one of the mounting holes was smaller than the other ones.  I couldn't find a standoff that would fit that one, but even with only two standoffs, it is very stable.


I really want to sell this as a kit (minus the cables).  How much would you guys pay for this?  $25?  All of the files are available on my other project Mymakespace in the Open Relay Squid project.

Please give me your feedback.

Wednesday, August 26, 2009

PCBs are here!!!!

I ordered a single PCB like 3 weeks ago, and it finally came today.  BatchPCB threw in an extra one, for which I am very grateful, because I am probably going to mess up one board trying to put on the surface mount parts.

I ordered all the parts last week, and they came on Saturday.

Here are some pics:
 
  
Once I build the boards and test them out, I will post the results.

Monday, August 03, 2009

Germination Station 2.0 Timeline

After being somewhat disorganized with Germination Station 1.0, I am making a better attempt to plan out future steps to address the problems that I ran into the first time around.

Step 1:
Currently, I am working on a pyQT Gui so that I can communicate and view the sensor data better.  It took a while to figure out how to communicate asynchronously with the Arduino.  I found an example of  an asynchronous I/O program, and I added a pyserial read.  Right now, I am reading the serial data and displaying it in a text box.  I am messing around with graphing the data, but that is proving to be more difficult.

Step 2:
The next stage will be to develop a serial protocol on the Arduino that I can use to read all the sensors and change parameters.

Step 3: 
Test new relay board circuit.  Spin PCB design and order prototypes.  It would be great to turn this into a little kit.  I am going to look into the cost of the BOM and what kind of markup is feasible.

Step 4:
I want to get one variable working from top(gui) to bottom(sensor and variable control).
I plan on growing some blueberries, and I might create a little sub-project that will just water the plants in pots on the deck.  That would just deal with moisture and pump control. (I would need to look into some cheap pumps/values.)

Step 5:
Integrate Fire, Wind, and Earth variables one at a time.

Optional:
I  am looking at a hard plastic for the roof so that I can fix some of the water run off issues, but the current quote that I have is pretty steep ($109 for a 4'x8'x 0.125" lexan.).  I might try to put that off for as long as possible, but I think that having a hard roof is going to be a necessity.

I have not decided if I am going to implement Xbee on this version.  Just the Xbee units would be about $40, and it could cost more if I decide not to use the Xbee arduino adapter boards that I already have.  They might have been the reason that the last Xbee units got toasted.

Friday, July 17, 2009

Germination Station Part II

Electronics and Arduino Programming
I had fun naming my control variables. Earth = temperature of the soil, wind = temperature of the air, water = moisture, and fire = light.
The sensor stalk
I needed a way to connect all the sensors into the Arduino. I made my own shield and used a motherboard firewire cable. I used the heating pad (earth) from the previous project, a hair dryer, and a 12 DC fan (wind) and the two fluorescent lights (fire).
Finding the right layout was kind of a pain using a cheap board from radio shack (not so cheap).
Firewire cable had just the right amount of wires.
Three sensors: two thermistors and a photocell. This is the first version. The original plan was to be able to differentiate between daylight (higher) and the artificial lights (lower), but the photocell would get saturated and keep rising. I had to put an extension on it so that it was above the lights. I did not implement the water sensor because I did not have a pump.
Testing out the fan circuit. Used a TIP120.
Sensor Stalk header: I/O for the open squid, 2 pins for the the 12VDC, and 2 pins for the fan.
A little bit fuzzy, but everything hooked up.
Fire
The goal of the Fire (light) control was to turn on the lights at 6am and then turn the lights off when the sensor (sunlight) reached a specific point. The lights would turn on again if the sensor value dropped below the determined value and stay on until 8pm. As summer approached, the light would be used less and less.
Challenges:
I used the DateTime library. Syncing up the time with a pc and adjusting for a timezone were a pain.
I got the fire variable to work sporadically, but it never worked longer than a period of a couple days.
The lights are on!!! Having to haul my work laptop onto the porch did not help with debugging, especially when it is all software. I have really old Arduinos that still require the manual reset so that did not help either. I have not gotten around to modding them.

Here is a little clip from testing the photocell circuit. I sound ridiculous. That is Noelle's beautiful thumb at the end.

Timers
I used the FrequencyTimer2 library. Something wasn't running 100% correctly because the calculated overflow did not come out right, and I had to tweak it until it was approximately 1ms. I created an earth and wind PWM timer based off of the 1 ms tick. The wind period was 100sec, and the earth period was10sec broken into 100 increments with a divisor. This strategy needs to be evaluated because I was constantly troubleshooting the timers to see if they were correct.

Earth
Earth was almost the exact same algorithm that I used with the original PID controller. I cleaned up some of the calculations and added a larger range to the thermistor formula for both thermistors. The PID function producted a value from 0-100, which was used as the duty cycle of the earth PWM.

Wind
Wind was a bit more complicated. I designed the algorithm to turn off the hairdryer and turn on the 12VDC fan. The wind PID algorithm was allowed to go negative. The negative state would mean that the station had gotten too hot, and the fan needed to turn on. I think I got this working right at the end of the project, but I figured out that the fan did not have the CFM to cool down the germination station as the days got warmer. My original idea was to have one fan and a large heat sink with a film heater attached. I think that would have been a little neater, but the control algorithm would have been a little more complex.

In the end, I did not feel confident enough to leave some plants in the germination station. Whenever it rained hard, the plastic concaved a little and caught some water. I did not frame out the entire base of the station so the water leaked back inside. Thank goodness nothing got fried!

Here is some analysis of what problems I ran into and what I can do better next time. If anyone has additional input, I would be grateful.

Scope - I really wanted to have a GUI and a solid communications protocol so that I could read the data live. I hacked together a serial protocol, but it was not robust enough, and the fact that I had to sit outside on the deck did not help the whole development process.

One of the interesting philosophies that my boss has mentioned when developing our products (embedded systems) at work is to take a single slice of the project and make it work top to bottom. One of my goals going forward is to get a single element working (i.e. thermistor) and have it communicating with my new laptop (birthday present!!!!) with a pyQT UI. If I can get that to work, then I can slowly add the other variables.

I am going to have to adjust the Frame structure so that it is more stable. I plan on getting a sheet of lexan for the room. I would like to make the whole structure out of lexan but that might be cost prohibitive.

I have some really good ideas for the water sensor and pump. I am currently trying to figure out what method would be the cheapest and easiest to control (ac pump vs. dc pump).

The end game of this project is to have a system that will transmit the control data to a web server so that the station can be monitored remotely. Tweaking the PID values online would be kind of neat, but I don't think that is necessary.

Next post, whenever I get around to it, will be about the raised bed and garden that Noelle and I created this summer.

Germination Station Part I

I have been working on this project all spring, and I am finally getting around to posting about it.  Unfortunately, it did not turn out to be as successful as I would have liked it to be.  A couple of  years ago, I created a PID controller that controlled the soil temperature of a Biodome.  Now that we own a home, I was hoping to be able to add a bunch of other variables.  The variables were the following: soil temperature, air temperature, light, and moisture.  I also wanted to have Xbee units to relay the information back to a Webserver so that I could view the system's status from the web.

The  Xbee idea had to be postponed because 1 of my Xbee units got toasted.  As a result, I had to be tethered to the project via a USB cable, and that caused some technical and logistical problems.  I still got a lot done, but in the end, the entire system did not work.
The Structure:
The base: I wanted to see how much of the deck it took up.
The side supports. I will expand upon my rationale for this shape later.
I attached two fluorescent lights as part of the support structure. They were also the most costly part of the project.
Additional supports and hinges so that I would be able to easily lift the cover.
Cover attached to the base
You can see that I did not line up the cross supports. The whole structure was not as stable as I wanted it to be, which may have been responsible for water flow issues.
Plastic covering
I took a 4" by 4' PVC pipe and cut it in half(horribly) and glued it together. Attaching it to the structure was very precarious, and I will need to think this out better the next time around. The pipe was to funnel water into the trash can. The plastic that was connected to the "roof" of the pipe was very leaky, so it did not work as efficiently as it could have.
Electrical Systems
Wiring the Lights
I took a basic extension cord and cut the end off, then wired the lights in parallel together.
Electronics (Arduino and Open Squid)
I planned on using the Arduino again. I had an extra one on hand, but I didn't need to use it for the system. It was useful for debugging basic code at lunch, though.
Open Squid
I needed to control multiple AC devices (hair dryer, heating pad, and lights).  Last time, I hacked a digital AC timer.  That would have been a little too costly this time.  I found the relay squid by Liquidware, but it was a little out of my price range, and I figured I could build one cheaper.
Got these from Mouser.  Really cheap.  Just cut the ends off of them.  Time for some soldering!!!
I spent a good 2 hours working on the circuit in the top left corner, and it just would not work.  I found out that the relays that I had picked could be driven with just the output current of the Arduino. (After examining the Atmega and relay documentation, the relays should have blown out the IO on the board, but for some reason that did not happen)  I am working on redesigning the circuit now.
I wired the ground and neutral straight through to all the plugs and switched the hot.
Soldering the AC lines on the board was tedious. I am surprised it all worked.  I put some hot glue down to protect the connections and keep everything in place.
All done! Time to get it in the box (project box from radio shack).
Everything hooked up to the Open Squid.
I have created a schematic in Eagle with the correct transistor switching circuit.  I have laid out the PCB, but I want to do some testing of the circuit before I ordered the PCBs.  All the schematics and gerbers will be available after I do a system test.
Next time, I will go into the Sensor Stalk and the Arduino program and the problems that I ran into while working on this project.

Wednesday, May 13, 2009

My Dad's Tomato Plant setup

Well my Dad wanted to buy some of those tomato plant holders that allow you to hang the plant upside down.  Since he is an independent contractor and has a whole bunch of tools I suggested that he make them.  I found a couple of tutorials and an instructable online, but I never thought he would follow through with it.  I was really surprised to hear that he actually made 4 of them.  He went a bit overboard and made this huge setup that suspends the plants. Its pretty cool.  I told him he was a hacker/maker, but he did not get it.

Here are some pics:
Plastic container with cloth to hold the soil.
 
The posts are supported by the deck and they are tall enough to walk under.

Tuesday, March 10, 2009

Status and TV habits

Well, I have made some serious progress with the germination station, and I hope to get it all put together sometime this week.  I did a full integration test and got all the major systems working outside.  I want to add some sort of real time monitoring but getting a USB cable through a sliding glass door is going to be difficult.

Here is an interesting breakdown of what and how I watch my TV.
Sunday:

Family Time:) Noelle and I watch Amazing Race on CBS.
Monday:
Chuck, Heroes and Big Bang Theory.
Chuck/Heroes sometimes live, but most of the time on Hulu.
Big Bang Theory:  CBS is a bunch of idiots, and they have not gotten on the Web TV train yet.  They post 3, 2 minute clips from a 22 minute episode, so I bitorent this one.
24, but I am going to wait until it is all done then watch it on Hulu or bittorrent the whole season.

Tuesday:
Noelle watches AI, but I usuallly sit on the couch with the laptop messing around.
Fringe a week or 2 later on Hulu.

Wednesday:
Again, Noelle watches AI, but I usuallly sit on the couch with the laptop messing around.
Lost but same as 24.(no Hulu option)


Thursday:
The Office, 30 Rock on Hulu(usually fri/sat) bt CSI

Friday:
Watch BSG and Dollhouse live unless we go out then watch them on Hulu.

Saturday/Sunday:

Catch up on shows I missed during the week.

The Mentalist, Psych(USA) and BurnNotice(USA).  Don't know what nights they are on, but I Hulu and bittorrent the Mentalist.

I really like time shifting.  It is really good for the summer to find a show that you liked but missed a bunch of episodes.  Late Spring additions: Reaper, Eureka, and maybe BBC Robinhood.  It may seem like a lot but once you take out all the comercials, you reduce the length by a third.

Monday, February 09, 2009

A quick thought

NASA has published some great pictures(artwork) from the 70s.
I remember reading books similar to these in elementary school.

On the personal projects side,  I spend 8 hours on Saturday toiling fruitlessly on my lastest Arduino/Garden project.  I hope to get the atmega168 flashed today but we will see.

After Lunch:

Woot, I brought some arduino stuff to work so I could mess with it during lunch.  In 30 minutes, I had 4 chips flashed and 2 arduinos tested and running.  I was missing a cable for my STK500 and I found one similar.  It made flashing the chips trivial.

Now that I have work the boards working. I need to integrate two more control loops(lighting and air heating/cooling) into the current thermistor code.

Monday, February 02, 2009

The unexpected joys of home ownership

One of the unexpected joys of home ownership, as well as the fact we live farther out in the "boonies," is the great view of the sky.  We have a big sliding glass door on the back of our house that faces south.  I am constantly amazed by the stars, the moon, and the planets that float above.  My favorite constellation, Orion (I think that should be a requirement of a nerd.), can easily be seen almost all night.  It was really cool seeing the Moon, Jupiter, and Venus all line up a couple months ago.

Honestly, just looking up at all the stars is mind blowing.  I wonder what other people think when they look at those same stars.  One of my goals in life is to capture an asteroid and return it to earth.  If I last as long as my grandparents, I have a little under 60 years to pull this off.  That's a huge amount of time, but it is a monstrous undertaking.

Friday, January 30, 2009

A whole bunch of stuff............

The first post of the new year:
This could have been broken down into 3 posts but I did not get around to posting them.

In an attempt to further ensconce myself in the nerd hall of fame, I got a Tron poster.  (No one got it for me for Christmas.)  Noelle had a coupon for a frame at Michael's, so the poster will be safety preserved for future generations.  In my enthusiasm for the poster, I watched the 20th anniversary edition (digitally remastered).  It is amazing how good it looked, even more so if you take into consideration that it was released in '82.  (Nerd moment: Just think how ridiculous Star Wars Episode I is going to look 20+ years after it was released; heck, it looks bad now.)  The crazy and awesome thing is that they are going to make a sequel to Tron: TR2N.  It's set to be release in 2011, 1 year short of Tron's 30 year anniversary...that's crazy!
Along with the Tron poster, I got By Schism Rent Asunder, which is the sequel to Off Armageddon Reef.  David Webber is more known for his Honor Harrington series.  The Honor Harrington books are the ones you see people reading on planes with the really cheesy covers.  I have read the first 3, and they are better than the covers make them look, but there are 20 books in all, and I can see a pattern already in the first 3.  Most of Webber's books have nautical themes, whether it be space navy battles or standard seafaring.  I read the first book last year on one of my trips to Seattle.  The main storyline is set in the world of Safehold ,which holds the remnants of human society.  Safehold has been permanently restricted to a Medieval level of technology to avoid destruction from an alien race.  The main hero/heroin is a cyborg (named Merlin) who was hidden in the mountains (for 800 years) by a sect of the original settlers.  They wanted to advance human technology so that if the aliens find them, they will be able to defend themselves.  The author does a wonderful job of endearing you, the reader, to the main characters.  The one aspect that I like is the altering of technology.  Merlin's task is to slowly transform the society into one that can defend itself if the aliens return.  He does all this tweaking of the ships, cannons, and guns.  I always wonder how an engineer could alter our existence if he were to go back and have a conversation with the Royal Society in England in the 1600s.  I finished all of the first book while I was on the trip to Seatle, and I finished the second one in under a week.  The one bad thing is that By Schism Rent Asunder and the 3rd book By Heresies Distressed are basically 1 book and were split up because it was going to be too big.  So the ending of By Schism was not as clean as Off Armageddon Reef, and I have to wait until June for the Hardcover of  By Heresies Distressed.
As a side note, the second and third book's titles in the series are from the hymn The Church's One Foundation.

Wednesday, December 31, 2008

My Make Space

So a couple of weeks ago, I had my wisdom teeth removed.  For some reason, that weekend I just got feed up with the inactivity in my life(in many areas).

One of the crazy things that happened is that I have stopped playing WoW cold turkey.  During that time I have been working on a project that I have mentioned on the blog before Mymakespace.  One interesting repercussion of this change is that I can't get any sleep, haha.

I will give everyone a recap: Mymakespace is a collaborative project social network. Mymakespace will combine collaborative software project sites like Sourceforge + environment and attitude of Make.

In the past I looked into a open source version of sourceforge called Gforge, but it was overly complicated.  I looked into and got elgg running(kind of) on my home lamp stack.  The documentation was very weak and there just did not seem to be a community around it.  So along comes buddypress,

Buddypress is just a bunch of plugins for Wordpress MU.  Wordpress MU is just the multi-user edition of wordpress similar to what www.wordpress.com runs.

Wordpress MU and Buddypress are quite easy to setup.  The hardest part was getting the email to work. In the end, I just used one of my gmail accounts with smtp.
So here is my first/continual attempt: Mymakespace
Most of the changes have been done very ad hoc and probably not in the correct manner.  I have changed Groups to Projects.  Projects will be the focal point of the site.

So far only a couple of friends and family have signed up but this is just a Proof of Concept and I am just an EE with little web programming experience so test it out and give me some feedback.

Tuesday, November 11, 2008

Books, Bungalows and Boondoggles

Since a lot has happened since my last post, I am going to break down this post into three areas:
Books:
More like just 1 book...the final review of Anathem
Bungalows:
Our adventure into home ownership
Boondoggles:
The election, in all its glory
Books:
Well, I finally finished Anathem.  It was a good book, but it was very painful to read in some parts.  About 2/3 of the way through, there is a section that is really tedious.  Basically, you are observing a group of philosophers sitting around a table and arguing over extremely theoretical subjects.  I think that went on for a little too long, but then the book gets back to a little action.  Anathem could really be split into 3 books, but  I am glad Stephenson lets you read the whole thing in one shot.  Most of his books have abrupt conclusions
(There is a specific literary term for it, but I can't think of it now.), but this one has a couple of big jumps at the end while still giving a solid, less detailed closing.
As a whole, I think Stephenson comes to the conclusion that the "secluded scientists" of the world can't corner themselves off.  Christians fall into that trap as well.  It is interesting how we create are own little worlds and get very upset when "apple carts" get turned over.
Bungalows:
So, we finally moved into the Haas last weekend, and we were battered, bruised, and exhausted Saturday and Sunday after moving the remainder of our belongings on Friday.  The final car load was delivered to our new house at 8:00pm on Halloween.  It was crazy to drive through our neighborhood and see 50-100 people dressed up from hunters and faeries to parents looking like Jason. 
We have painted the whole house (inside), and we had new carpet installed on the Friday that we moved in.
I spent a good portion of Saturday and Sunday setting up the computer room.  We have 4 computers in there so it can get quite toasty.  With the cooler weather coming, that should be nice.  We still have some big issues that we have to address: now that we don't live in a 1 bedroom apartment, we have room for and need new furniture (whether we can afford it is a different issue, haha).  We need a second chair or "love seat" of some kind in the living room.  Noelle and I actually don't have any kind of bedroom furniture for either of us, and our mattress is falling apart.  The guest bedroom doesn't have any furniture in it at all.  The only room that is fully furnished is the computer room...shows where our priorities are, hahahaha.  However, I am missing two little things from the computer room, aka "The Lab": a huge white wipe board (for brainstorming) and a Tron poster (Who knew they were that expensive!), or maybe a poster for this.
The one project that I am really looking forward to is creating a garden.  We have a wooden playset in our backyard, and I am trying to give it away.  (Someone at our church is currently interested.)  Once I get that out of the way, I will be laying out how big the garden is going to be.  When we went to Green Bay for my Grandmother's funeral back in May, my Grandpa (a master tomato grower) had Organic Gardening magazines laying all over the place.  My Mom noticed that both Noelle and I thought it was interesting, and she got us a subscription for our birthdays.  They have some really interesting tips so it will be cool to try some of them.
Here is what I am planning for now: strawberries and tomatoes are the easiest and most popular to grow. Beans, green bell peppers, and cucumbers all get along with strawberries and tomatoes, so they will be in the garden as well.  I really like raspberries, but South Carolina humidity supposedly is not very kind to them, as well as the fact that raspberries take 1-2 years to bear fruit.  I am not sure about that yet.  It will be interesting to see how the garden works out.  Hopefully, I can augment the garden with some cool electronic sensors similar to what I was doing with my previous Project Tomatoes just on a larger scale.
Boondoggles: 
 I guess I could be stereotyped as a Rightwing Nutjob.  This election was a little bit different for me.  Here is what it was like to me: What do you do when you want a hamburger and your choices are a veggieburger (McCain) and salad(Obama)?  To be honest, none of the candidates in the primary represented me.  I really did not know what I was going to do.
With all that said,  Noelle and I were supposed to vote at the polling location near our new house.  Well, when we changed our registration, the lady forgot to give us a letter so that if we were not on the roll by election day, the poll workers could just add us to the bottom.  Needless to say, we weren't on the list when we went to vote.  We had to go to the Lexington County voter registration office and wait in line there for an additional hour and half.  They finally let us vote, and I have to say that I am really disappointed in the system that is in place right now.  South Carolina does not allow write-in votes for President (who knows why), and  I had already decided that I was not going to vote for McCain or Obama...so I abstained.  In previous elections, Noelle and I had made the decision that if we did not know about a specific race or who the candidates were, we were not going to vote for anyone.  An uninformed voter is just as bad as not voting, in my opinion.  I voted for my House Representative, and I wrote in Mike Ditka for one of my Senators. All the state and county elections were very disappointing since there was only 1 person up for re-election against no one except a write-in vote.  In the end, I don't think I voted for more that 2 people, and then I voted on the amendments to the South Carolina Constitution and the school bond issue for Lexington County.
Noelle was upset about the overall election results,  but for some reason I had a peace about it.  (Either I had peace that God is still sovereign, or I am really that apathetic.)  My Dad thinks we are going to be plunged into a massive depression.  He is even planning a garden in case it gets really bad.  The next 4 years are going to be interesting to say the least.
Peace out




Tuesday, September 30, 2008

Anathem: Reviewing Neal Stephenson's new book

When I read that Neal Stephenson was going to release a new book, I got really excited.  I own all of his books from Snow Crash forward.  I was really interested to hear about the topic of the new book.

Here is the general description:

Anathem is set on a planet called Arbre, where the protagonist, Erasmas, is among a cohort of secluded scientists, philosophers and mathematicians who are called upon to save the world from impending catastrophe. Erasmas - Raz to his friends - has spent most of his life inside a 3,400-year-old sanctuary. The rest of society — the Sæcular world — is described as an "endless landscape of casinos and megastores that is plagued by recurring cycles of booms and busts, dark ages and renaissances, world wars and climate change." Their planet, Arbre, has a history and culture that is roughly analogous to Earth. Resident scholars, including Raz, are unexpectedly summoned by a frightened Sæcular power to leave their monastic stronghold in the hope that they may prevent an approaching catastrophe.

At first, I was just confused, and then I was a bit concerned.  I read a lot of tech blogs ( Boing Boing, Makezine, Hack-a-day), and there is this outright contempt for people who don't believe in evolution, man-made global warming, and other science based "facts".  They seem to paint this picture of this select group of Tech geeks that believe in science "facts", and then there are the rest of us who just care about what Paris Hilton and Britney Spears are doing.  Maybe that's my misunderstanding, but that's what it sounds like to me.  So I was afraid this new book was going to be another disposition on this dichotomy.  However, I am such a big fan of NS's topics and style, I got the book anyway.

Initial Thoughts:
I am about 120 pages through this 910 page monstrosity.  At first, it was really difficult to grasp all of the meaning of the sentences because all of the vocabulary is made up.  I am horrible at pronunciation, so I know I am creating fictional ways of saying these words.  After about 60 or so pages, you start to get a little bit more comfortable with the words, and Stephenson picks the perfect time to start building the mystery.
I am very happy with the book so far.  The issues above that I was concerned about are there, but Stephenson is not very heavy-handed with it.

Here is one good quote from the book that I think applies to me:
"Boredom is the mask that frustration wears." 
The question is what to do about it.

Other observations:
The "secluded scientists" are basically just Augustinians Monks or at least characatures of them, but they just study a different topic.  It is an interesting point to see that this same behavior is rationalized when studying Pythagoras' theorem, but it is sheer folly when it is the Old Testament.

Well, I will try to do another update half way through the book and also at the end.  If I get "carried away to a dream world of magic", then I might not post again until the end.

Wednesday, September 03, 2008

Boston, Babies and Explosive Gases

I know I have been a slacker and have not updated the blog, so I will just throw out a little synopsis of my Labor day weekend in Boston.

I went to visit my friend Chris. He is a smart ass(double masters from MIT), but we went to school from 1st grade through our senior year in college. This was my first time in the Boston/New England area. The weather was great: low 70s, sunny, and a nice breeze.

The house where I stayed was pretty crazy. 7 adults, 2 18-month olds, and 2 babies under 3 months. A solid night's sleep was nonexistent(not that I am complaining :P). I also got stuck in Philly for 2 extra hours because I missed my connecting flight by 10 minutes, but that allowed me to see some of the South Carolina/NC State game.

Spending time with "Frankie-stein" (Chris's 1.5 year old daughter), I was encouraged that I was not clueless about children and felt like I was somewhat competent. (I did not have to do any of the hard stuff, though, hahaha.) But all the other crazy stuff (everything having to do with have a child) is very intimidating. Who knows where that puts me.

Overall, the weekend was great. I got to go to the Children's Science museum, MIT campus, and to Rockport, Mass (a small town on the coast).

One of the things that Chris and I wanted to do was to figure out if my compressed gas cannon idea was even feasible.

I have messed around with the physics but was never able to get a definitive answer with the math. We used an interesting selection of resources from plain old Thermodynamics text books to Wikipedia.

We calculated that to get 1 kg object to LEO, you would need about 2 kg of Oxygen and 0.5 kg of hydrogen. This is a good thing because it is not a ridiculous amount of gas that it would not even be possible. The next hurdle was the conversion of the energy from that explosion into heat or delta T (difference in temperature).

This is where we hit a roadblock. After doing some calculations using the specific heat formula, we come up with the delta T of 6000 degrees C, which just happens to be the temperature of the sun's surface. So that made us think delta T is incorrect.

After consulting the text books and searching online, the only real way we found to get this information was to actually blow up some gas in a bomb calorimeter. We don't have one, so basically we said we would just start to do some experiments with H2 and 02 and see what we might get.

Furture steps:
1. Create a setup for producing and capturing 02 and H2 through electrolysis.
2. Design/build/make up a fixture for exploding the gas- Chris's idea is an old engine block.
3. If results are above average, convert fixture into a cannon.

Friday, May 30, 2008

Scraping the World of Warcraft armory with Python

Well, in the last couple of weeks I started a new project. This was totally random but gave me great results.

I wrote a Python(man this language is awesome) program to scrape the WoW armory for my guild's gear. We have been progressing really well over the last couple of months, and we have been talking about killing two of the really big bosses. I wanted to see how well we were geared for these two encounters.

I googled around and I found this post. Got to give Peter credit; he got me started down the path that forced me to learn a little Python.

My code is horribly ugly, and I know a script monkey could have done this better and in his/her sleep. But I am very happy with the results that I got.

I didn't know and still don't know very much about navigating xml with Python, so I manually filtered my guild's toons with the armory and saved the xml file.
I hacked down the file so that all that was left was a list of members.
XML guild file layout looked like this:
<members>
<character url= rank= raceid= race= name= level= genderid= gender= classid= class=>
</character>
</members>




Each character had its own line.

Once I had that in a nice format, I had to figure out how to navigate the xml.
Searching around I found the ElementTree module.
It took me a while to find out specifically how to use it, but when I did it was very easy.
I started with:
from xml.etree.ElementTree import XML, fromstring, tostring
from xml.etree import ElementTree as ET
Then to parse the xml file.
try:
tree = ET.parse("guild70s.xml")
except Exception, inst:
print "Unexpected error opening %s: %s" % (xml_file, inst)
elem = tree.getroot()


This was the most confusing point to me. When I look at an xml file, i understand it, but I did not know how Python/ElementTree looks at it.
I just used print to figure out where I was in the xml file.

In this case, elem is equal to members element in the guild xml file.
Using a basic "for" e equals the characters in the elem members.
for e in elem:
Getting at specific attributes in the character lines was easy as well.
strUrl = "http://www.wowarmory.com/character-sheet.xml?" + e.get("url")
You just need to look in the xml file and find the name of the attribute that you want to retrieve. This also points out another neat thing about the guild xml file that I downloaded earlier. Each toon has their url as an attribute including all the formating, i.e. url="r=Zul%27jin&amp;n=Noldor" for my toon. This is great so you don't have to worry about the url formating compared to what Pete did above.

At this point, I could read each toon's xml file from the armory. The problem that I ran into was I kept getting 503 errors (website error) randomly throughout the script. I don't know if there was a lot of traffic or the site was going down for maintenance. To avoid having to run the script over and over, I saved each toon's xml file to a folder.

Navigating the toon xml files was a bit more complicated. Someone more skilled than I would know how to do this better, but this is how I got it to work.
I started with this:
   children = elem[0]
child = children[1]
items = child.find("items")


Got it down to:
    children = elem[0]
items = children[1].find("items")

I could not figure out how to do it in one line, so if anyone has any thoughts that would be great.


Basically that covers all the hard parts. I downloaded all the items that each toon had.
I used:
os.path.isfile(geardir + e.get("id") + ".xml")
To skip toons and gear which I had already downloaded.

In the end, I created a useful tool to see how well my guild is geared for the content that we are in.

The code is splintered into multiple files so I can't post all of them. I will just post one.
This code reads the guild roster xml file, finds the character, and then retrieves the items for that toon. Then it goes on to the next toon until all the guild's gear has been downloaded.

#!/usr/bin/python2.5
import urllib2
import xml.dom.minidom
from xml.etree.ElementTree import XML, fromstring, tostring
from xml.etree import ElementTree as ET
import os
itemurl = "http://www.wowarmory.com/item-info.xml?i="
geardir = "gear/"

try:
tree = ET.parse("guild70s.xml")
except Exception, inst:
print "Unexpected error opening %s: %s" % (xml_file, inst)
elem = tree.getroot()
for z in elem:

try:
tree = ET.parse("characters/" + z.get("url") + ".xml")
except Exception, inst:
print "Unexpected error opening %s: %s" % (xml_file, inst)
print z.get("url")
elem = tree.getroot()
children = elem[0]
child = children[1]
items = child.find("items")

itemstr = ""
for e in items:
if os.path.isfile(geardir + e.get("id") + ".xml") :
continue
oOpener = urllib2.build_opener()
oOpener.addheaders = [
('user-agent',
'Mozilla/5.0 (Windows; U; Windows NT 5.0; en-GB; rv:1.8.1.4) Gecko/20070515 Firefox/2.0.0.4'),
]
req = urllib2.Request(itemurl + e.get("id"))
itemstr = oOpener.open(req).read()
fout = open(geardir + e.get("id") + ".xml", 'w')
fout.write(itemstr)
fout.close()
print e.get("id")






Side Note: When I did this the special E/Alt-144 ascii character was not working. We had two people in our guild that used it, and I could not even see their pages with firefox, so it must be an Armory issue.

Wednesday, May 21, 2008

Project Tomato 4 review

Well, Project Tomato did not come to fruition this year. It was cool to see that some planning does get the ball rolling, but it boiled down to not having enough time to work on it in the correct environment (i.e. a lab).

I worked on the Zigbee aspect for a couple of days after work at my desk here at the apartment, and I just could not get it to work. In the end, I may have torched one of the Zigbee units.

I did get a moisture sensor made and soldered into a nice package. I got the code running on the Arduino, but I did not quantify what was wet, normal and dry. The other part was wiring up a FET circuit for the fan. That is about were the project died. I had the fan working, but it was not responding to changes in the temperature of the thermistor. It was my first time using the onboard PWM, so i probably will have to debug that part to understand what number I am putting in that function and how the PID algorithm is calculating it.

In the end, I started too late in the season to make the true project I wanted. Hopefully, next year I will have a house and a garden to mess around with.

Thursday, March 06, 2008

Project Tomato 4

Well, I am finally getting off my butt and putting one of my projects into action. The key to me even starting this project was being stuck on a plane flying from SEA-TAC to Atlanta. Man, that 787 plant is awesome.

This will be the 4th year in a row that I have done some sort of Project Tomato. Each year I have been getting progressively better results. The problem that I have now is that Noelle and I live in a one bedroom apartment, so there is no room or permission to do Project Tomato. Another discovery that I learned from last year was the failings of plant lights. So I want to do this outside in a sunny area to avoid that problem.

My parents live about 10 miles away, so I was thinking that I could do something at their house. But how do I kept track of what is going on?

Here is the idea:
I am going to keep all of the functionality of last year's project and add more sensors and controls. In addition to that, I am going to setup a zigbee transceiver that will relay information back to another arduino (minus the chip) connected to my parent's PC. I am trying to figure out the best way to get the information on the web so that I can view it from my apartment...still working out the details.

I have two arduinos and all the hardware from last year. I have ordered two Xbee shield kits and two Xbee 2.5 Transceivers from Digikey. I went with the new Xbee transceivers because they are a new model, cheaper, and slightly higher wattage. From the little I have read, only a few people have used them with the Xbee shield. They are pin compatible but cannot receive or transmit to the first gen Xbee models. I also ordered some other miscellaneous parts including two more Atmega168. My mega8 is working fine, but something happened to my 16 so I ordered two more just in case.

Three sensors- two temperature, one moisture
I am going to use the same thermistors I used last time, but I am adding one to measure the air temp. I am going to use the moisture circuit from the twitter project.

Two control variables - Heating pad and fan
I was contemplating adding a film heater attached to a heat sink so that I could heat the dome if needed, but since I am starting this so late, I am hoping that it won't be a problem. I could also include some sort of pump for watering, but I think I have all I can handle for now.

Tasks:
1. I gave my dad the biodome enclosure, and he is going to mod it so that I can mount a fan. I
originally wanted a large box to go over the whole dome, i.e. a dome over the dome. He
suggested just adding some lexan or Plexiglas to make the dome taller.

2. When the Xbee kits come in, I need to put them together and test them out.

3. I need to assemble the circuits for the moisture sensor and fan drive and reassemble Project
Tomato v3, with the addition of the other thermistor.

4. Rewrite the code for thermistor reading and start working on the rest of the capabilities.

5. Find a way to upload the data from the usb/arduino/xbee transceiver to a website.

Risks:
This is a lot to bite off in a small amount of time.
I am not sure that the arduino can handle all the code that I am going to need.
The whole Xbee capability is a big step, especially since I have never done anything with them. Who knows what the weather is going to bring...We had a big storm on Tuesday and that would have destroyed this project.

Any thoughts or ideas that you have? Please comment.


Hopefully if this works I can enter this Arduino Contest.