Not sure if want…

This is the result of the third attempt to get the photoresistive film applied decently (very difficult) and gets some boards going. At quandrants 2,3, and 4, I have a test board for an RF switch I am using for my Senior Design project; in the first quandrant are 4 adapter boards for an accelerometer IC I got so I could play with it for an idea I had. Either way, these are going to be redone before I etch them.

Results are not great; none of the 7 boards turned out completely perfect. I think I’m just going to remove it, seek out some finer sandpaper, and… I don’t know. The really hard part is getting rid of the air bubbles in the application of the film (the effect of which can be see on the back, where I didn’t bother trying to stop them since I only needed to focus on one side for the boards). Any suggestions?


Front (useful) side of the board. Imperfections make the RF boards useless; the adapter boards could be salvaged, but I don’t wanna.


Back (silly) side of the board. Looks cool, but I can’t etch the boards like this, really. I could mask the whole side, but I’m going to redo it anyway.

Ultraviolet Exposure Light Box with PIC16F54 Timer


Top of the box with a ruler for scale.

I just finished designing and building a (12.5″)x(12.5″)x(6″) ultraviolet light box with a pic16f54 microcontroller programmed as a timer for the exposure. It was made mostly to be a UV light source for exposing photosensitive film used as an etch-resist in the process of making printed circuit boards. It can also be used as a weapon against vampires.


Close-up of the controller board (upside down! Muahahah!).

The red LED indicates power is connected to the microcontroller (controlled by the small switch in the corner or just by unplugging the wall-wart). Pressing the round black button adds 30 seconds two minutes to the timer, which is indicated in binary on with the 8 orange LEDs; it is limited to 255 seconds (4 minutes, 15 seconds) and suffers overrun if you press the button enough times 16 minutes and doesn’t loop back to zero. Power is applied to the ultraviolet LEDS whenever the timer is greater than zero, which can be indicated by (a) the yellow LED indicating the UV lights are on, (b) the green led blinking once per second as the timer counts down, or (c) the bottom of the box emitting a faint blue glow. The assembly code I spent an afternoon writing can be found at the bottom of this post, if you are curious (My first real ASM program! It was actually kinda fun!).


Inside of the light box; still not sure what the cat likes about this place, but he sure likes trying to get in there.

Measurements indicated that the ultraviolet LEDs are using 29.1[mA] each, so the box should be outputting a total luminous intensity of [latex]16 * (1.375 * 80[mcd]) = 1.76[cd][/latex] at wavelengths between 350[nm]-420[nm] (peak @~380[nm]). The MG Chemicals photoresist film that I use has an exposure sensitivity between 315[nm]-400[nm], with a peak response at 355[nm]-380[nm] (good design, huh? ;D).

The UV LED array has a square spacing of 2.5″, meaning the center of four adjacent LEDs is [latex]{2.5[in] * sqrt{2} over 2} = 1.7677[in][/latex] away from any given led. Using the Radiation Diagram from the datasheet, the minimum surface distance from the tip of the LEDs at which the light cone would be at 25% intensity at these centers is then [latex]{{tan (20,^{circ})} over 1.7677[in]} = 4.8569[in][/latex]. I interpret this as the minimum distance an object needs to be from the UV LEDs in order for the light to be relatively uniform across the whole surface. Beyond this distance, it should become even more uniform; fortunately, my two glass plates, a standard 1/16″ copper clad board, photoresist film, and artwork transparencies add up just under 3/8″, so all is well for my application. The largest copper clad board I ever plan to use is 8″x10″, so my 2.5″ spacing works to keep the UV light at a decent intensity on the edges. UPDATE: Unfortunately, this is not the case, as tests have shown that the board needs to be at least another 1/2 inch from the LEDs. This may have something to do with where you measure from, exactly, but there are visibly contrasting regions visible on a white sheet of paper. The solution I have in mind will be to simply extend the bottom of the box.


Just showing off the light emission.

; Timer for UV Light Box Control
; Initially off. Waits for input to set length of ON time, waits for lack of input, then starts. PORTB acts as indicator of number of 2xminutes to set timer.
; PIC16F54 @ 3.579545 MHz
; Drew Jaworski 2012
#include <p16f5x.inc>
	__CONFIG _HS_OSC & _WDT_OFF & _CP_OFF
	UDATA
