Processor

Status
Not open for further replies.

jrm850

Senior Member
ECF Veteran
Jun 18, 2011
159
21
Southeastern US
Hi folks. I've been playing around with uCs for a couple of years and just started vaping about a month ago. Who knew my hobbies would merge... Anyway, I'm happy to find this conversation.

Has anyone ever tried a different heating element material with a positive (or negative) temperature coefficient of resistance like tungsten? It would seem like the perfect partner for the PID loop mentioned above. One could maintain absolute consistent temps regardless of changing voltages or thermal loads. The PID coding would be simplified to duty cycle /resistance target.

Edit: I realize all conductors change reisistance with temp, but Nichrome is one of the most stable. Tungsten has roughly 26 times as much change in resistance per degree C as nichrome.
 
Last edited:

kwcharlie

Ultra Member
ECF Veteran
Apr 24, 2009
1,213
605
78
Houston
acrigs.com
ALL the code i know about is open loop as far as i can see, even Raidy's source code [i translated from his German posting] was open loop as far as i could see: 7S LCD driver, stepping pot, ohms and watts hold, not trivial code but nothing new. a nice PIC has so much potential, if it's fast enough to do the PWM then it's fast enough to do a LOT more. Just keep it in mind as you get that "not trivial" stuff done then we'll work on making it do different modes for E2's atty's cartos and DC's.
First YOU start the ball by answering:
  • What are you coding in and what compiler are you using?
  • What is your target MP?
Oh ya: don't even think KISS, we're going into Flux Capacitor land.:laugh: here

PS You don't go to work in an airplane with a long red stripe from LVS do you?:facepalm:
 

jrm850

Senior Member
ECF Veteran
Jun 18, 2011
159
21
Southeastern US
sounds complicated. I was planning on just PWM at whatever battery voltage is set to, but checking the resistance of the atty between pulses (well every 100 pulses or whatever) to regulate the width of the PWM pulses. That should let me maintain a constant temperature regardless of battery voltage or actual amps being pushed. Just two 3.7 batteries in series, and it'll provide enough voltage to keep things hot regardless :)

I'm not sure how I missed this the first time through but I like it. How are you going about getting any resolution out of the tiny resistance changes?
 

jrm850

Senior Member
ECF Veteran
Jun 18, 2011
159
21
Southeastern US
ALL the code i know about is open loop as far as i can see, even Raidy's source code [i translated from his German posting] was open loop as far as i could see: 7S LCD driver, stepping pot, ohms and watts hold, not trivial code but nothing new. a nice PIC has so much potential, if it's fast enough to do the PWM then it's fast enough to do a LOT more. Just keep it in mind as you get that "not trivial" stuff done then we'll work on making it do different modes for E2's atty's cartos and DC's.

First YOU start the ball by answering:
  • What are you coding in and what compiler are you using?
  • What is your target MP?
Oh ya: don't even think KISS, we're going into Flux Capacitor land.:laugh: here

PS You don't go to work in an airplane with a long red stripe from LVS do you?:facepalm:

Not sure of this is directed at me or not but I'll anwer anyway.

I really wish I worked at 51.
I use AVRs and won't be much help on a PIC project.
I use Bascom a lot because it is simple and a lot easier to reverse engineer the code if sit a project down for a couple of weeks.

I also speak a lot without thinking :) The tungsten filliment would have to practically invisible or 18" long to achieve the required resistance. oops.
 

Sweeper

Full Member
Verified Member
May 4, 2011
32
1
41
Clarkston, WA
I'm not sure how I missed this the first time through but I like it. How are you going about getting any resolution out of the tiny resistance changes?

haven't really gotten that far (sigh can't find my usb arduino, and don't have a ttl cable), but if it comes down to it, I can use a voltage divider + amplifier. adc on the attiny is 10 bits, so I might not even need to do that, just switch the pwm off, switch on vcc through the atty, and compare voltage off the atty to vcc
 

air1

Senior Member
ECF Veteran
Mar 4, 2011
105
9
Louisville, KY
Sorry I missed the first post, I've been busy with my setup.

Yes, I actually have a PIC, and AVR next to me now(ATMega16). My setup was going to use an attiny25, but I need more pins for the lcd and capacative touch.

I'm a professional programmer, but have only been programming micro's for a few years. I probably have 100 hrs of time alone looking at datasheets for the components that I need.

For those in the AVR world, have you gotten the dragon to work in Studio 5?
 

air1

