Category Archives: Arduino

Arduino Projects or variations of other published projects.

“Most Accurate” SB-630 – An Update of an Old “Timer&”

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.

The LCD is from SparkFun, a Red-on-Black, Backlit LCD which fits well.

Construction

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’.

SB-630 LCD Layout
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.

DS1307 schematic
Detail of the DS1307 Real-Time Clock connections.
Schematic of the CMMR-6P-60
Schematic of the CMMR-6P-60 (now unavailable)
Overall Schematic of the Microcontroller
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.

 

Garage Parking Light

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.

Qty Description Source Notes
1 Project Enclosure, approximately 3″ x 2″ x 1″ Anywhere For the Sensor
1 Project Enclosure, approximately 5″ x 3″ x 1.5″ Anywhere For the Controller & LEDs
1 PerfBoard to fit the Larger Box Anywhere
1 10mm Red LED Red is brighter; use a larger resistor
1 10mm Yellow LED
1 10mm Green LED
1 PING))) Ultrasonic Sensor Radio Shack
1 470 ohm, 1/4W Resistor Anywhere Red LED is Brighter
2 220 ohm, 1/4W Resistor Anywhere
1 Minimal Arduino or RBBB Kit www.moderndevice.com RBBB Kit or build a Minimal Version from parts

Arduino Code

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
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.