; delay counter vars
dc1 res 1
dc2 res 1
dc3 res 1
ptm res 1 ; 120 second run timer

PROG CODE
init
	movlw b'11110010' ;RA0 is UV control output, RA1 is timer increment button input (active low), RA2 is clock indicator LED output, RA3 is UV on indicator
	tris PORTA

	movlw 0x00 ;RB7-RB0 are time display outputs
	tris PORTB

start
	movlw 0x00 ;set all outputs OFF initially
	movwf PORTA

	movlw 0x00 ;initial time to display
	movwf PORTB

	movlw 0x78 ; initial 2xminute run timer setting (120)
	movwf ptm

wait_start
	btfsc PORTA,b'001' ;check button status
	goto wait_start ;skip back if button was not pressed

wait_input
;delay 0.25 seconds
	movlw	0xC7
	movwf	dc1
	movlw	0xAF
	movwf	dc2
Delay_2
	decfsz	dc1, f
	goto	$+2
	decfsz	dc2, f
	goto	Delay_2
;end delay

	btfsc PORTA,b'001' ;check button status
	goto begin_run_timer;start if button was not pressed
	btfsc PORTB,b'000'
	goto $+3
	bsf PORTB,b'000'
	goto wait_input
	btfsc PORTB,b'001'
	goto $+3
	bsf PORTB,b'001'
	goto wait_input
	btfsc PORTB,b'010'
	goto $+3
	bsf PORTB,b'010'
	goto wait_input
	btfsc PORTB,b'011'
	goto $+3
	bsf PORTB,b'011'
	goto wait_input
	btfsc PORTB,b'100'
	goto $+3
	bsf PORTB,b'100'
	goto wait_input
	btfsc PORTB,b'101'
	goto $+3
	bsf PORTB,b'101'
	goto wait_input
	btfsc PORTB,b'110'
	goto $+3
	bsf PORTB,b'110'
	goto wait_input
	btfsc PORTB,b'111'
	goto wait_input
	bsf PORTB,b'111'
	goto wait_input

begin_run_timer
	bsf PORTA,b'000'
	bsf PORTA,b'011'

run_timer
;delay 0.5 seconds
	movlw	0xAF
	movwf	dc1
	movlw	0xFA
	movwf	dc2
	movlw	0x01
	movwf	dc3
Delay_0
	decfsz	dc1, f
	goto	$+2
	decfsz	dc2, f
	goto	$+2
	decfsz	dc3, f
	goto	Delay_0
	goto	$+1
	goto	$+1
	nop
;end delay

	bsf PORTA,b'010' ;set led

;delay 0.5 seconds
	movlw	0xAF
	movwf	dc1
	movlw	0xFA
	movwf	dc2
	movlw	0x01
	movwf	dc3
Delay_1
	decfsz	dc1, f
	goto	$+2
	decfsz	dc2, f
	goto	$+2
	decfsz	dc3, f
	goto	Delay_1
	goto	$+1
	goto	$+1
	nop
;end delay

	bcf PORTA,b'010' ;clear led

	decfsz ptm,f ; decrement run_timer
	goto run_timer ;continue next cycle if iwt decrement result was not zero
	movlw 0x78
	movwf ptm ;reset run timer if it hit zero
	;also remove a minute from timer
	btfss PORTB,b'111'
	goto $+3
	bcf PORTB,b'111'
	goto run_timer
	btfss PORTB,b'110'
	goto $+3
	bcf PORTB,b'110'
	goto run_timer
	btfss PORTB,b'101'
	goto $+3
	bcf PORTB,b'101'
	goto run_timer
	btfss PORTB,b'100'
	goto $+3
	bcf PORTB,b'100'
	goto run_timer
	btfss PORTB,b'011'
	goto $+3
	bcf PORTB,b'011'
	goto run_timer
	btfss PORTB,b'010'
	goto $+3
	bcf PORTB,b'010'
	goto run_timer
	btfss PORTB,b'001'
	goto $+3
	bcf PORTB,b'001'
	goto run_timer
	btfss PORTB,b'000'
	goto run_timer
	bcf PORTB,b'000'
	goto start ;reset everything if time has run out
	END

Xmas RGB LED PIC Toy Gift Project