Senior Member
ECF Veteran
Mar 4, 2011
105
9
Louisville, KY
I haven't tried the Dragon yet, but I sure like it's price compared to their other models. What kind of problems are you having?

I'm using the pololu Orangutan USB Programmer, and it won't work with AVRISP in sutdio 5. The CP2102 USB-to-Serial Bridge Driver was a PITA on Windows 7, but I got that to work. So I think that I'm just going to get the Dragon, because it is supposed to work, and it is supposed to be forward compatible and always work with flashing, it is the defacto standard, and really cheap compared to others. So I haven't tried it yet, but will probably order it and a bunch of other stuff tonight.

Oh I love Studio 5. What a major improvement.
 

CraigHB

Ultra Member
ECF Veteran
Jul 31, 2010
1,249
314
Reno, Nevada
I looked at that AVR Dragon, good price, similar in cost to the PICKit3. Though I haven't done much with the AVR stuff so I don't know how the IDE products comprare (Amtel's Studio 5 versus Microchip's MPLab). I like MPLab a lot though, very easy to install and use. Works seamlessly with the inexpensive PIC programmers and debuggers.
 
Last edited:

air1

Senior Member
ECF Veteran
Mar 4, 2011
105
9
Louisville, KY
I honestly like both chips and IDE's, both have their strong points. Although I love the new Studio 5 as it is actually Visual Studio 2010. I understand the PIC better, but am learning that there are a few things with the AVR that is just the cats meow. The PICKit3 is very sweet. The Dragon also requires ZIF socket, pinned headers, cables (even the USB cable), so the dragon cost does go up quite a bit.
 

CraigHB

Ultra Member
ECF Veteran
Jul 31, 2010
1,249
314
Reno, Nevada
The PICkit3 also does not come with any cables or accessories. I always use in-circuit programming and debugging so all I usually need is an ICSP or JTAG cable. They're cheap and I've made them before, nothing special, just .1" pin headers and sockets. USB cables are a non-consideration, dime a dozen. I think the cost of development tools should be comparable between the AVR and PIC.
 

memnoch

Full Member
Verified Member
Jun 23, 2011
30
5
Ohio
Has anyone used a processor yet in one of thier mods ? I mean those small programable ones ARM I think is the name of one of them or they maybe called programmable ic chips or the basic stamp.

Heh, the thought's crossed my mind, but seriously, a solid state circuit is a much better idea. You wouldn't get any (noticeable) latency, the circuit would be less sensitive to the heat from the atty, a circuit would be easier in general, it would also be far less expensive.

Don't get me wrong, the geek in me giggles and lights up at the idea, but realistically, it wouldn't be more than a neat 'lil hack, just to see if you could / say you did it. BTW, Micro controller is what they've been going by these days, they don't (typically) need a special piece of hardware for writing (e.g. PIC writers). A good amount of them read either a scripting language (which is usually just a variant / ripoff of something more popular like PERL, Python, C, shell scripting, etc...), C, BASIC, or something else, so you don't have to write in it's foreign Assembly, and you can often find decent pre-built API so you don't have to make annoying hex references.

If you do end up making one, do share though, the code as well!
 

CraigHB

Ultra Member
ECF Veteran
Jul 31, 2010
1,249
314
Reno, Nevada
Just about all of the MCUs (µcontrollers) require some kind of specialized programmer/debugger. That's a small electronic device to interface the MCU with a personal computer via USB. It's possible to use a simple and inexpensive serial or parallel interface for "programming only" with some of them. Though, if you are serious about building circuits with MCUs, you really will want some kind of hardware debugger. It's pretty hard to get by on simulation alone. Hardware debugging requires a device like the AVR Dragon for the Atmel chips or a PICkit for Microchip's parts. SparkFun electronics sells some 3rd party programmer/debuggers, but the ones they sell aren't all that much cheaper than the inexpensive ones that come from the chip makers.

I'm not that familiar with Arduino which is a whole development platform for MCU based circuits. It's oriented toward learning and much easier to use. I believe it's also less expensive for one-off projects since the devices are designed to interface natively with a PC. I've not yet read of anyone actually using Arduino for production stuff, but it sounds like a great way to get into it from an entry level.
 

clutchjunkie

Senior Member
ECF Veteran
Jan 29, 2011
144
19
48
SoCal
RESULTS! :D I have been vaping off of my breadboard for about an hour now, spent all morning programming my new Arduino Nano (this is the first non-CAM programming I have done since high school) and now I have something to show for it.

