Hi all, I finally got round to making myself a new exposure unit (led based) for making small boards - and just thought I would share the controller unit with everyone. The UV lamp, as I call it, is just a piece of vero board - with 128 UV leds, wired in sets of 3 with associated resistors, so I wont go into that part.
The control panel is very basic, using an ATTINY85 programmed in the arduino ide (using coding badly's ATTINY core), I have included the schematic, and the source for you to peruse, use and abuse if you want. I could of used an attimy45 (and saved 4p) but I have a batch of 85 sitting & no 45s sitting unused.
The controller has been made on a custom manufactured board I designed and had made but can be home etched or built on vero-board if required ( I got a couple of spare boards for sale if you want one - PM me) - powered from an old laptop PSU (I haven't shown the power supply for +12v & +5V). The power is hooked up to +5v (pin3) +12v to led lamp, and led lamp ground to (pin1), and finaly psu ground to (pin2).
The source code is self evident - I have moved some #define statements from my normal 'skeleton' library that includes a collection of commonly used #defines.
So here is the code :
/*
UV Exposure Controller
Hook up buttons to D2 - D5 To Ground
D0 : to UV Exposure Lamp (Through Transistor).
D4 : One Minute Exposure Time
D3 : Two Minute Exposure Time
D2 : Five Minute Exposure Time
D1 : Turn ON/OFF Exposure Lamp
*/
/*
The following lines are my 'Standard' included header - #defines common used settings
*/
#define PRESSED LOW //GIVE PRESSED BUTTONS A 'LOGICAL' NAME
#define UNPRESSED HIGH //GIVE UNPRESSED BUTTONS A 'LOGICAL' NAME
#define ON HIGH //LOGICAL NAME AGAIN
#define OFF LOW //AND AGAIN
#define UVLAMP 0 //UV SWITCH (VIA TRANSISTOR)
#define ONEMIN 4 //GIVES APPROX 60 SECOND (1 MINUTE) COUNT DOWN (APPX AS WE USE INTERNAL OSC.)
#define TWOMIN 3 //GIVES APPROX 120 SECOND (2 MINUTES) COUNT DOWN
#define THREEMIN 2 //GIVES APPROX 300 SECOND (5 MINUTES) COUNT DOWN
#define OVERRIDE 1 //TURN EXPOSURE UNIT ON/OFF
void setup()
{
pinMode(ONEMIN,INPUT);
digitalWrite(ONEMIN,ON); // Turn On Internal pull-up Resistor
pinMode(TWOMIN,INPUT);
digitalWrite(TWOMIN,ON); // Turn On Internal pull-up Resistor
pinMode(THREEMIN,INPUT);
digitalWrite(THREEMIN,ON); // Turn On Internal pull-up Resistor
pinMode(OVERRIDE,INPUT);
digitalWrite(OVERRIDE,ON); // Turn On Internal pull-up Resistor
pinMode(UVLAMP,OUTPUT);
digitalWrite(UVLAMP,OFF);
startup();
} //End void setup()
void loop()
{
digitalWrite(UVLAMP,OFF);
if (digitalRead(ONEMIN)==PRESSED)
{
expose(60);
}
if (digitalRead(TWOMIN)==PRESSED)
{
expose(120);
}
if (digitalRead(THREEMIN)==PRESSED)
{
expose(300);
}
if (digitalRead(OVERRIDE)==PRESSED)
{
delay(1500);
exposeover();
}
} //End void loop()
void startup()
{
for(int cycles = 0; cycles < 5; cycles +=1)
{
digitalWrite(UVLAMP,ON);
delay(250);
digitalWrite(UVLAMP,OFF);
delay(250);
}
} //End void startup()
int expose(int count)
{
digitalWrite(UVLAMP,ON);
for (int timer = count; timer > 0; timer -=1)
{
if (digitalRead(OVERRIDE)==PRESSED)
{
digitalWrite(UVLAMP,OFF);
delay(2000);
break;
}
delay(1000);
}
} //End int expose()
void exposeover()
{
digitalWrite(UVLAMP,ON);
while(digitalRead(OVERRIDE)==UNPRESSED)
{
}
digitalWrite(UVLAMP,OFF);
delay(1000);
} //End exposeover()
and See the schematic below.
The Resistors are both 10k & I used a 2n2222 Transistor instead of a BC489.
Feedback welcome.