I’d been working on updating an old php3 version of the Colossal Cave. Time and availability for other tasks (see: scanning 1958 radio & TV home study course…) got in the way. So I took the lazy-man’s way out.
The excellent Arthur O’Dwyer has generously allowed for posting (for historical recording, study, amusement and proliferation about the internet) on this website, his great translation of the original Crowther & Woods 350 point version of “Adventure”. The work is all his, and we all owe a debt to the Elders: Will Crowther and Don Woods.
I’m so lazy, I borrowed his whole page, so as to not damage the content. Visit Colossal Cave.
My first contact with “Adventure” was at Harris Corporation (Interactive Terminals Group), on Dallas Parkway. I walked into the computer lab (and showroom!) one day to see Kim Shrier busily porting the Fortran version to a Perkin-Elmer Interdata 7/16. (Kim may correct me, some day, if I have the machine wrong).
Or, “Most Accurate” SB-630: Retro Style Desk Accessory, Updated on a Budget
A while back, I was given an SB-630 Station Console by an old timer acquaintance.
The SB-630 is a nice, but not especially necessary station accessory. Some hams built them just to have the complete SB-line. The console consists of a passive SWR meter, a phone patch, a motorized Digital Clock and the unique feature: a 10-minute Identification Timer. Better versions of the SWR Meter and Phone Patch were sold separately; the clock-timer was unique, so the SB-630 was merely an opportunity to wrap them all up in a single desktop accessory. Since there’s nothing unique about the SWR Meter or the Phone Patch, for my purposes, I shall focus on the clock-timer combination.
My plan was to build a new clock display, keeping some of the old style (albeit 1970’s style, not 60’s), and drive them with an Arduino micro controller. The real-time clock is provided by a Maxim DS1307 (formerly Dallas Semiconductor) 8-pin IC. The chip is tiny, uses very little current when it’s ‘on’, and is backed up (according to the datasheet for 10 years!) by a single CR2032 3-volt lithium battery.
All Tubes and the Plate-Filament transformer were removed (and saved, for future tube projects). The clock was given to a local collector who prefers to keep his Heathkits original. The functionality replaced – and enhanced – by adding a Real-Time Clock (RTC) chip, a WWVB receiver and Arduino code to interpret the 1950’s era clock signal.
The WWVB receiver reads each ‘pulse’ of the signal and interrupts the Arduino (INT1) to add the ‘tick’ to the buffer. Once the whole signal is received, it can be interpreted as a date and time. The RTC pulses (INT0) each second in order to drive the display clock.
In addition, an LM35 sensor provides the current room temperature.
Original WWVB decode source from http://duinolab.blogspot.com/2009/06/arduino-cmmr-6p-60-almost-accurate.html (Capt Tagon) and all others who’ve improved this code. Website seems abandoned, but the source code is good. My alteration is to remove the timer interrupt (1000 times a second) which operates the 1-second tick and replace it with the square wave output (SQWE) signal from the RTC chip, a Maxim DS1307.
The LCD is 16×2, and the layout needs to accommodate Date, Time, and Day, along with an ID Timer. A room temperature indicator is ‘extra’.
Character Display is laid out on the 16×2 LCD Display.
It’s a bit cramped, but I’m able to show everything I wanted to display, and I have plenty of Arduino pins left to trigger the ‘IDENTIFY’ lamps and ‘audio tone’, and a few pins left for future expansion.
Schematics
The DS1307 has it’s own battery-backup, which retains the time on power-off.
Detail of the DS1307 Real-Time Clock connections.Schematic of the CMMR-6P-60 (now unavailable)Overall Schematic of the ATMEGA168 IC and it’s connections.
The WWVB Receiver IC is no longer available. A better choice today would be a GPS receiver, which would provide the same (or better) accuracy and is in the same price range now, with some GPS modules selling for as little as US$14.
Finally, the ATMEGA168, LCD, ID Lamp Relay, Temperature Sensor, and the Tie-in with Original Switches.
Code
Source Code contains classes for the DS1307 and the CMMR-6 WWVB receiver.
I really liked the Nuts & Volts Magazine project “Garage Parking Assistant” in January 2010, but I don’t ‘do’ Basic Stamp – no reason really, just not my favored platform and N& N & V seems to base a lot of projects on that platform.
So, I translated it to Arduino and replaced the Basic Stamp with a minimalist Arduino (Atmega 168, a clock resonator, a couple of resistors and capacitors, and an LM7805 voltage regulator). From there, code translation (BASIC to “C++”) was easy. I make no originality claims and I’ve only provided a code translation.
Garage Parking Light – Translation to Arduino
This is a project I’d been thinking about for some time, but was too lazy to do. Finally a version came out in Nuts & Volts, January 2010. Their version was based upon a Parallax Basic Stamp module. Not a huge problem: I translated it for Arduino and built the whole thing on a small circuit board. This project is also well documented over on Savage Circuits. I have nothing against the Basic Stamp modules, it’s just that I had parts on hand to build an Arduino version.
Parts
The Parts List is similar to the magazine defined project.
The original Basic code for the Stamp was translated to Arduino’s familiar C++. I’ve retained the original author’s comments and I’ve used the constants provided therein for evaluating distances to the arriving car. I didn’t provide the “Setup” mechanism, including the momentary press button, but I’ve included
PING))) Ultrasonic Sensor, mounted on the wall at bumper height.
it in the translated code. I used the original vehicle distances, as they suited my needs.
The Arduino platform used can be whatever is on hand. I usually use an RBBB from Modern Device, but in this case, I used a minimal Arduino built from a couple of resistors, a resonator for clock (or a crystal if you have one). The minimal Arduino, and a programming
header was constructed on the same board as the LEDs are placed, but off to the side.
One feature I did add was a ‘darkness’ sensor — I didn’t feel that the PING))) Ultrasonic Sensor should be working when it’s not needed, so I sense darkness with a simple analog read of the voltage drop across a Cadmium Sulfide (CdS) resistor.
Since the garage is dark except for:
Daylight – bright light enters from the open garage door
Night – headlamps will turn the Parking Light on
if ( analogRead(LightSensor) > 600 ) {
// Lights are on, or door is open and it's daylight.. Start to Work...
// establish variables for duration of the PING))),
// and the distance result in inches and centimeters:
long duration, inches, cm;
:
: (rest of PING))) Loop here...)
}
else {
// DARK! Sleep Now...
digitalWrite(RedLED, LOW);
digitalWrite(YellowLED, LOW);
digitalWrite(GreenLED, LOW);
delay(1000);
}
The CdS sensor peeks through the enclosure via a small hole above and to the left of the LEDs.
Hardware Differences
Since the controller changes from a Basic Stamp to an Arduino, there are a few hardware changes. The Arduino Digital and Analog Pins selected are:
Ping Pin – In/Out, Digital Pin 8; uses the PulseIn Function to detect the reflected Ping
Red, Yellow and Green LED Driving Transistor Bases: Digital Pins 11, 10 and 9
Program Button (implemented in code, but not used): Digital Pin 12
CdS Voltage Sensor: Analog Pin 5 –> inputs from a voltage dividor including the CdS sensor
The original article uses the Basic Stamp to drive the LEDs directly. I used a transistor to drive them, as the Arduino pins cannot source about 40ma of current. The Digital Pins might be able to supply enough current, but I’ve used the pin to drive the transistor base and let the transistor switch the current as a conservative design choice.
Source Sketch Files
Version 1 – works with Arduino-0018, uses a CdS light to turn off when garage is dark.
I added some small calculators to the ‘Software’ link. While rebuilding a Heathkit V-7 VTVM, I just couldn’t find a good match for a couple of out-of-tolerance precision resistors in the divider network. So I built my own: a) Toroid Calculator and b) Precision Resistor Calculator.