Brad - Mar 23rd 2010, 10:26 PM
It has been awhile since my original post about seeing how large of a distance I can get two XBee PROs to communicate, but since coming across two nice 902 - 928Mhz ISM band 9 element yagi antennas I figured it was time to give it a try.
My plan is to mount two XBee PRO XSCs each to one of the yagis mounted on tripods. A small ttl to serial interface will be needed at each end which will allow interfacing to laptops. These setups will need to be as portable as possible. With each setup I will be able to set them up easily at any location (the tripod / antenna / XBee and interface, along with a laptop will be the only items needed) and test signal strength and communication using the XBee X-CTU application.
Brad - Feb 24th 2010, 12:10 AM
I was recently staring at a pile of 15K RPM SCSI drives that had gone bad at work. I have always admired the build quality of these drives, the fact that they can spin at 15000 rpm without failure for years is amazing. I was curious if the platter spindle motors would be useful to use in any type of projects, so I tore a couple drives apart and pulled the spindle motors out of them.
#pragma config WDT = OFF
void delay1(int result1)
{
result1 = result1 / 20;
if (result1 <= 30)
{
result1 = 30;
}
Delay1KTCYx(result1);
}
void delay2(int result1)
{
result1 = result1 / 12;
Delay1KTCYx(result1);
}
void main (void)
{
int result1;
TRISB = 0x00;
while (1)
{
OpenADC( ADC_FOSC_4 & ADC_RIGHT_JUST & ADC_4_TAD, ADC_CH0 & ADC_INT_OFF, 15 );
ConvertADC();
while( BusyADC() );
result1 = ReadADC();
CloseADC();
PORTB = 0b00000001;
delay1(result1); //big
PORTB = 0b00000000;
delay2(result1); //short
PORTB = 0b00000010;
delay1(result1); //big
PORTB = 0b00000000;
delay2(result1); //short
PORTB = 0b00000100;
delay1(result1); //big
PORTB = 0b00000000;
delay2(result1); //short
}
}
Brad - Feb 4th 2010, 9:33 PM
Brad - Jan 7th 2010, 8:29 PM
Brad - Nov 18th 2009, 9:42 PM
In a recent auction I purchased two HP16500B logic analysis systems and one HP16500A system for pretty much next to nothing which had me very excited. I have been looking to upgrade from my current 1630D logic analyzer to something a little more powerful. My 1630D has been excellent and has worked perfect for many tasks, but I have been finding that I have needed a more powerful analyzer with a lot more memory depth for some recent hardware hacking projects i have worked on. I have wanted to buy a 16500B system as their prices are reasonable, but the hard drives that they use have scared me. These hard drive based systems are ticking time bombs. Once it's disk fails the device is useless unless you have the original system boot disks for it and a working floppy drive.
Brad - Oct 22nd 2009, 12:38 AM
Brad - Oct 1st 2009, 12:57 AM
Brad - Sep 20th 2009, 12:45 AM
Brad - Aug 8th 2009, 11:47 PM
I finally finished the one to many workings of the PHP Framework (Hypogeum) I am building. The framework is geared to be simple yet efficent. Each object has a database definition that links it to one or many tables in a database (ie: a user has user info in the "user" table, and the users avatar resides in the "avatar" table). Once defining your user with one simple array, the class autolads your data and gives you all kinds of ways to manpulate that user, including ways to extend your own functions (like a login function) off of the class. Here are a few quick examples as to things you could do with Hypogeum:
// get user with the unique_id of 1 from the database
$me = $c->user(1);
// echo out the users name
echo $me->attr('username');
// write a new user name to memory
$me->attr('username', 'MyNewName');
// save the users new name
$me->save();
Now the neat part is, all of the tables are bound to the same object, so lets say you want to change the users avatar image title, but thats not in the user table! no fear. You have already told the user class that we have multiple tables.
//set new avatar title
$me->attr('avatarTtitle','This is my new title');
//save the avatar title
$me->save();
The class knows that the 'avatarTitle' field exisist in the 'avatar' table, so it writes accordingly. If you have multiple fields with the same name, its as easy as:
$me->attr('avatar.avatarTitle','This is my new title');
The framework knows to look for a period, and try to use that as a table name. If it cannot, it throws an exception. And i know what you're thinking; "what if i put $me->attr('avatar',"x'; Drop Table users;")"? Well, a few things. If you wanna break your own database, go for it. However you wont be able to use my framework. Everything that interacts with the database is made safe via php filtering, but before that it has ot match the Regex that you define for each field.
So far i bet youre saying "big deal. so you can get one user from a table". Heres a few more options:
$us = $c->user->search('Jim');
foreach($us as $key => $val){
echo $us->attr('displayname');
}
This will allow you to search the user table (on the field or fields you have mapped for string seraching) for users with name 'Jim'. Lets say you want to find all users that have the letters "er" in their last name.
$us = $c->user->search('er',true,'lastName');
The second argument in the search method tells the function to perform a SQL Like search. The third binds the search to a custom field (any field mapped to the table).
If you want to find all of the users that are between the age of 18 and 25, you simply:
$us = $c->user->searchBetween(18,25,'age');
if you want to get all of your users:
$us = $c->user->getAll();
Now heres where i get to the awesome part. You can map objects (oe to many) together. Lets say you have a table of user attributes such as "happy, sad, flaky, duck-like, etc..." and you want to map these attributes to a user. With one line of code in the user class:
// table, id to map from, id to map to
map( 'user_attrib', 'user_id', 'user_id' );
you will automaticly map those attributes when you get your user info. so now, when you get your user info, the mapped data comes with it.
$me = $c->user(1);
echo $me->attr('username')." is:\n";
foreach($me->getMapChildren() as $key => $val ){
echo $val->attr('attributeName')."\n";
}
This would output something like this:
Tendrid is:
happy
duck-like
etc...
It only outputs the attributes that match the current users user_id in the attributes table. And yes, it scales. Even if you get all of the users in the database (say you have 1000), that only requires one sql statment. Once it retrieves all of the users, it then performs a second SQL statment based on a list of all of the ids. So even with 1000 users, all having 50 unique attributes, you only have 2 sql statments. Also, if the attribute already exisist in memory (based on the unique id of the class. In this case being attrib_id) then the framework does not include that in the SQL query, instead it just maps a reference to the attribute already existing in memory. This type of read-check occures on all objects. ie:
$c->user(1);
$c->user(1);
Would only result in one SQL statment.
On top of all this sweet stuff, the framework also has an extended layout class which has a template system based on sprintf expressions. Once you define the objects html template, you can simply do this:
$us = $c->user->getAll();
foreach( $us as $key => $val ){
$val->draw();
}
This will pass the objects current parameters into the template, and output the object formatted in the HTML directly to the browser. The draw method even supports custom sub templates (such as different sizes) all of which are indavidaly set.
$us = $c->user->getAll();
foreach( $us as $key => $val ){
$val->draw(SMALL);
$val->draw(MEDIUM);
$val->draw(LARGE);
}
There are a lot more features to this framework, and i will go over them in detail in the future. The framework will eventually live at hypogeum.net but there isn't much there now :)
Jim - Jul 20th 2009, 10:35 PM

