Thursday, May 18, 2006, 08:16 PM ( 39 views )
On the Solid State Relay, each contact is labeled. Contacts 1 and 2 are for completing the AC's circuit. Contacts 3 and 4 are for controlling the completion of the circuit between 1 and 2. Contacts 3 and 4 on this particular relay "support" between 3 and 30VDC. Contacts 3 and 4 are tied to the DTR and GND of the serial port, respectively. The +12VDC that the serial port supplies is more than sufficient to switch the relay.
You'll notice that the AC is grounded to the relay's mounting point. The solid state relay has a heatsink on the back of it, that the ground is secured to.
Jim Vaught and I were extra paranoid, and put a 120V switch and 15A Fuse inline before the current ever got to the relay. Furthermore this is switching the black (hot) wire, that way there is no live current when the switch is open.
permalink
Friday, April 28, 2006, 07:22 PM ( 2 views )
Two "hacks" concerning the DIY checkout line at Wal-mart:1. If you speak English, you may immediately scan items. You do not have to select a language. I'm sure most people know this, but if not, now you know. :)
2. If you are going to pay with a credit card you may swipe it once done scanning items. You do not have to select finish & pay, credit. I didn't know this, I tried it today.
Cheers,
Joe
Friday, April 14, 2006, 11:07 AM ( 2 views )
Work has been crazy.Everyone seems to have too much to do. This is not a bad thing, as it means there is work to do. However it seems that it has made some edgey, me included.
Fortunately a great deal is about to change. We're getting a full-time IT guy in. Terry and I get to drop a title, and a load of work. Speaking of Terry, hopefully he and the other members of development team will be less stressed soon, as today is code freeze for their project. I'm sure there are lots of bug fixes that await.
Anyway, finally getting good work done on my project. It was hard with a ridiculously high priority IT request, that apparently really wasn't that high priority, getting in the way. But now that's yestiday, so I'm back on track. Code freeze in two weeks. Bring on my bugs???
That's about all for now.
Cheers,
Joe
Tuesday, April 4, 2006, 08:47 AM ( 2 views )
We woke up late this morning, or at least I did. It was about 7:00a when I got up to start the morning grind. You know the normal routine, get up, prepare breakfast, feed Sam, go get Sebastian. Before I got up I heard him over the monitor saying, "Puppy" and other babbles. Everything was going accoriding to the routine, except this time, Sebastian came to us.As I was making his oatmeal, I recall hearing scuffling in his bed. I thought to myself, it must be Kristen getting him ready. Then I look to my right and I see that Kristen is getting herself ready still. "Hello", shouts Sebastian as he enters the room. Kristen asked, "Did you get him?" I replied no. The young man was quite chipper as he strolled into the kitchen. It was quite a pleasant surprise.
I hope he remembers to stay in bed when it is time to sleep.
Wednesday, March 15, 2006, 10:28 AM ( 2 views )
Just got back from the Free Coffee Day at Starbucks.Hurray for free coffee.
I'm drinking 12oz of free Verona.
Cheers!
Tuesday, March 14, 2006, 12:15 PM ( 3 views )
So let's check the temperature.Here's my Digital Rube Goldberg machine:

You can check it too:
Current Temp
I promise I'll write up a nice howto ASAP.
Specific Topics will include:
Hacking the WGT634U
Porting Packages to OpenWRT
How to find what you need on the Intarwebs/Connect-o-web/Internets
But don't hold your breath.. it will take a while
Monday, March 6, 2006, 02:59 PM ( 2 views )
What is working? Just ask Nate True.I've built one nearly to the exact same specifications as him.
Expect a write-up as time permits.
Friday, March 3, 2006, 08:52 PM ( 24 views )
Just finished watching "What the bleep do we know?". So if you've seen this movie then you'll understand.A problem that has bugged me is, "Why do the days seems as though they are getting shorter and shorter?"
The answer it seems is of course perception. There are still 24 hours to a day, right*? There are still 7 days in a week. But it seems Monday quickly rolls into Friday. Then it hits me. What makes a day seem long is if there is something new or different. What makes a day seem short is if a routine is followed. Therefore what makes the length of a day different is what my brain is perceiving. On days that are "short" my brain will go on "auto-pilot" not taking in new information, but rather reenforcing existing neural pathways. Therefore, much like when sleeping, time will seem to "fly by".
But lets take a day like last Saturday. We woke up early, went by the bank, looked at different cars, test drove cars, ended up buying a car, drove home. Multiple new experiences were taken in (compared to staying home and doing the same old same old).
Saturday was a "long" day.
Thoughts?
Here's some thoughts, why did out wedding go by so fast... it was all new.
*one might argue that the days are in fact getting longer due to tidal forces.
Tuesday, February 28, 2006, 04:06 PM ( 2 views )
Much has happened in the month of February.As such I give you:

Wednesday, February 1, 2006, 06:57 AM ( 1 view )
First some "backstory":If you're like me then you have too many computers... well more like too many keyboards and mice. While working at my current job, I bought a laptop and brought it into work. Now I could keep moving back and forth from keyboard and mouse to keyboard and trackpad, but that seems inefficient. A co-worker does the same thing I do, he brings in his laptop but he can slide his mouse from one screen to another, and suddenly his desktop machine's keyboard is active on the laptop. Yes, I'm talking about synergy.
Synergy captures the input from the keyboard and mouse and passes it on to the appropriate computer, based on the location of the cursor. This performed by sending the raw data over the network connection when the client has the focus. This becomes a problem because, if you were in a hubbed network or a switched network with arp poisoning, Eve could read every keystroke. My solution to this is ssh. So instead of my synergy client connecting to the synergy server directly, my client connects to localhost (the laptop) on the synergy port (24800) and then ssh takes all communication and passes it over to the ssh server on my desktop, which then forwards the data to port 24800 on the server. Secure Synergy. Also I setup my .ssh/authorized_keys on the desktop to allow for key based authentication instead of password.. so I just run the command in the morning, and synergy is good to go!
Without further ado the command (replace synergyserver with your server!):
ssh -f -N -L 24800:synergyserver:24800 synergyserver
Tuesday, January 31, 2006, 02:10 PM ( 1 view )
A question
I recently got an email requesting elaboration on the serial port controlled relay, and inquiring the number of devices that can be controlled with a single serial port.
An Answer
Essentially I'm using low-level ioctl calls to directly communicate with the pins on the serial port. This allows me to switch the relasy on and off. The reason the Solid State relay works so well is the way is because of the relay uses optical isolation to perform the switching.
Be sure that your circuits are completed as so:
PIN TO BE SET ------ Load ------ SERIAL GND
You can see in my picture:
That I've connected DTR to one side of the relay and GND to the otherside.
About the source code
(and why is may not compile!)For whatever reason pipes or the character that allows for bit-wise or'ing, do not show up as pipes in simplephpblog.. rather they show up as colons. So when copying and pating be sure to search and replace : for the "pipe" character.
A couple extra comments in the source code
Please see this site as it is a great reference for serial programming for POSIX operating systems.//Open the devices... /dev/tty or /dev/com....
int device = open("/dev/com2", O_RDONLY : O_NONBLOCK)
//Make sure it opened....
if(device > 0)
{
//First get the status of the relays:
ioctl(device, TIOCMGET, &status);
//Next set the pins that I want
status := TIOCM_DTR; // <- Thats a bit wise or, not Pascal assignment
//Finally tell the serial port what I want.
ioctl(device, TIOCMSET, &status);
}
Now what are the available flags for setting?
IBM PC/AT pinouts
TIOCM_CAR //DCD
TIOCM_DTR //DTR
TIOCM_DSR //DSR
TIOCM_RTS //RTS
TIOCM_CTS //CTS
TIOCM_RNG //RNG
How many devices???
Using a single serial port, gives you the option of easily controlling upto 6 independent devices by or'ing the flags together. You might be able to use TXD as well, but I'm not sure. Some of them are bidirectional, so they could be used for feedback. This is a naive approach, but should work for simple projects.
Disclaimer
Now a disclaimer.. this is pretty much abusing the serial port. I am not responsible in any way for any damages incurred with these instructions. This is not the way the serial port was intended to be interfaced. But... it works. It gives you +12V when on which is enough to switch some relays.
Future considerations
You might consider getting snazzy and add some logic to the relays that actually communicates using serial communication, that way (depending on your design) you could control a virtually unlimited number of devices from a single serial port.
Monday, January 23, 2006, 10:00 AM ( 2 views )
Thanks to Nate True for the javascript.His script has allowed me to document the lock pick project pretty well:
Lock Picks
Wednesday, January 18, 2006, 08:59 PM ( 2 views )
*nix command that is!Samba. It can be difficult to configure or it can be easy. I wanted it to be easy. Since I was only allowing internal hosts to connect to the samba server, I pretty much wanted them to have free reign on the shared drive. I want to be able to throw files on it and allow my wife to be able to access them.
Sounds easy. I had the config file written months ago. I had it working, and then suddenly it stopped. I'm not sure what caused the error, but without further ado:
# smbpasswd nobody
Enter NEW password:
Retype NEW password:
Tada, nobody now has no password. Still not a perfect situation, but I now have the shared drive. Also, it may be helpful to note that having everyone in the same workgroup is a good idea.
Hurray!
Monday, January 16, 2006, 04:37 PM ( 2 views )
Got a question from Chad Philips about the combination locks. He's been doing cool stuff with ping pong balls, lasers, and dc relays. Anyhow his question is concerning the combination lock cracker, which is still sadly unfinished. How did you drive the stepper motor from your laptop? Did you use the parallel port and your own circuit or did you use a serial port?
I used the parallel port. Here's where I found the circuitry for the stepper motor control:
Neil Fraser: Hardware: Stepper Motors: Computer Control
While I didn't get the idea for the combo lock cracker from Neil he has his own approach:
Neil Fraser: Hardware: Locracker
I got my stepper motors here (CHEAP!)
BGmicro
Sadly I paid $$$ out to radio shack for the transistors and breadboard.
In my implementation the high nibble of the parallel data was for a stepper motor that would tighten a bolt to "pull" the shackle. The low nibble of the data would "dial" in the combination. This way I could pull while dialing but ... never got around to it.. :(
Source available upon request.
Cool stuff.
Monday, January 16, 2006, 09:56 AM ( 997 views )
Recenty I was perusing the Make: Blog and happened to come across a howto on Controlling a relay and motor with a serial port. I commented on the project and have received two responses, one from the author, and one from a reader.Several months ago using a Solid State Relay, I built a serial port controlled switch. This allowed me to turn on any AC device I want with a simple C program.
Crude Circuit Diagram
---------
AC ---- 15 A FUSE ---- Switch ---- : : ------ DTR
: Relay :
AC ------------------------------- : : ------ GND
---------
If you'll notice in the pictures I also left the unused pins connected in the event I found time or use for them. Alas I have not, but the box still does it's job.
Voila:

The "switchbox"

What's in the box??!?!
Phew it's just some components.
And here's the code:
#include <string.h>
#include <stdio.h>
#include <unistd.h>
#include <termio.h>
#include <sys/fcntl.h>
void initAC(int device);
void turnACon(int device);
void turnACoff(int device);
int status;
int nap = 0;
main(int argc, char *argv[])
{
struct termios tp;
int dataRead = 0;
int device;
if ((device = open("/dev/com2", O_RDONLY : O_NONBLOCK)) < 0) {
printf("Couldn't open com2\n");
exit(-1);
}
if (tcgetattr(device, &tp) < 0) {
printf("Couldn't get term attributes");
exit(-1);
}
if(argc == 3){
nap = strtol(argv[2], NULL, 0);
}
printf(" SERIAL ANALYZER V1.0 ");
printf("DCD RXD TXD DTR GND DSR RTS CTS RNG\n");
initAC(device);
while(1){
turnACon(device);
usleep(740000);
turnACoff(device);
usleep(200000);
}
}
void initAC(int device){
ioctl(device, TIOCMGET, &status);
status &= ~TIOCM_RTS;
ioctl(device, TIOCMSET, &status);
printStatus();
}
void turnACon(int device){
ioctl(device, TIOCMGET, &status);
status := TIOCM_DTR; // <- Thats a bit wise or, not Pascal assignment
ioctl(device, TIOCMSET, &status);
printStatus();
}
void turnACoff(int device){
ioctl(device, TIOCMGET, &status);
status &= ~TIOCM_DTR;
ioctl(device, TIOCMSET, &status);
printStatus();
}
printStatus(){
printf("\r");
printf(" %c ", (status & TIOCM_CAR) ? '1' : '0'); //DCD
printf(" * "); //RXD
printf(" * "); //TXD
printf(" %c ", (status & TIOCM_DTR) ? '1' : '0'); //DTR
printf(" * "); //GND
printf(" %c ", (status & TIOCM_DSR) ? '1' : '0'); //DSR
printf(" %c ", (status & TIOCM_RTS) ? '1' : '0'); //RTS
printf(" %c ", (status & TIOCM_CTS) ? '1' : '0'); //CTS
printf(" %c ", (status & TIOCM_RNG) ? '1' : '0'); //RNG
sleep(nap);
}
Thursday, December 29, 2005, 08:02 AM ( 4 views )
I hope that all have been enjoying their holidays. I certainly have.My parents came up to visit this season. Tomorrow we'll be heading to Chicago to watch my brother graduate from Navy basic training.
A couple days ago my mother's sister and family came to visit us. It was a very nice visit, filled with laughs and Euchre. We were all amazed as my mom stomped us in the TV edition of SceneIt?
My sister-in-law gave me a Vintage Game Collection version of Risk. It is very nice. Instead of the plastic figurines, there are little wood pieces that are used to amass your armies.
Yesterday we played a complete 6 hour game of risk. The highlights were mom had seemed to solidify her position in North America with about 7 armies in each territory. Then my dad, with his southern hemisphere, turns in his three cards and destroys all but three of my territories (good work Kamchatka!) Then my dad once that battalion had been stopped, set his sights on my wife. He destroyed all but two armies in Iceland. My dad's armies now occupied more than half the board. It seemed like it was all over for my wife, but then it was her turn, and suddenly ICELAND HAD 50+ armies. She quickly reclaimed Europe. Then it was my turn, I turned in my cards... and in one turn was able to over take the US. Unfortunately we had not read the rule that you get an opponents cards after they have no armies... alas I was pretty barebones in North America. After two more rounds my father was ready to attack again, he was able to overtake me. Then it was down to my wife and dad. A couple rounds passed and Kristen turned in her cards AGAIN! After two more turns she won!
It was an amazing game.
Have a happy new year!
Thursday, November 24, 2005, 07:10 AM ( 2 views )
A Happy Thanksgiving to all.Racquetball round-up. Lost 4 games this week. I won the 5th.
LCD Project. We can write to the LCD, read the buttons, and set the LEDs all via the daughter board. Still can't do two lines of display. Need to get a more "portable" power supply than the molex plugs inside a computer (but hey its 5V)
Combo Lock Project. Stalled while I worked on the LCD.
Safe travels all, and don't eat too much
Sunday, November 20, 2005, 08:14 PM ( 2 views )
Yup, the results are in. My wife and I will be parents again! Hurrah!Ah August the turning point of our lives. I graduated in August, got married in August, became a father in August, celebrated my son's first birthday in August, watched my wife graduate from grad school in August, and will become a father again in August.
Thursday, November 17, 2005, 07:42 PM ( 11 views )
There are few things in this world that I enjoy more than tinkering with electronics. I understand some of the principles that govern the operation of the devices, but there is always a sense of awe and amazement when it works.A fellow co-worker, Jim Vaught, shares a similar passion for tinkering. Together, quite a few interesting devices have been created. For instance, the first project I recall was when we were working on a commercial contract. During this contract email alerts would signal that we needed to fulfill a part of the contract within 24 hours. Well, an email bouncing in your inbox signally such a task wasn't enough. So a little tinkering later, we created a device that interfaces with the serial port and acts a switch for a revolving red light. The project was a great success, whenever an email was sent a special filter would invoke a progam that would turn on the light for a preset amount of time.
The next hacking project was combination locks. This project is not totally complete, but is close.
And most recently involves a present I got two years ago. I asked for an $6 LCD module and accidentally fried it. Months later I order another one and fried it too. A few months ago I ordered two more along with the two stepper motors for the combination lock cracker. I noticed that the daughter board the LCD module was connected to had some very simple circuitry. So I wondered if I could reverse engineer it, but I figured I could use some help.. and Jim was happy to offer his assistance. In a couple days we were able to reverse engineer most of the circuitry. Currently data can be read from the switches on the module!
Next steps are actually getting the LCD module to display. Expect a full disclosure on how we actually got it to work, including source code... Cheers!
Monday, November 7, 2005, 07:14 PM ( 2 views )
How's that for dramatics?Seriously, we've repainted. The living room is no longer the Sunflower Yellow colorwashed with Burnt Sienna. While the textured orange was a very nice color, it clashed too much with the pinkish brick of the fireplace. We've now gone back to a much more subdued Mission Rock, which is better described as a tannish brown with a hint of red. It's like Raisin only two shades lighter, observe:
Before
After
In other news, I've started my first run of a tool that counts the frequency of instructions in executables, so that I can find the most frequently used opcodes. After this test run I plan to go back and add more statistical analysis so we can really get interesting findings. Here's hoping.
Friday, November 4, 2005, 07:01 AM ( 2 views )
Last weekend I went home for the Appalachian State University homecoming and to visit family and friends. The trip was rather nice, sans airport craziness. Attempted to open two of my parents' locks for them, only to find disappointment. At work Tuesday my boss handed me a combination lock and asked if I could open it. I tried and initially failed. I began to think that maybe the lock I had opened at work was a fluke. Turns out the shackle locks on the left side (dial side up). I was trying to shim the wrong side, at home and at work. SO, I need to ask try again with my parents' locks. Anyhow we were also able to recover the combination
39-21-39.
Cheers!
More on the way concerning the automated lock cracker....
Tuesday, October 18, 2005, 11:46 AM ( 2 views )
The new thing to do at the office seems to be ask a simple question, then get into a long, fairly intense discourse on who is right and what really happened. Then it dawns on one of us to look up said simple question in Wikipedia and prove that you are right... 



