Tuesday, June 19, 2012

JeeNode Review


I've been playing around with JeeNodes lately and I thought I'd post a review.

Executive Summary
I really, really like JeeNodes.  The software APIs are easy to use and intuitive.  Soldering them was easy.  The PCBs are well thought-out.  My main complaint is the documentation.  It's not that the documentation doesn't exist or that it is unclear.  The problem is the documentation is badly organized and hard to find.  I will attempt to organize the documentation I used in this posting.

Introduction
JeeNode v6 intro
I've been interested in doing some home automation projects and was looking for a good solution for smart wireless nodes.  I looked into the typcial XBee plus Arduino solution that lots of people used but I want to have many nodes and at $40-50 per node XBees were too expensive.  Then I found JeeNodes which can be summarized as inexpensive Arduinos with 2-way radios.  I purchased a set of 3 JeeNodes plus a USB-BUB from Modern Device.  The USB-BUB is a little USB adapter used to program a JeeNode.  It's only needed during programming so I bought one.

Assembly
JeeNode assembly
I largely followed the instructions from the site above.  The only major difference I found was that the large electrolytic cap provided with the kit was much taller than the one in the instructions so I would recommend leaving it for last. This component is the tallest thing on the board and it's easiest to solder the components from shortest to tallest.  For the right angle header on the end, it's a little different than the instructions which use a straight header; it's actually easier.  Just solder one pin then re-flow the solder as needed
to get it positioned properly, then solder the rest of the pins.


Initial Tests
JeeNode initial tests
As far as power settings: The Vout jumper on the USB-BUB should be set to 5V while the LGLV should be set to 3.3V (or VL).  The 5V will power the Jeenode and run through the onboard 3.3V regulator, while the 3.3V will be used for logic levels.

Software setup: Download arduino IDE from here.  Download and install JeeLib library from here using instructions in readme.

Next follow the instructions for the RF12demo sketch which should be located here: \libraries\JeeLib\examples\RF12\RF12demo\README

Luckily the RF12demo app is already flashed into the JeeNodes so you can skip that step.  I kept one JeeNode attached to the USB-BUB for communication and the other one I stuck into a breadboard and powered with 5 volts via the programming header pins marked VCC and GND. Worked like a charm.

Sending packets via the RF12demo sketch is described in stesp 9 and 10 of the README.

The RF12demo (the sketch that the JeeNodes come preprogrammed with) displays received messages like this:

"OK 2 122 3"