I wanted to make something special for people I know to give as Xmas gifts this year, so I went into engineering mode and came up with something fairly simple, but still fun. Admittedly, this isn’t for everyone, but I don’t care; if they can’t at least pretend to appreciate my hard work and creativity, then they just won’t get the cooler stuff I’ll make next year! That didn’t happen with anyone, fortunately; they all at least seemed vaguely interested. My sister didn’t like the blinking, though, so she gave hers to my mom. Everything was purchased through Mouser.


Close-up of one of the devices (1.25″)x(2.125″).

Essentially, it is a small PCB with two CR2032 batteries (soldered in, because battery sockets seem to cost twice as much as the batteries themselves!), a 5[V] regulator, a pic16f616 microcontroller, an RGB LED, two phototransistors, and some passive components. The PIC is programmed in C (compiled with SDCC, and programmed via ICSP with PicProm), and designed to cycle the RGB colorspace at a cycle rate and PWM frequency which varies depending on input from the two phototransistors.It has many uses! Annoy strangers! Cause epileptic seizures! Run down the batteries and ask me to replace them! Put them in your storage/trash and hope I never ask about them again! It doesn’t matter!


Schematic (created with Eagle 5.11 Light).


PCB Layout (created with Eagle 5.11 Light).


One possible use. Music by The Black Dog. Note: The moving lines are just an artifact of the image sensor on my camera playing catch up with the PWM drive of the LEDs; the real devices do not cause scrolling lines to occur in real world use,

On the long, ranting personal experience and electronics construction details side, this was a very fun and time-crunched project to make. I came up with the idea of making something using a surface mount microcontroller and an onboard battery about one week before Xmas; I had the parts list ready (with a rough idea of how to combine it all) on Sunday and made the order with Mouser on Monday afternoon. Kim ended up paying for them, because I am broke until school starts again; she also helped me with some testing and conceptual feedback, so these were partly her gifts to my family as well. I am very fortunate that Mouser is located in Texas, because I not only get to pay taxes (wait, what?), but Ground shipping only takes two days! I took those two days and used them to make sure my programming equipment was up to date and could work; I was able to get some pic16f54 devices programmed, but it turns out the pic16f616 line is a newer breed that wouldn’t work with my programmer (the passive one on the PicProm website ended up working just fine on my breadboard). I used a 0.300″ SOIC->DIP adapter for the chips, which are 0.150″ wide, so it took some work to get them on there with wire extensions. From there, I just tried various things based on the datasheet and some examples of using SDCC available around the web. I was rushing, but I still didn’t have a finalized design until Thursday evening.


SOIC Breakout board used for prototyping during the design process.

