LED, in response to how close a person gets to the front of the badge.
|Badge Reverse Side - Arduino Pro-Mini And Level Shifter Board At Lower Left|
It made sense to connect the Dallas One-Wire DS18B20 thermometer to a Pi digital pin, instead of the Arduino. The DS18B20 requires about 750 ms to take a temperature reading and makes accurate distance measurements with the rangefinder (connected to the Arduino) impossible. The code would have to wait for a temperature, then echo/read the rangefinder, during each program loop. Reading an ambient temperature about once a second is fine using a Python script on the Pi.
Here's some sample Python code to read the DS18B20 digital thermometer, connected to the Raspberry Pi 3.
base_dir = '/sys/bus/w1/devices/'
device_folder = glob.glob(base_dir + '28*')
device_file = device_folder + '/w1_slave'
f = open(device_file, 'r')
lines = f.readlines()
lines = read_temp_raw()
while lines.strip()[-3:] != 'YES':
lines = read_temp_raw()
equals_pos = lines.find('t=')
if equals_pos != -1:
temp_string = lines[equals_pos+2:]
temp_c = float(temp_string) / 1000.0
temp_f = temp_c * 9.0 / 5.0 + 32.0
return temp_c, temp_f
Fabbed Brass Tubing Frame/Leather Backing
Some 3/16” thin-wall brass tubing, from a local hobby story, was used to build the frame. Lengths were cut with a standard plumber's copper pipe cutter, available at any home improvement store. Soldering the parts were a challenge. I used “3rd-arm” jigs, alligator clips, wire, tape, and, occasionally, hot glue to hold the parts in alignment while soldering. For thumbscrew attachments points I simply screwed the 1/4” long sections of tubing vertically to a piece of wood, placing them in the desired locations around the frame. Square frame sections were aligned with weights and binder clips, during soldering. Brackets for attaching the auxiliary Arduino, rangefinder, Raspberry Pi, and PiTFT display to the frame were made from 1/4” x 1/16” brass flat stock. Ten-gauge solid copper wire was bent and soldered to the top of the frame for lanyard attachment points.
|Brass Tubing Frame And Lanyard Hook Details|
An old tried-and-true Weller 100/140 watt soldering gun and 1/16” rosin-cored solder handled constructing the frame without any issues. Fine adjustments in tubing length and corner rounding of the flat-stock brackets is easy with a small abrasive drum, in a Dremel tool. You can also use a medium grit sanding sponge, to knock off sharp edges and smooth out solder joints.
I like the hand-crafted, antique Steampunk look of the brass frame and thumbscrews. You have to be able to take the leather backing off of the frame for modifications and the thumbscrews make that very easy.
Antique Name Plate
A Steampunk conference badge certainly needs a cool looking name plate. After considerable searching I found an appropriate Victorian font and printed the 'Dr Torq' characters on standard laser printer paper. Next, I carefully ripped the paper to the appropriate size and soaked it in a mild instant iced-tea solution for a