which is interpreted like this:
"OK" = checksum passed ("?" means checksum didn't pass)
"2" = node id
"122 3 ..." = data payload

Reference Material
JeeNode v6 schematics and user manual
JeeNode power tips

Impressions
I'm amazed at the quality of the end device.  The silkscreens are very good to the point where you really don't need assembly instructions.  Also the little things like the fact that the battery leads have built in strain relief through the PCB, and the port headers use the Sparkfun-style staggered holes to hold them in place
while soldering.  The software is easy to use especially once you've pinpointed some of the useful examples sketches from the JeeLib directory. The only thing that has been annoying is that the proper voltage settings for the USB-BUB are not spelled out; I had to look at the schematics for both the USB-BUB and JeeNode to figure out
the proper settings.  And as mentioned before generally the documentation is spread out willy-nilly across the jeelabs site.

Further Reading
The following examples are handy to use as building blocks for later reading.  I would also suggest perusing JC's blog and reading his various articles, he really goes in depth on various topics especially power management, which is very enlightening.

There are some very helpful and knowledgeable folks on the JeeLabs forums.

Here are some useful examples (from the the /libraries/JeeLib/examples/RF12 directory):
  • rfRangeTX - good example of a simple transmit
  • radioBlip - good example of putting processor and radio to sleep and waking up and sending message
  • roomNode - complex example of a full sensor node implementation


Monday, January 23, 2012

JeeNodes and a Motor Shield

Over the holidays I spent some time soldering up some stuff that I purchased lately.  The first is a Arduino Motor Shield from Adafruit.  I had just purchased this because it seemed generally useful, not because I had a specific project in mind.  I really hate wasting time breadboarding an h-bridge circuit when I just want to spin a motor.  It soldered up pretty easily in part due to the ridiculously detailed assembly instructions.  That wasn't meant as an insult to the instructions; I think it may have been the best documentation I've seen in quite a while.



The second soldering project was a set of three JeeNodes I bought to start working on doing some home automation projects. These assembly instructions were very good (though not *quite* as detailed as Lady Ada's typical instructions).  Everything went together smoothly, even the surface mount radio component that I was a little worried about.




I then ran the motor shield and all three JeeNodes through some tests to makes sure I had assembled them correctly.  I walked through the JeeNode tests here. It was really handy that all of the JeeNodes were pre-flashed with the RF12demo sketch which acts as a basic configuration and send and receive utility, which makes doing basic RF check out very simple.  Luckily everything worked on the first try.

Onward towards automating my house!




Tuesday, April 05, 2011

I've been away from my usual experiments for quite a while. But I have still been busy. For the whole summer and most of the fall, I decided to do repairs and organization on my workshop. So here's some of the stuff I did:

Shop Roof Repair
A couple of years ago the roof of my shop build got a small leak in it. At the time I didn't do anything about it so it kept getting worse until there was quite a bit of wood rot and water damage to the both the roof and to the floor boards. I started looking into what would be required to re-shingle the roof and I discovered that they had built the roof wrong from the beginning. Basically the roof didn't have enough slope and so water would pool on the virtually flat surface, which is what lead to the water damage to begin with. So rather than just re-shinle the roof and probably have to deal with the same probelm again later, I re-framed the entire roof. I first drew up the design in Sketchup, and I added a couple of new feature such as cross-rafter supports and under-eave vents. With the help of a friend I tore the old roof down to the top-plate of the building. I then built a new frame and put on new shingles. I researched how to do all this using several books on building sheds that I checked out from the library.

I made a huge mistake in doing this in the middle of summer, but in the end I got it done despite the opressive Texas heat. The week or two after I got it finished we had an almost biblical rain storm that lasted for several days, and the roof stood up to the pummeling without a leak. The shop is now a much better place to work without the nasty rotting roof and the fresh air that comes in through the new vents.

Other Shop Repairs
Since the roof turned out so well I thought I'd make a few more improvements. The floor had sustained some damage from all the water coming in through the leaky roof so I replaced a floor board that had rotted out. I also rebuilt part of the door frame that had rotted out by machining down a 2x4 to the exact dimensions of the rotted area.

The floor of the shop is wood that had been painted with some epoxy floor paint (like the stuff you'd paint a garage floor with), so I put a fresh coat of paint on the floor. I had also just had the exterior of my house painted, so I used the leftover paint to paint the outside of the shop so it matched the house.

Parts Database
I have a pretty extensive inventory of electronic parts, so extensive in fact that I often lost track of what parts I had. On several occasions I had purchased the same part several times, not realizing that I already owned what I needed. So I set out to create a parts database to prevent that from happening again.

I decided on going with a web-based approach for two reasons: 1) This application would be an excuse to learn some web technology that I just haven't bothered to learn in the past, 2) a decent web page seemed like the perfect solution for an application that needed search functionality and data storage, and 3) it would be nice to be able to host this web page such that it would be accessible to me anywhere in the world.

I didn't want to start from scratch if I didn't have to so I did a little research and found a simple parts database that had been created for a Circuit Cellar article. The database was written in PHP and used MySQL for the database portion. This site wasn't a perfect fit, so I heavily modified it to have a hierarchical category system using XML to specify the hierarchy, I added several fields like a URL field for links to datasheets, I added a login and password system so that no one could mess up my data if I hosted it on the open internet, and lastly I added browser detection so that I could serve up a special mobile-friendly version of the site if someone was viewing the page from a smartphone or similar device. Now it's easy to search, add new parts, and grab datasheet info for existing parts.

In addition to the database I organized my physical parts so that they are MUCH easier to find. Previously many of my parts had just been in bags and boxes in no discernible order. I got some small parts cabinets (like the kind usually used to hold screws and other small mechanical parts), and organized everything by type and value. So now I've got a cabinet for capacitors, resistors, ICs, sensors, connectors, etc. Now I can find an individual part in seconds instead of the tens of minutes it would take me before.

There's still a few things I need to do like rust-proof and sharpen some of my woodworking tools, but my shop is in a much more usable condition. Now back to my tinkerings...

Friday, June 04, 2010

I did some more work on pressure sensor testing, this time with a MP3V5004 sensor which has higher accuracy than the MPX5010. This sensor definitely did work better than the MPX5010, but it still was not accurate enough for my purposes. I also leanred that my test rig was very sensitive to two things: 1) The position of the tubes (even if one of them moved 1/64th of an inch it would affect the readings significantly), and 2) if there was liquid already in the tube from a previous reading. To correct this I secured the rig's test tubes so they couldn't move at all and I made sure to clear any liquid out of the tubes between readings. With these changes I got much higher accuracy, but the sensors I tested were still not accurate enough.

