/* G3DP Kiln Controller This codes for the digital control adapter to Scutt Kilns glass melting kilns and controllers. Using two relays per kiln device (one solid state and one mechanical saftey relay) and one type K thermocouple per hot zone, the code allows for the instantanious user specification of temperature and responds by raising or lowering the kiln temeperature by activating or deactivationg the resistive heating elements through 2 n-mosfets connected to the commercial kiln unit's power supply. The custom board is also equipped with two LED circuits in parallel to the contoller mosfets identifying which relays are activated. When both relays are activated, the kiln elements are activated as well. A Type K thermocouple is wired through op amp on the side of the board opposite the LED circuits. It must be calibrated to read the temperature from between 0 and 5V (table found here http://www.omega.com/temperature/Z/pdf/z208-209.pdf). Finally, the RX and TX pins of the boards ATTiny can be used to communicate a desired action through the serial port. A second program written in Processing (java) is provided to interface with the board through an FTDI-USB connection once it has been programmed. */ #include const int rx = 0; const int tx = 1; SoftwareSerial mySerial(rx,tx); long temp1 = 0; long temp2 = 0; char cmd; // the setup function runs once when you press reset or power the board void setup() { mySerial.begin(9600); pinMode(8, OUTPUT); pinMode(7, OUTPUT); pinMode(3, INPUT); } // the loop function runs over and over again forever void loop() { cmd = mySerial.read(); if (cmd == 'k') { temp1 = 0; temp2 = 255; } else if (cmd == 'v'){ temp2 = 0; temp1 = 255; } analogWrite(8, temp1); // turn the LED on (HIGH is the voltage level) analogWrite(7, temp2); mySerial.println("temp is..."); mySerial.println(temp1); mySerial.println("going up"); }