That’s when the real fun began! I’ve been using the well-known laser toner transfer method for a while for making PCBs, as well as a Cupric Chloride etchant (HCl and Hydrogen Peroxide as main ingredients), but I need something better for surface mount work (especially since I will need to use what I learn for my Senior Design project soon; I have some (2mm)x(2mm) ICs just waiting around to be used! The photoresistive process has been backed as allowing much better resolution, little to no distortion, and easily reproducible results. Fortunately, Mouser sells a product by MG Chemicals which is a photosensitive film that can be applied to bare copper (which can be found cheap online at Parts Express, btw). I wasted a 12″x11″ piece of the film because the instructions are flawed, however; they claim it turns from “green to blue” when exposed to UV light, but, in fact, it is BLUE ALREADY! It changes to a darker blue when exposed, as I found out after further testing and concluding that just leaving it outside for 10 minutes or so (even on a thoroughly cloudy day) is enough UV exposure to do the job. None of my compact fluorescent bulbs did the job, probably because they have a UV filter on the inside of the glass tube.

I don’t actually care enough to tell MG Chemicals that their instructions for the 416DFR-5 product are faulty and that the film is never green at any point in the process. I hope someone else trying out this dry film product finds this page and discovers this fact before wasting a sheet or worrying that their new roll of film has already been exposed and tosses it out!

I made a big (7.5″)x(8.5″) board of 24 of the devices, and I had originally intended to use a silver solder paste and a toaster oven to reflow solder everything at once, but the boards ended up coming out inconsistent with a few being too blurry (I need to invest in some plates of thick glass) and a most having missing traces (I need to improve my technique for applying the film to the boards (done in the dark with red an yellow LED lighting, btw!). Thus, I ended up hand-soldering all of them, producing a total of 12 completed devices after staying awake for 24 hours straight, and we left for Houston an hour later. I finished the four I used for the above picture/video today, and the other 8 PCBs are far too messed up to salvage. +163XP and (2x) Level UP!

Semester is Over!

The Fall 2011 semester of school has come to a close, and I passed everything! Yay!

Senior Design I was fun, and the fun doesn’t have to stop! I plan to continue working on my project throughout the break, and I have attached my slides and final report to this post; fun stuff.
This is my Final Presentation Slides (MS Powerpoint format)
This is my Final written Report for the Senior Design Project (MS Word format)

My Digital VLSI Circuits course was fun, too. My final project was to design a 4-bit synchronous counter (at the actual bare silicon level). Supposedly, my prof will be having our circuits manufactured so we can test them, but they probably won’t be available until late next year (after I hope to have graduated).
This is my Report for the VLSI Project (MS Word format)

New Synth Cabinet

I decided to wait on posting about this new project until I had my first module installed and in working order; that day has finally come! 😀
What is this? It is a proper Analog Modular Synthesizer Cabinet/Rack. Basically, I built a (48″W)x(11″D)x(24″H) wood cabinet.


Back of cabinet after combining pieces and fitting the acrylic backplanes (covered with blue protective sheet).

The wood is a fairly cheap “whitewood” (most likely Canadian spruce, so far as I could tell from the processing stamps), which I sanded down, stained with “Special Walnut” Minwax stain, then sealed with Minwax Polycrylic Finish. There were some minor misalignment issues (I was trying my best to be as perfect with fitting and sizing as possible), but I managed to tweak the fittings and force some things to fit together better. I am quite pleased with the results, but not so much with my photography (I really need to remember to use my tripod for future documentation).


Back of cabinet with protective sheets removed.

The back of the rack is filled with two full-length, 1/8″-thick acrylic sheets, to which I have mounted the power supply essentials and will eventually use for some fan exhaust (after I have added a few more modules).


Front of cabinet with random pieces of front panel material added for increased realism.

The front of the cabinet is lined with four 1/16″ aluminum L-bracket rails which will eventually have 4 screw-tapped holes per module to hold them in place. The front panels of the modules consist of a 1/16″ 6061-T6 aluminum sheet and a 1/8″ glare-free acrylic sheet with a printed label sandwiched between them. Most people simply use the aluminum sheet with the label on top (sometimes it is at least laminated), but I figured my approach would probably last the longest. My goal is for this cabinet and attached modules to be something I can continue using 20-30 years from now, so I created a front panel labeling approach that avoids the common warping/scratching/peeling/fading problems of most of what I’ve seen of that age. I think I have done so, at minor added expense. 😀

Matrix Games

I built a fairly cool game/interactive device for my little brother as a birthday present, as alluded to in a previous post.


It consists of a DIY Arduino microcontroller, (8) 8×8 LED Matrixes (total of 32×16 LED matrix), (6) push-button switches, (2) 4->16 line encoders and a 16 channel multiplexer to scan the matrix, a custom-built acyrlic case (some scraps I had around), and a week of hard-paced C-style coding to bring it all together. The video says it all, really, but here’s some pictures as well. This is mostly a one-of-a-kind build, as I’ve never seen anyone else make one (online, much less in real life), but it is a fairly straightforward, off-the-shelf design, so I’m not exactly highly proud of my innovation or something silly like that. 😛

Please find enclosed, the Source Code.

How to Use Kobiconn 174-R819 Banana Plugs

After a bit of searching for the best deal I could find, I eventually settled on the 174-R819 Kobiconn Banana Plugs for my new Synthesizer. My previous Synthesizer used 1/4″ plugs/jacks because they are what I have been previously comfortable with and I had a certain affinity for the coaxial-natured noise reduction associated with the connectors. However, after a good bit of research, I came to the conclusion that I would much rather use banana plugs/jacks. The biggest selling points for me were the simplicity of cable construction, the stackability of the plugs (goodbye, “multiples” modules, which allow the use of one output to drive several inputs!), and the decreased panel area that the jacks take up.
Anywho, here is a short pictographical explanation of how to use them most effectively.