I found another pressure sensor made by Honeywell (HSCSAAN001PDAA5) that has significantly higher accuracy, but it is also MUCH more expensive ($40-50 per sensor). So I'm going to try some other specific gravity measurement ideas before I invest money in the pricey new pressure sensor.

Lately I've been experimenting with counting CO2 bubbles produced by a fermentation as an indirect way of measuring specific gravity. Currently I'm using a method which shines an infrared beam through an air lock. When a certain amount of CO2 has been produced in the reaction chamber a CO2 bubble goes through the liquid contained in the air lock (which really just acts as a one-way valve). When this bubble escapes it breaks the infrared beam momentarily which I can then detect electronically.

So far I've proven that I can detect bubbles with this apparatus; now I need to make sure that I can detect close to 100% of the escaping bubbles. Here are some pictures of my current test setup:




















Tuesday, April 13, 2010

I was able to find some sufficiently small hose clamps that fixed my air leakage problems, but now I'm having trouble with the accuracy of the pressure sensor. Here is some of the data I got during my last test session:

SG test solution -> ADC counts (0-1023)
1.000 -> 220
1.100 -> 240
1.062 -> 237
1.028 -> 233
1.000 -> 227
1.100 -> 244
1.062 -> 237
1.100 -> 242
1.000 -> 223
1.000 -> 226

So as you can see the trend is generally correct but there is too much hysteresis in the values. After perusing the datasheet for the sensor it seems that the overall accuracy is +/- 5% worst-case, so the sensor is performing much better than its spec. But it's still not very useful for my purposes.

Tuesday, April 06, 2010

I've been working with the pressure sensor again. I finally got a very ugly prototype of a hand-held meter built. The basic idea is that I have the pressure sensor wired to one of the analog inputs of an arduino, and then the arduino sends sample data out via serial to my PC.

I got some pretty good readings that look like I'll have a resolution of around 0.005 SG (which is usable, I think). The only major problem I ran into was that air was slowly leaking out the tubes that were in the water, which means the seal I have between the tubes and the pressure sensor ports isn't good enough. So the next thing on my list is to come up with a way to seal the tubes better.

Here are some pictures of the prototype:
















Tuesday, January 05, 2010

I've been continuing to experiment with the pressure sensor from the previous post. I had a problem for a while where the pressure sensor results were varying by +/- 50mV which basically made the pressure sensor unusable for my purposes as I was looking for better than 5mV accuracy. I did some more troubleshooting and discovered that my power supply was causing the variance. I put an additional voltage regulator before the circuit and that brought the accuracy down to 1-2mV, which is much more usable.

I've also found another Freescale pressure sensor (MP3V5004G) that has about double the accuracy of the sensor I'm currently using (MPX5010). I'm going to try out that sensor in the near future to see if it improves my results.

Now that I'm getting decent results I'm going to build a prototype meter using an arduino and start experimenting with a bit of software filtering and averaging to see if I can get a more accurate result. Eventually I'll also attach an LCD display to the arduino and make a hand-held meter for measuring specific gravity.

Here are some of my latest experimental results with the MPX5010 and solutions of varying density:

hydrometer reading of solution -> sensor reading
(with h = 6 inches)
1.000 -> 882mV
1.028 -> 896 mV
1.062 -> 933mV
1.100 -> 961 mV

(with h = 8 inches)
1.000 -> 1.105V
1.028 -> 1.130V
1.062 -> 1.148V
1.100 -> 1.177V

Tuesday, October 06, 2009

I had a little time to experiment with a new project. I'm working on using a Freescale pressure sensor to measure the specific gravity of a liquid. This is a piece of a larger project that I'm working on, but I need to research this before I work on the rest of it. More on that later.

Pressure in a liquid follows this formula:
p = ghd
where p = pressure, h = height of liquid above sensor, g = acceleration of gravity, d = density of liquid