Brad - Jul 19th 2009, 12:13 AM
We just put in another order to sparkfun for our upcoming rocket build out:
DC to DC converter module 6A (Count: 4)
XBee Pro 900 XSC RPSMA (Count: 2)
JST Vertical Connector (Count: 10)
GPS Micro-Mini (Count: 1)
Break Away Female Headers (Count: 10)
IC Hook Test Leads (Count: 2)
Breakout Board for MEMs Barometric Pressure Sensor - SCP1000 (Count: 1)
Break Away Headers - Straight (Count: 10)
I2C EEPROM - 256kbit (Count: 10)
Humidity and Temperature Sensor - SHT15 Breakout (Count: 1)
SMA Male to RPSMA Female Adapter (Count: 2)
900MHz Duck Antenna RP-SMA (Count: 2)
2mm 10pin XBee Socket (Count: 8)
Breakout Board for XBee Module (Count: 2)
SCP1000 Gasket (Count: 1)
Some of these things will also be used for the balloon launch that we plan on being a part of later this fall. More to come on both projects as they unfold.
Jim - Jul 15th 2009, 4:37 PM
I've implemented a few new features in Lyfe.net over the past few weeks, but I haven't really had time to sit down and clickty-clack out the hows and whys on my keyboard (until now).
Short Urls - We implemented a base 64 (as in a base 64 symbol set, not the encoding mime type), so now urls are weird looking and like 2-3 characters shorter! Thats how you can tell they're fancy. We shorten the URLs by working with a larger symbol set (0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_) instead of the expected base ten set (0123456789). This makes a number like 16000000 boiled down to z2G0. We do this for the sake of twitter, and other social networks where text space is vital. We have a test example script available here. Special thanks to Jeff for sassing up the code with bit tricks.
Habla chat - I implemented Habla for those of you who have questions. Im usually available at during the day. Just look for the chat box in the bottom right corner of the screen on Lyfe.net
Social network - Auto posting to facebook and twitter is fully implemented, however there are a couple of bugs with the signup i need to work out (when i get the time).
I will have more to update on Lyfe when i get some time, Unfortunately other projects (such as peoplebacon.com) are taking up a great deal of my time. Oh, and wedding planning has a tendency to monopolize time as well.
-Jim
Jim - Jul 6th 2009, 12:23 PM
Last night I was able issue a start command over I2c to the TCM8230MD camera module to have it start sending images. I'm now receiving valid YUV 422 data off of the 8 bit bus along with the necessary clock and sync pulses.
This camera is definitely not the easiest thing to work with. The datasheet is not as clear I would have liked and the timings necessary for the startup sequence took a little bit longer to figure out than I had expected.The next step will be to be to send the camera a few more control codes to lower the frame rate and resolution to get the data rate to a more manageable level for the pic. I'm hoping to capture and display my first usable image over the weekend.
Brad - Jul 2nd 2009, 1:15 PM
Here is a quick list i am throwing together to further inform the visitors of ignite about what it was i was muttering on about up on stage.
The radio I mentioned (which we will be using for our next launch) is an XBee Pro.
The GPS I featured in my slide was the Venus634FLPx, but you may want to go with this product because it is much easier to work with, plus it stores your GPS data onboard (so no need to record the data on your ground station).
I featured 4 cameras all of which had the time laps feature, but was told after my speech that the now famous cannon hacks can work on a broad range of cameras, and one of the features they boast is time lapse photography.
Jim - Jul 1st 2009, 11:29 AM
Five minutes, 20 slides. What would you say?
If you had five minutes on stage what would you say? What if you only got 20 slides and they rotated automatically after 15 seconds? Around the world geeks have been putting together Ignite nights to show their answers.
Ignite was started in Seattle in 2006 by Brady Forrest and Bre Pettis. Since then 100s of 5 minute talks have been given across the world. There are thriving Ignite communities in Seattle, Portland, Paris, NYC and now Ann Arbor.
We invite you to attend the first ever, Ignite Ann Arbor event. You may learn a thing or two, or perhaps even make some good networking contacts.
To learn more about this event, head over to http://www.igniteannarbor.com
Please RSVP at: http://igniteannarbor.eventbrite.com (Space is limited!)
Twitter search term: #ignitea2
Jim - Jun 29th 2009, 3:09 PM
I recently purchased a few small TCM8230MD CMOS cameras made by Toshiba from SparkFun. I plan on using the camera for some machine vision experiments as they are controlled by an I2c bus and have an 8 bit parallel video out with sync and clock. This makes them very microcontroller interfacing friendly. I plan to use a higher end PIC micro to receive the picture data and process the received video frames. The only issue is that I didn't realize how small these cameras actually are until I tried to use one.
My first attempt at soldering didn't go so well as the solder pads on this device are extremely small. Since no breakout board is available and the lead spacing on this device appears to be non-standard, I went for a custom PCB design.
I made the initial pattern in Eagle using the dimensions from the datasheet to space the solder pads for it, than drew simple traces to solder pads for two headers. I then used the instructions here to transfer the trace layout to a copper PCB.
A nice thing about this simple board is that I didn't have to worry abut mirroring the layout when printing as the orientation of the camera doesn't matter. Once the board was etched in Ferric Chloride, it looked like this:
Not bad for a quick design, there was one weak trace that was etched too much but a little solder will fix that. One note about etching, It took much longer to etch than anticipated. About 20 minutes was needed with me agitating the board for the last 10 minutes.
A reflow procedure was used to solder the camera down, I did it with an electric skillet. After reflow, a quick test showed no shorts and inspection of the pins to pads looks good. I plan on starting to use it tonight.
Now that I have made the board, I would have changed a few things. I should have made pin 1 on the camera line up with the standard pin 1 location on the board. I should have also made all the header pins along one side of the board instead of two so I could use right angle headers to mount the camera vertically. I also didn't forget to drill the holes in the board for the headers, I purchased new PCB drill bits online and they have not arrived yet. I'll just solder jumpers to the pads for now. Yes i'm impatient.
Brad - Jun 27th 2009, 2:07 PM
Like a raging bull on steroids, i have blindly taken up the task of resurrecting a project of mine, long forgotten by the user base it once had. Lyfe.net was once a very involved vice of mine that monopolized my time to such a degree that i lost sleep due to hallucinations about the project going awry. I will use this blog to illustrate a great deal of mistakes i made in the past, and a personal road map as not to repeat them.
Welcome to my self inflicted blight.
Entry:
My journey started long ago, sometime in January of 2004. I had just purchased my first camera phone (a Nokia 3650; the first camera phone released in North America) and wanted nothing more than to send images directly to my already established blog of daily insanity (neverendingdoom.com). Long story short, i wrote some code, and got it working. Soon after, my blog readers expressed interest in a service so that they could do the same. After some more code pounding, Lyfe.net was launched some time in early 2006. Users could sign up, and send pictures directly to Lyfe.net, or Myspace.
Decay:
As Lyfe.net became more popular, i began to create new features. I was under the impression that people wanted functionality out of a service, (which i now know to be total bullshit. want proof? how many assholes gave a green beer to each other, or threw a snowball at their friends on Facebook vs the people that actually use any of the advanced applications? the numbers are staggering) The first feature i wrote in was a survey application that allowed the user to create a series of questions, then put the survey on their Myspace profile. Once you took the survey, it would save all the answers and show you who your answers were most like. This application failed. In my opinion, it was totally bad ass. I think 6 people created surveys, and a total of 15 people took them. A total flop. So then i moved on to creating a game out of the picture aspect of the website. There was a weekly scavenger hunt to be launched that anyone could join. I was to design the first one, and the person who found all the items in my list and sent them to Lyfe.net first won. Their prize was the ability to design the next scavenger hunt. It was a great idea (and it may even work today) but nobody jumped on board. I equate this mostly to the fact that camera phones were still very early, and people commonly forgot they had the option of taking pictures with their phone. My next goal was to work video support into Lyfe.net, but when i asked my user base for videos to test with, i only received one. I ceased all development on the project the next day.
Resolve:
About a year ago i came up with a fancy idea to implement groups into Lyfe.net. I planned out the implementation, but was pulled away for another project. But now, 5 years after my initial code was written, i have started development yet again on the Lyfe.net project. I have wrangled the other two unfortunate souls i commonly called on for help with the project to put some time and effort into resurrecting this project. Perhaps Lyfe.net was before its time. Perhaps the idea is a total failure and I’m a jackass for not letting it die off, but everyone needs a hobby.
Jim - Jun 24th 2009, 5:42 PM
This summer there are a few projects I have planned. One of the first is a model rocket tracking / data-logging system for some launches I am planning on performing this summer. I recently came across a good supplier of F and G series rocket engines for a very reasonable price. Some of these engines have as long as a 7.8 second burn making them very exciting to see take off.
The idea of this project is to be able to record all acceleration of the rocket throughout the the entire launch. The tracker will also have a GPS receiver that can log it's maximum altitude as well as track its decent to aid in finding it's landing location in the event of a launch where the rocket landing ends up not being visible. This GPS data will be transmitted through a long range Xbee tranceiver.
The basis of the performance data is an Analog Devices ADXL accelerometer. These accelerometers are very cheap and very accurate. They are available in different models with varying degrees of g resolution. The model I am using here is the ADXL330, a three axis +- 3g accelerometer.
The +-3g of resolution is fine for testing, for the actual rocket launch I will be using a +-18g accelerometer to capture launch and decent data.
The ADXL is a pretty small SMD device, so soldering was a little tricky:
Brad - Apr 13th 2009, 11:05 PM