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

    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).


    Terpenoid, 215z, Buildozer and 9 others like this.
  2. Hippie Dickie

    Hippie Dickie The Herbal Cube Manufacturer

    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

    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

    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.

    215z likes this.
  6. meduser#420

    meduser#420 Touch it, Feel it.

    hmmm... Gotcha!
  7. CentiZen

    CentiZen Evil Genius in Training Accessory Maker

    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


    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 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

    //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);
    lcd.begin(16, 2);
    //initialize the variables we're linked to
    Input = tempC;
    Setpoint = 180; // oC
    //turn the PID on
    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
    Input = tempC; // update tempC
    double gap = abs(Setpoint-Input); //distance away from setpoint
    { //we're close to setpoint, use conservative tuning parameters
    myPID.SetTunings(consKp, consKi, consKd);
    //digitalWrite(led, LOW);

    //we're far from setpoint, use aggressive tuning parameters
    myPID.SetTunings(aggKp, aggKi, aggKd);

    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;

    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.print("Set Point|");
    lcd.print(set_point); // set poit
    //Bottom Line
    lcd.setCursor(0, 1);
    lcd.print(temp_cursor); // cursor
    lcd.print((1 -dimming/127)*100);

    Last edited: Jun 16, 2014
  9. smokeliss

    smokeliss New Member

    So Ives been tinkering away and have come across some issues that I carnt really get over.

    Temperature sensors and their placement; Looking for a little advice here and feed back.

    My original idea was to use a thermocouple placed directly before the material chamber as to provide the more accurate feed back for the controller. Here are my thoughts layed down.

    Response Time:

    Assumption: The halogen heating element is powerful enough that it can provide rapid response to a change in air flow conditions.

    That is to say, as air is drawn over the glass surface, the heat is exchanged, the glass cools down, as the sensor reacts the system will try to achieve the set point. The responce time will be how long it takes for it to react from the initial inrush and bring the air temperature back to the setpoint.

    I am arbitrarily setting a response time for 250ms. So it takes 1/4s for the air stream to dip then recover to its set point.

    [Im trying to avoid the use of a hight heat mass (longer heat up time - aiming for no heat up time), though having one large enough to cope with the initial inrush from a pull might be necessary - more data is needed!]


    • The heat mass of the heat exchanger is not large enough to maintain the setpoint through the entire draw.
    • The heat mass of the sensor will be a major contributor to the response time
    • The sensor will be placed in-stream to ensure accurate air temperatures

    The sensor that has currently winning out in a platinum RTD, these little guys are highly accurate (+/- 0.5C), cheap and have a large support of dedicated sensing chips with spi interface making temperature reading fast, easy and accurate. (Currently playing around with a max31865, having a bit of trouble with the QFN packaging)

    They are also glass coated and plan on using the bear sensor in the air stream to avoid hefty response time penalties of SS sheaths.


    This is where I'm getting tied up in knots.

    Before or after the material chamber.

    I am leaning very heavily towards placement AFTER the material, in my eyes, trying to get achieve accurate material temperature by placing the sensor BEFORE the material is always going to be a prediction. It can be assumed that after a certain time, the chamber and material will equalise and then will be at the same temperature as the income air, but to me, this is unreliable and there are so many factors that will contribute to fluctuating temperatures of the material, moisture content and ambient temp to name a couple.

    This is all solved by placing a sensor after the chamber (ideally have two sensors to ensure the incoming air is not to hot as to burn the material)


  10. Hippie Dickie

    Hippie Dickie The Herbal Cube Manufacturer

    where the Cube rules!
    here are my thoughts based on my designs over about 14 years ...

    i put the sensor (a k-type thermocouple) at the hottest part of the heater coil (nichrome 80, 16 awg) - this is the middle loop. i find the temperature in the bud does reach equilibrium quickly - within the first 5 seconds of the toke. so my sensor is outside the airflow and away from the herb.

    the condition of the herb does affect temperature stability in that the temp will drift up about 5 to 10 deg F after 5 minutes into the session. i am assuming heat of vaporization and heat saturating the interior of my cube are sucking calories during the initial part of the session. once that is done, the temperature rises to what is actually the setpoint.

    i really don't see any effect from ambient temp, which for me varies from 50 deg F in winter up to 90 deg F in summer - makes no diff the cube always performs the same.

    you need power reserve to compensate for temp drop with air flow, but 70 watts (6v @ 12a) is more than enough. my code reads the k-type 3 times per second (using the MAX6675 with SOIC-8 package) and I am getting stable temps throughout the toke. i use a separate digital BBQ thermometer to display the temp of the outside of the glass air path, right next to the k-type. provides more of an average temp readout vs the instantaneous nature of reading the k-type. or so it seems to me.
    smokeliss likes this.

Support FC, visit our trusted friends and sponsors