So using a differential pressure sensor (MPVX5010DP) from Freescale, I can get all of the values in the formula and solve for d. The physical test setup is show in the picture below. Basically I have lengths of plastic tubing of two different lengths attached to the sensor's pressure ports (make sure to get the right tube to the right pressure port; pressure port 1 always have to have a higher pressure on it than pressure port 2; check the datasheet). The tubes are then tied to a steel ruler with the tube ends a fixed distance apart (in this case 4" apart).

It seems like the pressure reading does indeed change with the density of the liquid the probe is placed in. However the difference in the readings is fairly small. This tells me a couple of things:
1) I should increase the distance between the end of the tubes (essentially increasing "h" from the formula before). This should increase the magnitude of the voltage read from the sensor, thereby amplifying the sensor voltage. Eight inches between the tube ends should be good. 2) Since I'm eventually going to be reading the sensor voltage using a microprocessor's ADC, I can decrease the voltage range of the ADC to increase the resolution of the ADC readings. Based on my final application, I'm going to set the voltage range to 0-1.1 V.

Here is then data I got with several different sugar solutions:

Hydrometer Reading -> Sensor Reading
1.000 -> 707mV
1.036 -> 723mV
1.068 -> 734mV


Monday, August 17, 2009

I finished Nadia's desk a few days ago. The MDF sealer worked like a charm. Here are some pics.




















Monday, July 20, 2009

I'm just about done with the desk I've been building. The only thing left to do is putting a couple of coats of paint on it.

I ended up making the desktop itself out of MDF since it is stable, flat, and heavy. I routed some nice edges on the desktop but I've been having trouble painting the routed edges because they're so porous. I found a recipe online for a sealer made from 4 parts water and 1 part wood glue which should fix that problem. I'll try that out tonight.

I'll post pictures as soon as I get the desk done (hopefully this week).

Thursday, June 25, 2009

I've been looking into a new feature for my DVR PC: Boxee. Boxee is basically a media client which makes it very easy to watch streaming media (pandora, youtube, hulu, etc.). I've been jealous of my Linux and Apple-wielding brethren, as they've had Boxee support for some time now. But the Boxee folks have finally put out a public alpha for Windows. It's a little buggy (it is an alpha after all), but I've been playing with it and it has lots of potential. I think I'll definitely be installing it on my DVR PC once it becomes a bit more stable.

I even found a forum posting about how to use a Hauppage IR remote to control it (which is what I currently use to control GBPVR).

Also, I think Netlfix and Boxee are working together to create a Boxee app to allow viewing Netflix streaming content, which I'm really psyched about.

Tuesday, November 11, 2008

Right now I'm building a desk for my wife and I decided to undertake turning my own legs for the project. I didn't really want to purchase a lathe (and learn how to use it), so I found a technique which uses a clever jig plus a plunge router to do simple turnings. The idea came from the book Router Magic by Bill Hylton.

The way it works is you create a box with an open top and holes drilled in each end such that you can suspend a blank in the jig and allow it to turn freely. Then you create a sled that attaches to the base of your router. This sled then slides back and forth along the length of the blank. You just turn the blank by hand as you slide the router back and forth. I used a dish cutting bit in the router and it did an excellent job. Just a slight bit of sanding was necessary after turning the legs.

Here are some pictures:
















Thursday, August 21, 2008

It's been a year since my last entry. Wow. Time flies. The other day I decided to ressureect my PVR machine. Around a year ago the web site I use to get TV listings for my PVR software (GBPVR) stopped offering free TV listings, and so rather than having to pay a monthly fee to get my TV listings, I decided to shutdown the machine. Fast forward a bit and now there is a free way to grab listings from the Yahoo! website and convert to the TV XML format. So I spent the better part of a weekend installing new software and a bit of new hardware. Here's what I did in slightly more detail:
  1. I also use this machine as a file server so I updated it with my latest mp3 collections and got my external backup drive synced up with it.
  2. Fixed color issues with video playback. For the longest time I've had issues where video playback outside of GBPVR had incorrect colors and was basically unwatchable. After a bit of Google-Fu I went into the nVidia control panel and reset the gamma slider in the overlay menu, and that seems to have fixed the issue.
  3. Installed a new wireless network card and external antenna. I'm using an MSI 802.11g card plus a D-link external antenna which drastically improved my network throughput.
  4. Installed GBPVR 1.2.13
  5. Setup Yahoo! XML TV grabber
  6. Ran ChangeDatabase utility (included with GBPVR) to convert from my ver old version of database to the new system GBPVR uses. This fixed an issue with the "Search Guide" feature where it never found results.
  7. Installed latest stable build of Comskip, for commercial tagging in recorded TV
  8. Installed Weather plugin
  9. Installed Cinema Listing plugin
  10. Installed Netflix Watch Now plugin. This thing rocks!