IMG_20110806_140453.jpg


here is my program:

/* First version of my Arduino Personal Vaporizer controller.
Does basically what the PWM 555 circuit on EcigF does, but with a
digital potentiometer style control built in. It has ten power steps,
and lights a dual mode LED to indicate which button is being pressed.
Also has a simple debounce timer on the up and down buttons.
*/


// pin number constants :
const int CbuttonU = 2; // the number of the up pushbutton
const int CbuttonD = 3; // the number of the down pushbutton
const int CbuttonH = 4; // the number of the hit pushbutton
const int CledU = 11; // the number of the up LED
const int CledD = 12; // the number of the down LED
const int Cfire = 13; // the number of the PWM output

// variables :
int VpowerLevel = 1; // holds the current user adj. power setting


// setup, initialize pins

void setup() {

// input pins
pinMode(CbuttonU, INPUT);
pinMode(CbuttonD, INPUT);
pinMode(CbuttonH, INPUT);

// output pins
pinMode(CledU, OUTPUT);
pinMode(CledD, OUTPUT);
pinMode(Cfire, OUTPUT);
digitalWrite(CledU, HIGH);
digitalWrite(CledD, HIGH);
}

void loop()
{

//If the hit button is pressed, basic PWM bitbang
if (digitalRead(CbuttonH)== HIGH)
{
digitalWrite(Cfire, HIGH);
delayMicroseconds((VpowerLevel * 250)+400); //ON pulse

digitalWrite(Cfire, LOW);
delayMicroseconds(1500); //OFF pulse
}

//If the up button is pressed, increase on time
if (digitalRead(CbuttonU) == HIGH)
{
if (VpowerLevel <10)
{
digitalWrite(CledU, LOW);
delay(100);
VpowerLevel = VpowerLevel + 1;
while(digitalRead(CbuttonU) == HIGH)
{
delay(1);
}
}
digitalWrite(CledU, HIGH);
}

//If the down button is pressed, decrease on time
if (digitalRead(CbuttonD) == HIGH)
{
if (VpowerLevel >1)
{
digitalWrite(CledD, LOW);
delay(100);
VpowerLevel = VpowerLevel - 1;
while(digitalRead(CbuttonD) == HIGH)
{
delay(1);
}
}
digitalWrite(CledD, HIGH);
}


}

It is pretty simple. There is an up button, a down button, a fire button, and some led's, as well as the same IRLB8748 N-channel FET that I am using in my 555 pwm mods.

The program "bitbangs" pin 13 of the arduino, which is the gate of the mosfet. This gives me access to higher kHz levels than the actual built-in pwm of the arduino, it needs to be above the human hearing range or you will hear a buzz or even a shrill whine coming from your atomizer. There are ten steps of adjustability using the up-down buttons.

My next step is to add a voltage sensing variable to everything to compensate for the battery as it drains, so you always get the same heat no matter how charged your battery is. I also want to play with sensing the atty ohms and calculating that into everything as well. Once I am happy with the program, i plan on porting it to the MSP430 launchpad so I can build a vaporizer with a $2 chip in it instead of a $25 arduino unit.

Here's the setup to build this yourself, btw:

3 tactile N/O pushbuttons
3 22k ohm resistors
1 N-channel mosfet (needs to have a 2-4v gate, higher than that and it might not trigger)
3 LED's
1 atty connector
1 2s 7.4v battery
an Arduino (duh)

Connect the battery ground to the common ground. You should be able to power the whole thing off of this battery, but you can actually power the arduino off of the usb while powering the mosfet/atty off the battery while testing.

Connect pin12 to the - of one led. Connect the + of this led to +5v pin.
Connect pin11 to the - of a different led. Connect the + of this led to +5v pin.
Connect pin13 to the + of the third led (optional) and the gate of the FET. Connect the - of the led to ground.
Connect pin 2 to one of the switches and to a 22k resistor going to ground.
Connect pin 3 to one of the switches and to a 22k resistor going to ground.
Connect pin 4 to one of the switches and to a 22k resistor going to ground.
Connect the other leg of all three switches to +5 pin.
Connect the source leg of the FET to ground.
Connect the drain leg of the FET to the atty -.
Connect the atty + to the BATTERY +. DO NOT connect this to the +5v pin.

There you have it. Now back to the grind.
 
Last edited:
Status
Not open for further replies.

Users who are viewing this thread