1. What does SSTB mean? See our glossary of acronyms.

Halogen Vaporiser

Discussion in 'DIY' started by smokeliss, Jun 13, 2014.

  1. smokeliss

    smokeliss New Member

    Messages:
    4
    Location:
    Australia
    Hi everyone,

    New here, but thought you would all like to have a look at what I’m starting to put together.

    This is the current test bed.

    Left to right:

    Test stand, currently using a single 100W 240v halogen bulb. Planning on upping it to 3x 150W halogen tubes. Thermocoulpe is sitting next to the bulb here.

    Middle: Heater driver, TRIAC controlled, took heat sink off temporary, may be needed if upping it to 450W

    Right: Controller board, running a teensy 3.0, rotary encoder for input and a 12x2 LCD. The temperature is read by a K thermocouple and picked up by a max31855. This chip is designed for K types and is digitally read by the microcontroller.


    My goal for this is to be a quality unit. Durable, fast heat up, large capacity, be able to leave it on safely and not look like drug paraphernalia.

    Now that the basic controller is sorted, the next step will be to prototype the holding chamber and house the high voltage circuit (and fuse it). Currently working on a better interface, it will not have a LCD or LED segment read out, but analog display while still retaining high precision (+/- 2.5deg of the 31855).


    Jason

    [​IMG]
    Buildozer, thesoloman, grokit and 7 others like this.
  2. Hippie Dickie

    Hippie Dickie The Herbal Cube Manufacturer

    Messages:
    1,962
    Location:
    where the Cube rules!
    @smokeliss - looks nice. that max31855 is the replacement for the MAX6675 that i use in my design, which is no longer in production (although still available from some distributors).

    But, do you really need that much power? is this for concentrates or leaf?
  3. smokeliss

    smokeliss New Member

    Messages:
    4
    Location:
    Australia
    Probably not, it is for leaf, and want it to have a large capacity, so the heat mass my be a little high and just over compensating, most likely the power will be reduced once I get the chamber a little further along.
  4. meduser#420

    meduser#420 Touch it, Feel it.

    how are you planning on isolating the air input/output?
  5. smokeliss

    smokeliss New Member

    Messages:
    4
    Location:
    Australia
    The loading chamber will pass through the heating compartment, drawing in fresh air. The test bed was only to play around with PID control and basic chamber ideas.

    [​IMG]
    215z likes this.
  6. meduser#420

    meduser#420 Touch it, Feel it.

    hmmm... Gotcha!
  7. CentiZen

    CentiZen Evil Genius in Training Accessory Maker

    Messages:
    1,714
    Location:
    America's Hat
    Would love to see your arduino code smokeliss! Great job on this so far, I'm very impressed.
    smokeliss likes this.
  8. smokeliss

    smokeliss New Member

    Messages:
    4
    Location:
    Australia

    Still really buggy, but it is good enough to run some tests on while I get everything else sorted. Chopped and changed a bit of other peoples code. Not happy with the PID library, so starting to create my own.

    Getting supplies to etch some pcb, going to attempt double sided.



    #include "Adafruit_MAX31855.h"
    #include <LiquidCrystal.h>
    #include <Encoder.h>
    #include <PID_v1.h>

    LiquidCrystal lcd(23,21,16,15,14,19);
    int thermoDO = 10;
    int thermoCS = 11;
    int thermoCLK = 12;
    const int led = LED_BUILTIN; // Internal LEDint temp_cursor = 150; // Deg C

    //encoder
    Encoder knob(18, 20); // Encoder
    int psh_btn = 17; // Encoder Button
    long pos_enc = -999;
    long encoder_save = pos_enc;





    int set_point = 150;
    int temp_cursor = 150; // Deg C
    //PID

    //Define Variables we'll be connecting to
    double Setpoint, Input, Output;
    //Define the aggressive and conservative Tuning Parameters
    double aggKp=10, aggKi=10, aggKd=2;
    double consKp=5, consKi=10, consKd=1; // 10 20
    //Specify the links and initial tuning parameters
    PID myPID(&Input, &Output, &Setpoint, consKp, consKi, consKd, REVERSE);
    float tempC;



    // Dimmer
    int AC_LOAD = 2; // Output to Opto Triac pin
    double dimming = 127; // Dimming level (0-128) 0 = ON, 128 = OFF

    Adafruit_MAX31855 thermocouple(thermoCLK, thermoCS, thermoDO);

    void setup()
    {
    pinMode(AC_LOAD, OUTPUT); // Set the AC Load as output
    pinMode(1, INPUT); // Zero Crossing Input
    pinMode(psh_btn, INPUT_PULLUP); //Encoder Button
    pinMode(led, OUTPUT); //Led
    attachInterrupt(1, zero_crosss_int, RISING);
    Serial.begin(9600);
    lcd.begin(16, 2);
    //PID
    //initialize the variables we're linked to
    Input = tempC;
    Setpoint = 180; // oC
    //turn the PID on
    myPID.SetMode(AUTOMATIC);
    myPID.SetOutputLimits(11,127);
    }
    void zero_crosss_int() // function to be fired at the zero crossing to dim the light
    {
    // Firing angle calculation :: 50Hz-> 10ms (1/2 Cycle)
    // (10000us - 10us) / 128 = 75 (Approx)
    double dimtime = (75*dimming);
    delayMicroseconds(dimtime); // Off cycle
    digitalWrite(AC_LOAD, HIGH); // triac firing
    delayMicroseconds(10); // triac On propogation delay
    digitalWrite(AC_LOAD, LOW); // triac Off
    }


    void loop()
    {

    float tempC = thermocouple.readCelsius(); //PID temp
    //PID
    Input = tempC; // update tempC
    double gap = abs(Setpoint-Input); //distance away from setpoint
    if(gap<5)
    { //we're close to setpoint, use conservative tuning parameters
    myPID.SetTunings(consKp, consKi, consKd);
    //digitalWrite(led, LOW);


    }
    else
    {
    //we're far from setpoint, use aggressive tuning parameters
    myPID.SetTunings(aggKp, aggKi, aggKd);
    //digitalWrite(led,HIGH);
    }

    myPID.Compute();
    dimming= Output;
    long new_pos;
    new_pos = knob.read();
    if (new_pos != pos_enc) {

    pos_enc = new_pos;
    temp_cursor = pos_enc;
    if (temp_cursor < 100) {
    temp_cursor = 100; // min setp point
    knob.write(100); // stops the encoder from 'going over' 100/250
    }
    else if (temp_cursor > 350) {
    temp_cursor = 350;
    knob.write(350);
    }

    }
    encoder_save = pos_enc; // save positon
    while (digitalRead(psh_btn) == LOW){ //push button pressed
    // need to fix how the encoder bugs when tured and pushed
    set_point = temp_cursor;
    }
    Setpoint = set_point; // update setpoint


    // Top Line
    lcd.setCursor(0,0);
    lcd.print("Set Point|");
    lcd.setCursor(13,0);
    lcd.setCursor(10,0);
    lcd.print(set_point); // set poit
    //Bottom Line
    lcd.setCursor(0, 1);
    lcd.print(temp_cursor); // cursor
    lcd.setCursor(4,1);
    lcd.print(tempC);
    lcd.setCursor(9,1);
    lcd.print("|");
    lcd.setCursor(10,1);
    lcd.print((1 -dimming/127)*100);



    }
    Last edited: Jun 16, 2014

Support FC, visit our trusted friends and sponsors