Now my PVR machine is running like a champ! The bugginess in GBPVR and its plugins is gone now. Occasionally before GBPVR would get super slow (maybe a memory leak?) and I'd be forced to reboot the PC. I haven't seen that problem so far. Also, the DVD player is much more usable and smooth. And the Netflix Watch Now plugin allows me to watch Netflix instant movies on my TV without going through the Netflix website!

Thursday, August 16, 2007

I've had a busy summer at work so I haven't been able to work on projects, but all of that is starting to slow down so I've started spending time in the shop again. The first order of business is to clean up the shop and do some improvements to it.

I've got a long list of improvments I want to do, everything from new table saw jigs, to exterior paint, adding a portable spray booth, etc. But the very first thing on the list is to get a better stereo setup so I can listen to tunes while I work.

Long ago when I was in high school I had a spare car stereo lying around and decided to turn it into a small bookshelf stereo for my room. I did it and it worked, but at some point I set it aside and forgot about it at my parents house for many years. When I went home for Christmas I spotted it up in a closet and decided to take it with me.

So a few weekends ago I decided to resurrect the stereo for use in the shop. The stereo was pretty impressive considering I built it in high school with almost no knowledge of electronics. I even built my own power supply for it (which is something I probably wouldn't even take on today). I took it apart and after cleaning up some loose connections I plugged it in and it actually worked! I still upgraded some of the components, such as before I had the speakers attached to the car stereo with some crappy spade connector, so I added some spring terminals for the speaker wires.

When I used to use the stereo it would sometimes cut out for a few seconds every now and then when it had been running for a while. At the time I didn't have the technical expertise to figure out what was wrong. But with my knowledge now I know that that sounds like a thermal issue. So I took a look at the power supply I built so long ago and sure enough the 7812 voltage regulator was burning hot. So I made the guess that it was overheating and the built-in thermal protection was kicking in cutting off the voltage output. I attached a heatsink to the 7812 and viola, I haven't had it cut out yet.

The only thing that didn't survive in the stereo is an old Sony FM modulator that I used to add an audio input (so I could tie in a CD player or mp3 player). It finally modulated it's last audio and it seems dead now, so I'm going to by an FM transmitter for my iPod and we'll be good to go.



Tuesday, May 08, 2007

After a long delay I finally put the last nails in the coffin of the arcade project. It's finally done!!!

Here are some pics of the final assembly stages including the back of the marquee box, the bezel, the "flippy" access door, and the marquee lit from behind. Soon I'll be posting some pictures of the arcade with the TV installed and maybe even playing a game or two. Enjoy!





Monday, March 26, 2007

This weekend I finished up staining and polyurethaning the remaining arcade pieces. I'll spare everyone the boring pictures since it's just a bunch strips of stained plywood.

My dog decided to help out by chewing on one of the pieces just as I was about to put on the first coat of polyurethane. It ended up being repairable but I was still pretty pissed.

Later tonight I'm going to start mounting the pieces.

Tuesday, March 20, 2007

I'm still alive, and I have even been working on the arcade (albeit slowly). The only thing left to do on the arcade is making and mounting the bezel, and mounting the marquee. This weekend I got all of the pieces cut for both of these things. Next up I need to stain and polyurethane the pieces (they're all birch plywood). After that I just need to mount everything and then I'm finally done!

Thursday, March 01, 2007

We just got a dog about 2 weeks ago. We found her at the Georgetown Animal Shelter, and we think she's a 1 year old lab.

And she's why I'm not done with the arcade yet (or at least that's who I'm going to blame it on). I have gotten a little bit further on the arcade. This week I finished adding supports to the arcade so that it doesn't rock as much while you're playing. I also finished the back panels which slide into slots I routed in the arcade to cover up the innards of the arcade in the back.
















Wednesday, February 14, 2007

The stained glass marquee is done and being shipped to me soon. Here's a picture.

Monday, February 12, 2007

I finished up the T-moulding and I think it looks pretty good. Here's a picture.

I also got the first light gun hooked up. I'm not very impressed with its accuracy but it could also be the old TV I'm using...