gfxgfx
 
Please login or register.

Login with username, password and session length
logo
 
gfx gfx
gfx
19852 Posts in 1275 Topics by 5182 Members - Latest Member: charbuild March 28, 2024, 04:32:56 AM
*
gfx* Home | Help | Search | Login | Register | gfx
gfx
Breaktru Forum  |  eCigarette Forum  |  Modding  |  Topic: You asked mamu it's coming.
gfx
gfxgfx
 

Author Topic: You asked mamu it's coming.  (Read 151196 times)

0 Members and 4 Guests are viewing this topic.

Offline Claviger

  • Sr. Member
  • ****
  • Joined: May 2014
  • Location: Hawaii
  • Posts: 94
  • Karma: +4/-1
  • Gender: Male
You asked mamu it's coming.
« on: June 12, 2014, 05:33:00 AM »
Well you asked for a drop in OLED setup. This is the preliminary stages of a drop in single board solution all on one PCB, that will come with time. For now see below for a fairly easy alternative solution.

I have most of the hardware in the mail, the rest will be ordered tomorrow but here is what I have come up with so far. I will source cheaper components at a latter date, first I need to proof this one, but all indications are that it will work without issue. I will post up the circuit diagram for it all tomorrow as well so it matches the code. More will come later, first I need to learn more code and figure out how to trim it down, because just these functions and displaying on an OLED have eaten basically all the RAM available lol.

Current draw for the OLED is ~ 20MA typical, probably more like 10-15ma using this code. The arduino will probably pull around 15ma while active, so roughly an additional 25-30ma draw (max) added to box mod while firing. I am estimating on the high side here.
Sleep function of Arduino engages at 5 second idle timer and wakes up at first fire button press in <1 second. While asleep draw for arduino/OLED should be in the 200uA area, and with tweaks I can get it down in the .2ua range in time!!

Button can be any button, no rating required for current/voltage so tactile buttons will work without issue.

Thus far it is capable of displaying:
Battery voltage real-time so it will show droop under load.
Battery % remaining (needs to be calibrated to each battery by customizing the code to match your discharge curve, but as is it should be fairly accurate).
Voltage being output to the atomizer while firing, real-time it should show 0.00 while not firing.
Resistance of your atomizer.
Amperage draw while firing. It will retain last used value, so wont check again until the atomizer is fired.
Wattage output while firing.  It will retain last used value, so wont check again until the atomizer is fired.

Components:
http://www.adafruit.com/product/326 38mm x 29mm
https://www.sparkfun.com/products/12640 which is 33mm x 18mm
One NFET and one PFET, they only need to handle 50ma at 5v and be triggered by up to 5v.
220ohm resistor and LED for fire indicator
10k ohm resistor
2 x 4700 ohm resistors
6.4v zener diode for UVLO (5watt part probably required here) unnecessary, UVLO done via software.
1amp PTC reset able fuse for arduino protectionunnecessary, already on board.
Standard box mod components
DC-DC regulator of your choice and associated circuitry (less a few components no longer needed thanks to Arduino)

The code must be loaded on the Arduino via USB. Simply cut everything in the post below and load it onto the board. From there the USB connector could be de-soldered to save on its thickness and keep the package as small as possible.  Package wise, it will be pretty easy to fit in standard size boxes, not much here adds significant space requirements as the wiring can be very thin and flexible since the loads are tiny. Thinking a Hammond 1590B should be able to fit it without much issue. 

Edit: See pots #15 for pics of built prototype. Edited components, some were extra.
« Last Edit: June 20, 2014, 03:42:25 PM by Claviger »

Offline Claviger

  • Sr. Member
  • ****
  • Joined: May 2014
  • Location: Hawaii
  • Posts: 94
  • Karma: +4/-1
  • Gender: Male
Re: You asked mamu, I'm delivering
« Reply #1 on: June 12, 2014, 05:34:00 AM »
Version 1d 1 July:

The link below will get you:
Working wattage, atomizer voltage, battery voltage, battery percent, ohms displayed(manual entry required for now), UVLO warning and cutoff to prevent DC-DC converter from firing, multi-button function via press number or hold, IDLE mode while screen is off saving battery power, stealth mode, and self resetting fire timer limit for safety (~15 seconds), puff timer added , total time vaping timer added, invert display option added for bright sunlight.
Screen times out and returns when fire button pressed.
Written for an SSD1306 OLED (adafruit 128x64)
https://drive.google.com/file/d/0ByAqGQEtnUs_ek9NaXROMFMyc28/edit?usp=sharing

1 button press = screen on, not firing Redundant removed
1 button press = screen off
1 button press and hold = screen on fire will IDLE automatically after release and 7 seconds of display
3 button presses = toggle stealth mode
4 button presses = invert display to white back and black text, 4 more presses goes back to black back white text
5 button presses = sleep


Updates to follow ;cheers;
« Last Edit: July 01, 2014, 07:42:52 PM by Claviger »

Offline Claviger

  • Sr. Member
  • ****
  • Joined: May 2014
  • Location: Hawaii
  • Posts: 94
  • Karma: +4/-1
  • Gender: Male
Re: You asked mamu it's coming.
« Reply #2 on: June 12, 2014, 05:40:26 AM »


WARNING: Minimum parts requirement in this diagram. Only testing will validate it, something I cannot yet do, so take this with a grain of salt for the moment. The OKL trim values in the schematic push the OKL out of specification, if you want to stay withing spec use a 1500 ohm resistor and 1300 ohm pot instead.

Under volt protection added via the zener diode. If power is under 6.4 volts, the Arduino cannot be powered, thus everything will turn off. As a result, when voltage hits 6.4 volts you will get a hard cut and it should not float in the oscillation zone (I hope). Remove diode from circuit, extraneous hardware.
« Last Edit: June 20, 2014, 03:43:11 PM by Claviger »

Online Breaktru

  • Administrator
  • PV Master
  • *****
  • Joined: Nov 2008
  • Location: NY
  • Posts: 3344
  • Karma: +792/-4
  • Gender: Male
  • PLEASE participate in this forum
Re: You asked mamu it's coming.
« Reply #3 on: June 12, 2014, 05:44:57 AM »
That display looks like what I used here --> MCU mod


Offline Claviger

  • Sr. Member
  • ****
  • Joined: May 2014
  • Location: Hawaii
  • Posts: 94
  • Karma: +4/-1
  • Gender: Male
Re: You asked mamu it's coming.
« Reply #4 on: June 12, 2014, 05:57:41 AM »
Funny enough Break, I was just reading your post from 2 years ago, realizing I was reinventing the wheel :P
Once I have it all playing nice I am going to take a crack at designing a PCB and seeing if I can get sparkfun or someone to do a single board solution in an ecig friendly footprint.

Just looking at that display I realize, I really did redo a bunch of your previous development work lol.

Did you ever have any issues with those 1000mah lipos you used?

Online Breaktru

  • Administrator
  • PV Master
  • *****
  • Joined: Nov 2008
  • Location: NY
  • Posts: 3344
  • Karma: +792/-4
  • Gender: Male
  • PLEASE participate in this forum
Re: You asked mamu it's coming.
« Reply #5 on: June 12, 2014, 06:49:36 AM »
It's all good Clav. Go for it.
What I did different was to measure the amperage w/ an ACS712 module and measure the output voltage to calculate by code the atty resistance and wattage.

Before using an MCU I played around with a DC-DC converter and took readings with my DMM for output voltage and measured my atty coil resistance then used ohms law to calculate amperage. Then I threw on my DMM to measure amperage and was surprised that there was a difference with the calculated amperage compared to the actual measured amperage.

Offline CraigHB

  • PV Master
  • *******
  • Joined: Nov 2011
  • Location: Reno, Nevada
  • Posts: 2023
  • Karma: +246/-1
  • Gender: Male
Re: You asked mamu it's coming.
« Reply #6 on: June 12, 2014, 02:03:53 PM »
There's lots of room for error there.  A DMM loses a lot of accuracy when it gets into the low end of the resistance range.  Also the DMM's ammeter introduces additional resistance into the circuit.  It varies depending on the ammeter.  Better ones introduce less.

Generally the best way to find a low resistance is to measure voltage and current and divide it out.  A good ammeter will introduce less error due to burden voltage than an ohmmeter has at very low resistances.  Though if you want really good accuracy for low resistance, you can buy a milli-Ohmmeter.

Offline Claviger

  • Sr. Member
  • ****
  • Joined: May 2014
  • Location: Hawaii
  • Posts: 94
  • Karma: +4/-1
  • Gender: Male
Re: You asked mamu it's coming.
« Reply #7 on: June 12, 2014, 02:29:53 PM »
Accuracy is why I chose the 50 ohm value. The resolution is .05 ohms per step. If I used a 10 ohm resistor it would be .01 per step. 0.05 resolution is enough for my needs.

Offline CraigHB

  • PV Master
  • *******
  • Joined: Nov 2011
  • Location: Reno, Nevada
  • Posts: 2023
  • Karma: +246/-1
  • Gender: Male
Re: You asked mamu it's coming.
« Reply #8 on: June 12, 2014, 05:04:12 PM »
Generally the best way to measure resistance and power in an e-cig mod is by measuring current.  When using a divider to find resistance, you're limited in resolution by the resistance you put inline to take a measurement.  You can't use a really low resistance to get high resolution since there's power limitations there.  In comparison, a current sensor with a step of 10mA has a resolution of 10 mOhms at 4V/2A.  Resolution increases with current.  At 3V/6A resolution is less than 1 mOhm.  That falls inline with real world usage where lower atomizer resistance demands higher resolution.

With a divider you're more affected by the stability of your ADC measurements since each step of the ADC represents a larger difference in resistance.  That can be a problem for boards packed in tightly with an electrically noisy DC-DC converter (they're all electrically noisy).  When using an ammeter, each ADC step is a smaller increment so readings are more stable.

A voltage times current calculation for power will give you a more accurate reading compared to a V squared over R calculation.  When you square the voltage you square the error.  Then you have resistance error on top of that which is going to be higher with a divider measurement.

In terms of electronics, a divider is much easier to implement compared to a differential amplifier.  Not so much compared to a Hall effect sensor (just one chip).  With an ammeter you don't have to worry about component loading like you do with a divider circuit.  However, an ammeter requires an inline connection to the atomizer with heavy gauge wires so that's a big drawback.  A divider requires only a parallel connection to the battery and atomizer using small gauge wires.

In any case a divider will work, I just wanted to point out the pros and cons either way.  For a divider it's mostly cons.  One of two pros is it's easy to implement, just a resistor and switch, but then the single chip ammeter solutions kind of blow that one out.  Though differential amps have better resolution since the gain is adjustable.  You won't get 10mA per step with a Hall effect sensor chip, more like 20mA or 30mA per step which impacts ohmmeter and wattmeter resolution.  The lack of a heavy gauge inline connection to the atomizer is probably the main pro for a divider based measurement.

Offline Claviger

  • Sr. Member
  • ****
  • Joined: May 2014
  • Location: Hawaii
  • Posts: 94
  • Karma: +4/-1
  • Gender: Male
Re: You asked mamu it's coming.
« Reply #9 on: June 12, 2014, 07:32:15 PM »
Thanks for pointing some of those out. Didn't think about voltage squared also squaring the error.  In any case, in my opinion if you are staying over .3 ohms, then a tenth of an ohm resolution is fine, below that is where I like to have hundredths available, and really I have no need to go that low with a vv device. 

I looked at using a break out ammeter board. Implementation is just so easy this way both in code and hardware, plus it's tiny so I figured I'd go this route. 

Offline CraigHB

  • PV Master
  • *******
  • Joined: Nov 2011
  • Location: Reno, Nevada
  • Posts: 2023
  • Karma: +246/-1
  • Gender: Male
Re: You asked mamu it's coming.
« Reply #10 on: June 12, 2014, 08:49:42 PM »
Yeah, I noticed this one at SparkFun the other day;

https://www.sparkfun.com/products/8882

They have some neat little parts on that site.

Offline mamu

  • PV Master
  • *******
  • Joined: Dec 2013
  • Location: IN
  • Posts: 476
  • Karma: +72/-3
  • Gender: Female
Re: You asked mamu it's coming.
« Reply #11 on: June 13, 2014, 03:04:36 AM »
Holy moly Claviger - you really did your homework there. 

Thanks so much for sharing the code. 

Can't wait til you show us the eye candy of it in a mod.  :thumbsup:

Offline Claviger

  • Sr. Member
  • ****
  • Joined: May 2014
  • Location: Hawaii
  • Posts: 94
  • Karma: +4/-1
  • Gender: Male
Re: You asked mamu it's coming.
« Reply #12 on: June 13, 2014, 02:36:36 PM »
Today starts the PCB design to unify all this fun into 1 item which should end up including what will essentially be an OKL2-20T, Arduino compatible chip, and the screen controller. Will see if I can get a balance charger and usb connection to charge from as well.

Step 1: Learn to use the software lol, this should be fun.

Offline Claviger

  • Sr. Member
  • ****
  • Joined: May 2014
  • Location: Hawaii
  • Posts: 94
  • Karma: +4/-1
  • Gender: Male
Re: You asked mamu it's coming.
« Reply #13 on: June 13, 2014, 06:38:29 PM »
Yeah, I noticed this one at SparkFun the other day;

https://www.sparkfun.com/products/8882

They have some neat little parts on that site.

I have decided to avoid hall effects for a couple of reasons. As the Amp handling capability scales up, the resolution at low currents is reduced, or so I understand.  As a result, if a 40 Amp capable sensor was used, the resolution below 5 Amps becomes too low and it defeats the purpose of using it for more accurate readings.  With the voltage divider setup, I can maintain reasonably accurate measurements regardless of output power, as it is an independent circuit from the power supplied to fire the atomizer.

The disadvantage is that the ohm meter can only be active when the high power firing circuit is disabled. This results in having to hold the Ohm measurement in memory and use it for calculation, so it will not account for resistance rise due to heat of the wire. At the end of the day, its probably not a massive difference, and really my level of OCD lets me live with this margin of error lol.

Offline CraigHB

  • PV Master
  • *******
  • Joined: Nov 2011
  • Location: Reno, Nevada
  • Posts: 2023
  • Karma: +246/-1
  • Gender: Male
Re: You asked mamu it's coming.
« Reply #14 on: June 13, 2014, 07:36:49 PM »
Well, there's always going to be ~some~ error.  The tolerance is purely up to the designer and the requirements that need to be met. 

I haven't used the Hall effect sensors myself, but I've thought in terms of using them.  I've read the ACS712 data sheet. 

The 5 Amp ACS712 has 185mV/A resolution.  An MCU running on 5V using supply voltage for the ADC reference has a step size approximately 5mV.  That translates to a step size of 27mA in the ammeter which is a bit high.  Though one thing to note is that some MCUs have a 12 bit ADC over a 10 bit ADC which quarters the step size.

However, the ADC does not have to be referenced to supply voltage.  Most MCU's allow an external ADC reference.  Some actually have an internal programmable reference which is really handy.  An ADC reference of 2V would provide an ADC step size approximately 2mV for a 10mA step in the ammeter which is really good.  That provides a swing about 10A which should be good.

The one thing I'm not sure about with the ACS712 is the maximal swing on sense output.  I assume it can go all the way up to supply voltage, but I'm not sure.  The data sheet leads me to believe swing is limited to a Volt and that would be a problem.  Could be just accuracy is only guaranteed up to a Volt, but it can swing higher no problem.  Maybe someone who's used one can say one way or the other. 

In any case, 185mV/A is going to provide the best resolution.  The next one up is 100mV/A which may actually be better if the ADC is referenced accordingly.


« Last Edit: June 13, 2014, 08:00:44 PM by CraigHB »

Offline Claviger

  • Sr. Member
  • ****
  • Joined: May 2014
  • Location: Hawaii
  • Posts: 94
  • Karma: +4/-1
  • Gender: Male
Re: You asked mamu it's coming.
« Reply #15 on: June 20, 2014, 03:27:52 PM »
Testing has begun on both hardware and software design. Thus far, a couple of tweaks here and there and it seems to be working well, ugly, but working lol :P 32x32x95 extruded aluminum enclosures with radiused edges on the way as well as some smaller displays to scale it down and make it hand friendly for vertically challenged people. 

Left it on overnight with sleep mode disabled OLED on, and sensors running, so I could calculate the idle current draw. Turned in 33ma draw. Not terrible considering it will be down in the uA draw area when in sleep.

As a testament to the design of TI hardware, there are no stability issues with the arduino or the OKL2 with no external capacitors used!

Some shots of Jenavive, the ugly but productive mod:

2S2P 1800mah LiPO setup


Early in the (poor)soldering process:


Finally got around to using a nice button, also, Mini-Din balance charging from an external charger!


10 pounds of **** in a 5 pound bag taken just before I wired in the on/off SP2T on off switch and connected the pwr/ground:


Finally a shot of the (ugly cutout) display:
« Last Edit: June 21, 2014, 09:06:46 AM by Claviger »

Online Breaktru

  • Administrator
  • PV Master
  • *****
  • Joined: Nov 2008
  • Location: NY
  • Posts: 3344
  • Karma: +792/-4
  • Gender: Male
  • PLEASE participate in this forum
Re: You asked mamu it's coming.
« Reply #16 on: June 20, 2014, 04:49:47 PM »
Nice! You're well on your way. Tight fit, ain't it.
Can I suggest making your next cutout to show just the readable portion of the display.

Offline CraigHB

  • PV Master
  • *******
  • Joined: Nov 2011
  • Location: Reno, Nevada
  • Posts: 2023
  • Karma: +246/-1
  • Gender: Male
Re: You asked mamu it's coming.
« Reply #17 on: June 20, 2014, 06:20:34 PM »
Looks like it's coming along nicely. 

You can check your idle draw using an ammeter inline with the battery, it's what I usually do.  You can check bigger currents with a clamp on ammeter using a non-contact sensor (Hall effect), however, when you get into the uA the only way to check it is with an inline ammeter. 

If you can get draw under 100uA when asleep that's probably sufficient.  Consider that 100uA is 2.4mAh per day on the battery.  Of course the lower the better.

The draw can be pretty high as long as the device goes to sleep at some point.  The majority of that 33mA is probably the display.  Putting a timer on the display will cut the draw down quite bit. 

I use a 30 second supervisory sleep timer for the MCU which does double duty as an atomizer time-out.  The display has a 10 second timer.  When firing the atomizer, there's a secondary timer that puts the MCU to sleep shortly after the trigger is released.  You don't want to run things any longer than you need to since it can impact overall run time for the device.


« Last Edit: June 20, 2014, 06:23:56 PM by CraigHB »

Offline Claviger

  • Sr. Member
  • ****
  • Joined: May 2014
  • Location: Hawaii
  • Posts: 94
  • Karma: +4/-1
  • Gender: Male
Re: You asked mamu it's coming.
« Reply #18 on: June 21, 2014, 03:45:20 AM »
Thanks guys. This one is more of a proof of concept than anything else, another stop-gap mod. When I get the new boxes in I'll build my first real mod I intend to keep and use. After that I plan on focusing on getting this all onto one PCB and see about getting a batch of the single board solutions made using a surface mount OKL2 on the custom PCB.

Craig, your display timer suggestion has been implemented, stays on for about 7 seconds after pressing fire button.  Your wording in your response pointed me in an easy way to do it.  Also redid the screen so it looks better now. Added a UVLO lockout message "LOW BATT RECHARGE" that stays up for 3 seconds then display turns off.

Isee no reason to use external caps for the OKL2 in an Ecig based on my own real world testing without them.  If I match the voltage I get out of my Penny mechanical, the vape is almost identical, so while I am sure there is probably a lot of ripple, it doesn't seem to be negatively effecting the vape quality for me.


Side note: These Tenergy 10c 900mah 2S batteries are really kick ass! I am fairly certain they are under-rated by a healthy margin.  Charging them to 8.4 volts, I have gone 9 hours 45 minutes today without a charge.  That amounts to ~10ml of fluid used in a dual coil .51 ohm Fogger v4, and the batteries are still at 7.54 volts!   The other fantastic aspect is that under load firing at 36 watts, they only drop 0.12 volts. My Sony VTC5s in series were dropping 0.3 volts using the same Fogger v4 with the same coils at the same voltage.  I suspect it may have something to do with being a 2S2P vs 2S1P setup, but all the same, still quite impressive for $9.00 LiPOs!

Confirmed that Tenergy 1-4s balance charger, the cheap one, works to allow charging while vaping as well :P
« Last Edit: June 21, 2014, 08:00:40 PM by Claviger »

Offline CraigHB

  • PV Master
  • *******
  • Joined: Nov 2011
  • Location: Reno, Nevada
  • Posts: 2023
  • Karma: +246/-1
  • Gender: Male
Re: You asked mamu it's coming.
« Reply #19 on: June 21, 2014, 02:07:22 PM »
The ripple has pretty much zero effect on atomizer performance.  The only issue is ripple has to be filtered out when sensing voltage with an MCU, easily done with a cap and resistor.

Those cells do sound like they work really well.  LiPos tend to perform better than the round cells, though there's usually not ~that~ much of a difference from the high drain 18650s.  The fact that LiPos don't use a battery sled can make big difference.  There can be a lot of resistance in those battery contacts.  The round cells can be hard mounted too, but I would not recommend soldering them unless people really know what they're doing, very easy to damage them that way.

I think you're confusing makers on that one, the OKL and OKR parts are made by Murata.  Either way, I agree, I think there may be more concern with input and output caps than warranted.  Some of the modules require them, but none of the Murata ones do.  When not required, they're only recommended to reduce ripple and improve transient response which doesn't matter at all when powering an atomizer.  It's possible adding them can improve reliability, but there's no data that supports that one way or the other.  Personally, I would only add them if required.

Offline fusionboy

  • Jr. Member
  • **
  • Joined: Jun 2014
  • Location: CA
  • Posts: 17
  • Karma: +1/-0
  • Gender: Male
Re: You asked mamu it's coming.
« Reply #20 on: June 21, 2014, 02:08:19 PM »
Hey there! New guy here ???? That Adafruit display looks like the one that 3one Vaping was testing http://youtu.be/2qjvK-Y4Mo0  The graphics in the video also look exactly like the VA Variant Mod. Only it says Variwatt instead of Variant ???? Thank you guys for posting all of your knowledge, maybe some of it will seep into my head ????

Offline Claviger

  • Sr. Member
  • ****
  • Joined: May 2014
  • Location: Hawaii
  • Posts: 94
  • Karma: +4/-1
  • Gender: Male
Re: You asked mamu it's coming.
« Reply #21 on: June 21, 2014, 09:57:28 PM »
After enabling sleep for the display, I ran a current draw test. 6ma draw for the Arduino + OKL2 in standby mode.  If I turn off the "On" LED on the arduino, I bet it will be less than 1/2 that. This is without putting the arduino to sleep.  There may end up being no real need for sleep on it after all.

What I am concerned with is charging and letting the charger terminate with it powered on.  Thus far I have only left it on the charger up to 8.4v displayed and unplugged with the mod is turned on. The only time I have the let the charger terminate is when the box is turned off.  Will a 6ma draw keep the charger turned on and end up overcharging the batteries?

Offline Jasen

  • Ultra Member
  • ******
  • Joined: Mar 2014
  • Location: Seattle, Wa. USA
  • Posts: 232
  • Karma: +11/-0
  • Gender: Male
Re: You asked mamu it's coming.
« Reply #22 on: June 22, 2014, 12:52:04 AM »
Wouldn't the draw just cause the charger to maintenance charge to keep the batts up to 8.4v :Thinking:

Offline Claviger

  • Sr. Member
  • ****
  • Joined: May 2014
  • Location: Hawaii
  • Posts: 94
  • Karma: +4/-1
  • Gender: Male
Re: You asked mamu it's coming.
« Reply #23 on: June 22, 2014, 02:08:24 AM »
I honestly don't know and don't really want to find out the hard way if not lmao.

On a side note, I hit UVLO lockout tonight and it worked perfectly :P Won't fire and gives a warning message for 3 seconds then turns off screen.

That 1800mah battery lasted 15 hours 30 minutes off the charger. During 10 hours of it I was vaping pretty steadily, 4 tanks of 4ml today through the Fogger and a tank of 5.5 ml through my Expromizer!  Usually between 23-36 watts, with occasional max power pulls to test wicking capability out.
« Last Edit: June 22, 2014, 04:28:49 AM by Claviger »

Offline Visus

  • PV Master
  • *******
  • Joined: Oct 2013
  • Location: Nexxus
  • Posts: 929
  • Karma: +62/-0
  • Gender: Male
Re: You asked mamu it's coming.
« Reply #24 on: June 22, 2014, 04:12:17 PM »

Offline CraigHB

  • PV Master
  • *******
  • Joined: Nov 2011
  • Location: Reno, Nevada
  • Posts: 2023
  • Karma: +246/-1
  • Gender: Male
Re: You asked mamu it's coming.
« Reply #25 on: June 22, 2014, 06:27:42 PM »
After enabling sleep for the display, I ran a current draw test. 6ma draw for the Arduino + OKL2 in standby mode.  If I turn off the "On" LED on the arduino, I bet it will be less than 1/2 that. This is without putting the arduino to sleep.  There may end up being no real need for sleep on it after all.

It depends on how you long you plan to leave the mod unattended.  I use permanently mounted cells and can leave a mod on the shelf for months at a time.  I need to get my idle draw minimized as much as possible.  For a mod with removable cells, it's less of on issue. 

You can easily calculate the drain based on the draw.  It's pretty much why amp-hours are used to measure battery capacity in the first place.  So, if the mod  has a 3mA draw, it will use 3mAh in an hour, 72mAh in a day.  You could drain a fully charged 18650 in a month with the mod sitting on a shelf.  If that's a problem or not is up to the user.

Another consideration is if your charge consumption is one 18650 in a day, then 72mAh of that will be going to idle draw.  A hit is typically 3 or 4mAh so you're giving up as much as 24 hits to idle draw.  If an 18650 lasts two days, the number is double.  That would be totally unacceptable to me, but maybe not to others.

Quote
What I am concerned with is charging and letting the charger terminate with it powered on.  Thus far I have only left it on the charger up to 8.4v displayed and unplugged with the mod is turned on. The only time I have the let the charger terminate is when the box is turned off.  Will a 6ma draw keep the charger turned on and end up overcharging the batteries?

There is some dependency on the charger controller chip, but typically the way they work is once the cycle is complete, they don't re-engage charge mode until battery voltage drops below a threshold typically around 90% of a full charge.  So, there will be no issue in leaving the charger connected after the cycle completes.

The charger will see idle draw as draw from the battery, it can't tell the difference.  What it will impact is charger cut-off current seen by the battery. 

The cutoff current is usually 10% of the full charging rate so if you charge at 1A, the charger recognizes the battery as fully charged when charging current falls below 100mA.  If a big portion of that is idle draw, then the battery is actually cutting off at a lower current.  It's generally not an issue since most 18650s have a 50mA cutoff requirement and you're well above that with a 1A charger. 

You'll dig below that minimum cutoff for a 500mA charging rate, but with a 10mA idle draw, you'd be cutting the battery off at 40mA instead of 50mA.  Really not a big deal.  That cutoff current level is not critical at all.  In fact, it's possible to run without any charge cutoff at all, though it's generally not good for Li-Ion cells to, in effect, be left in a trickle charge mode after charging is complete.

Online Breaktru

  • Administrator
  • PV Master
  • *****
  • Joined: Nov 2008
  • Location: NY
  • Posts: 3344
  • Karma: +792/-4
  • Gender: Male
  • PLEASE participate in this forum
Re: You asked mamu it's coming.
« Reply #26 on: June 22, 2014, 06:52:06 PM »
 :laughing: I just shut off my on/off switch over night or when I'm not using it for a period of time.

Offline Claviger

  • Sr. Member
  • ****
  • Joined: May 2014
  • Location: Hawaii
  • Posts: 94
  • Karma: +4/-1
  • Gender: Male
Re: You asked mamu it's coming.
« Reply #27 on: June 26, 2014, 06:31:55 PM »
Well, since building it some progress has been made and I will update the code this evening.
I have added some new functions:

First, the unit goes to sleep now :P It wakes with no noticeable delay. Power consumption test incoming, but I expect it to be very low.
The button tracks the number of clicks and each number can be defined as a different function. For now I have 1 press and release as waking it, turning on the screen, and displaying all metered information without firing the atty.  2,3,4 presses do nothing. 5 presses manually puts the unit to sleep. If you press and hold it fires the atty for as long as you hold the button down with no noticeable delay compared to the single button function code. 

The next VERY important feature I need to add in is a 20 or 30 second fire cutoff timer.  After the mod fell on its side two days ago and was firing for at least 5 minutes (possibly up to an hour), I now have a Kayfun 3.1 with nothing left of the insulator under the positive post, it literally liquefied it ... Not only that but I had a transparent chimney and M tank on it, both of which are not just visibly damaged but they are no longer cylinders, more like wavy crazy melted plastic slag.  The Kayfun is currently a dead short, 0.0 ohms measured on my DMM, my Arduino mod, and my HCIGAR ohm tester.... 

This led to an inadvertent test of three things:
1: Does the OKL2 correctly deal with a short circuit situation by turning off voltage output (yes, I measured the Kayfun's resistance with two devices following the incident and it is a dead short).
2: Do batteries survive without being damaged when the OKL2 is in a short circuit protection state (yes, the batteries are fine and still being used).
3: If the box setup is pushed to the absolute limits will everything survive (yes, with the exception of the atomizer lol)

Remaining functions to be added:
Stealth Mode Done
Puff Counter
Puff Timer Done
Total time Puffing since last full charge
Total uptime since last full charge
Number of puffs remaining in battery Abandoned too variable.
Deeper Sleep mode with all actions except a hardware interrupt to wake it ignored
Target Wattage mode
Target voltage mode

« Last Edit: June 28, 2014, 10:53:14 AM by Claviger »

Offline CraigHB

  • PV Master
  • *******
  • Joined: Nov 2011
  • Location: Reno, Nevada
  • Posts: 2023
  • Karma: +246/-1
  • Gender: Male
Re: You asked mamu it's coming.
« Reply #28 on: June 26, 2014, 07:36:10 PM »
Yes an atomizer cut-off timer is pretty much a mandatory requirement.  Aside form the damage it can do to the mod itself from overheating, there's the safety issue of a mod getting thrown into a drawer or something and starting a fire.  So any mod should have some kind of cut-off if possible.  I use 30 seconds myself, but shorter or longer can work fine as well. 

Granted mech mods do not have this feature and people generally have no heartburn over that, but I've heard many stories or people having issue with a mod stuck on in a pocket or in a backpack.  The safety aspect alone justifies using a mod with advanced electronics.

My mods themselves can endure a period much longer than 30 seconds so it's more a matter of external damage caused by the mod sticking on.  In any case, I use a temp sensor on the converter switches to ensure the converter can never be overheated.   The time-out should cover heating issues so it's more of a back-up safety feature.

As far as the OKR-T/10, it has over-current and short circuit protection, but I'd have to look in the data sheet if it has over-temp protection or not, don't think it does.  It will  protect itself from a short circuit or overload by limiting current so even if peripheral electronics don't sense it and shut it down, the regulator will protect itself.

Li-Ions batteries can handle a good amount of heat, but they get damaged once they get above 160F or so.  They can operate without issue up to 140F.  Since the regulator does not allow an overload, there should be no overheating issue in the batteries provided they have a high enough drain limit.  Best thing is for the mod's electronics to detect an overload and shut down the regulator.  I'm not sure, but I believe the OKR does not actually shut down during an overload, but rather it limits current to the maximum it can handle which may or may not exceed the battery's drain limit.

To see what the OKR does exactly during an overload or short circuit, you would need to put an ammeter inline with the atomizer under the fault condition.  A voltmeter will not tell you anything since a short circuit still obeys the physics of a voltage divider.  Since resistance is very low for the short, voltage will also be very low even though current may be high.  Current flow will tell you exactly what's happening.

Offline Visus

  • PV Master
  • *******
  • Joined: Oct 2013
  • Location: Nexxus
  • Posts: 929
  • Karma: +62/-0
  • Gender: Male
Re: You asked mamu it's coming.
« Reply #29 on: June 26, 2014, 10:25:19 PM »
My hobby senses going all nerd  :laughing2:

whoa clav awesome

much easier than c+ but I so wanna learn it
 

Offline mamu

  • PV Master
  • *******
  • Joined: Dec 2013
  • Location: IN
  • Posts: 476
  • Karma: +72/-3
  • Gender: Female
Re: You asked mamu it's coming.
« Reply #30 on: June 26, 2014, 10:38:53 PM »
Good stuff, Claviger.  Thanks so much for tinkering and plugging away with it and getting it to work and sharing with us.

Me too, Visus.

I don't know if I have the patience to learn it, so am waiting for Claviger to take my money and sell me one... or two. :laughing:

Offline Claviger

  • Sr. Member
  • ****
  • Joined: May 2014
  • Location: Hawaii
  • Posts: 94
  • Karma: +4/-1
  • Gender: Male
Re: You asked mamu it's coming.
« Reply #31 on: June 27, 2014, 01:55:49 AM »
Ya craig, I expected in a failure of the Atty it would all be safe inside the box, but its one thing for a data sheet to say so, and entirely another for it actually work as designed in the real world, a point I am very sure is not lost on you!  As a result of your response, I am now considering adding a simple 1 wire thermistor to measure the temp of the bottom of the 510 connector and lock out firing if it reaches a certain temp, no idea what I'll set it at yet, but thinking 170f should be the right ballpark.  That kayfun was H O T, definitely over 300f, quickly tapping it with a finger felt hot similar to when you accidentally touch a soldering iron tip.

Final layout of the screen for this version. A short video showing the multi button function and sleep timer.



A preview of things to come, just waiting on my Femtoduino and the new screen (33x12x2mm screen with 128x32 I2C for 9 bucks from china :P) to arrive and all of it will fit in the silver case 32x32x95:



https://www.youtube.com/watch?v=THTb6blhewM&feature=youtu.be
« Last Edit: June 27, 2014, 02:37:03 AM by Claviger »

Offline Visus

  • PV Master
  • *******
  • Joined: Oct 2013
  • Location: Nexxus
  • Posts: 929
  • Karma: +62/-0
  • Gender: Male
Re: You asked mamu it's coming.
« Reply #32 on: June 27, 2014, 02:46:21 AM »
Embedded it for ya

https://www.youtube.com/watch?v=THTb6blhewM

woot it works

Offline CraigHB

  • PV Master
  • *******
  • Joined: Nov 2011
  • Location: Reno, Nevada
  • Posts: 2023
  • Karma: +246/-1
  • Gender: Male
Re: You asked mamu it's coming.
« Reply #33 on: June 27, 2014, 03:38:20 AM »
That doesn't surprise me the atomizer got that hot.  If you run one long enough it can get quite hot, definitely hot enough to ignite something with a low flash point.  Then there's also the possibility the mod itself could catch on fire.

I use a 180F cut-out for the switch temps.  Probably good for the atomizer connector as well, maybe a bit lower.  Pretty easy thing to employ really.  My switches can actually run up to 300F before they suffer damage, but I use a lower temp since a thermistor mounted under them is insulated from the heat to an extent.

If you have the extra pins on your MCU, you can run more than one temp sensor.  I actually have two temp sensors on my boards, there's another one for the charger.  If you place one on the converter board you can protect it from excessive temperatures as well.  They can get pretty hot at maximal outputs.

If you want you can also provide a temperature monitor for display.  In that case, you need to transpose the table in the thermistor data sheet to a table in code.  It's a bit involved, but not terribly hard to do.  Thermistors are not linear so there's a rather convoluted equation to calculate the temperature from the resistance and there's more error.  It's more accurate to use a table than do the math in code.  I don't know though, you might find it easier to use the formula.  You can do it either way. 

There's actually a few different ways to measure temperature.  A diode or thermocouple can alternately be used.  I don't know though, I always use a thermistor, it's easy enough.  They're really accurate if you set them up right.  The one in my mods even correctly displays room temperature when it's been sitting long enough to cool down completely.

Offline miskol

  • Super Member
  • *****
  • Joined: Mar 2014
  • Location: Malaysia
  • Posts: 106
  • Karma: +9/-1
  • Gender: Male
Re: You asked mamu it's coming.
« Reply #34 on: June 27, 2014, 06:39:43 AM »
Hi Claviger,

nice work u did there  :rockin smiley:

Online Breaktru

  • Administrator
  • PV Master
  • *****
  • Joined: Nov 2008
  • Location: NY
  • Posts: 3344
  • Karma: +792/-4
  • Gender: Male
  • PLEASE participate in this forum
Re: You asked mamu it's coming.
« Reply #35 on: June 27, 2014, 07:58:34 AM »
Very good Clav, congrats  :beer-toast:

Offline zeus17

  • Ultra Member
  • ******
  • Joined: Jul 2013
  • Location: manila,Philippines
  • Posts: 215
  • Karma: +16/-0
  • Gender: Male
Re: You asked mamu it's coming.
« Reply #36 on: June 27, 2014, 03:26:21 PM »
so when will you take our money :)


really good work :)

Offline Claviger

  • Sr. Member
  • ****
  • Joined: May 2014
  • Location: Hawaii
  • Posts: 94
  • Karma: +4/-1
  • Gender: Male
Re: You asked mamu it's coming.
« Reply #37 on: June 28, 2014, 08:54:28 AM »
Now with autofire safety timer that resets upon button release. Post 2 has been updated to most current version.

Offline 72xmulch

  • Jr. Member
  • **
  • Joined: Jun 2014
  • Location: upstate ny
  • Posts: 2
  • Karma: +0/-0
  • Gender: Male
Re: You asked mamu it's coming.
« Reply #38 on: June 29, 2014, 03:57:19 AM »
joined this board to follow these posts.keep it up! :rockin smiley:

Offline Jonttu

  • Newbie
  • *
  • Joined: Jun 2014
  • Posts: 1
  • Karma: +0/-0
  • Gender: Male
Re: You asked mamu it's coming.
« Reply #39 on: June 30, 2014, 05:43:06 AM »
I can't believe somebody else had the same idea as me, but looks like you've actually nearly finished your project. Had the same idea except I'm using a Teensy v3.1 and a different display. I hope you don't mind but I'm just going to steal portions of your circuit diagram for my project :P. Remarkable work so far, I've been working on a Qt powered gui for my project for the past month. I had an idea about adding in a flow meter (leads running to a special drip tip maybe) to dynamically read the optimal drag/inhale for cloud chasing. You could essentially input your coil gauge, core gauge, amount of wraps, amount of coils and take power, current and resistance into account to calculate the heat potential/rate of change to determine at what rate you should drag at/decrease/increase your inhale. Might be overdoing it, just an idea that came to me when thinking of the benefits of having an arduino. I think with a device like this you could dynamically adjust power to drag speed measured via flow meter, just another idea :D

Offline Claviger

  • Sr. Member
  • ****
  • Joined: May 2014
  • Location: Hawaii
  • Posts: 94
  • Karma: +4/-1
  • Gender: Male
Re: You asked mamu it's coming.
« Reply #40 on: June 30, 2014, 07:23:25 PM »
Go right ahead Jonttu, that is the whole point.  Two things on the circuit diagram, 1: You need a voltage divider for the atty input voltage if you are going to go over 5v (duh :P), and I think the atty voltage wire should connect to the negative side of the atomizer not the positive side, my reading are effected by the resistance of the atomizer, and I think it's because I am reading the positive side before the resistance of the coil.

I highly encourage you to steal the button code I used, not terribly easy to work out originally for me, but works great now and can extend to nearly an number of clicks per button used!

You're absolutely right, you could have it dynamically adjust power to airflow, you just need a tiny MAP or MAF to measure with. Actually really simple, as most are a linear 0-5v scale. I would think the best way would to be use the "track" pin on some of the dc-dc converters and use the analog out on the teensy so you can have the teensy generate the output voltage you want at low current, feed it to the dc/dc which will match "track" input to within 1% on some modules. No pot required at all, just a way of telling the teensy to increase or decrease the target "vape intensity", whatever arbitrary name you give it, via a button or knob or shake or whatever lol.

Went a step further, at first glance this looks promising, reading the data sheet now: http://cache.freescale.com/files/sensors/doc/data_sheet/MPXV7025.pdf a quick google tells me humans can pull ~18 kpa, so the 25 kpa range on this is perfect :P  I would envision a 510 connector on the box that is flat and then machine a groove around it about 5mm from the outer edge, put a oring in the groove. The atomizer you would drill a small hole into the bottom so the plenum area includes the sealed space between the 510 and atomizer bottom, then run a small hose from the map sensor up to a small hole in the 510 which draws from the sealed area. Then you get a vacuum signal with zero extra effort when installing/removing the atomizer :P

Actually.... this puts it in a very similar range to programming a standalone car ECU which, if you think of it like that, brings up the idea of a linear scale from x - y airflow rate for normal day to day vapes, then have it switch tables if you really pull hard to a much higher range of power, with no user adjustment it could recognize you are after a big cloud vs a ho hum cloud, similar to the way you tune for boost/off boost in turbo cars. The challenge, honestly, will be finding tank systems that can keep up with the 20 amp potential of the OKL2.  As it is, the best wicking tank I have found can only keep up with 40 - 45 watts, all the others seem to fall flat around 30 and taste like burnt cotton.

The list of tanks I can think of that would lend themselves to a tiny MAP sensor readily would be:
Kayfun 3.1
Expromizer
Taifun GT

Also: New feature added. This one I am actually kind of excited about. Total Time actually vaping, counts in seconds until it hits 60, then switches to minutes. Post 2 updated to reflect this.
« Last Edit: June 30, 2014, 11:10:36 PM by Claviger »

Offline eveshka

  • Jr. Member
  • **
  • Joined: Jul 2014
  • Location: United States
  • Posts: 4
  • Karma: +0/-0
  • Gender: Male
Re: You asked mamu it's coming.
« Reply #41 on: July 01, 2014, 04:47:56 PM »
Joined the board due to my search for arduino controlled mods. Ultimately I am a diy guy over spending extraneous amounts of cash for something. lol

I have been reading this post since I first came across it about 2 weeks ago. Nice work. I plan on doing something along these lines. So far my parts list is as follows: naos raptor 300w, color oled display compatible with arduino, and femtoduino. So far that is what I have in my head for the major components. I do have a generalized question to ask. Why is the regulator controlled by a pot versus using the arduino itself to tune the wattage? If this can be done, which I think it can, can someone point me in the direction I need to go to teach myself on how? I would like to know the why or why not versus a blind "Here is what you need."

Offline Claviger

  • Sr. Member
  • ****
  • Joined: May 2014
  • Location: Hawaii
  • Posts: 94
  • Karma: +4/-1
  • Gender: Male
Re: You asked mamu it's coming.
« Reply #42 on: July 01, 2014, 06:40:33 PM »
Keep in mind this is all hopefully going to migrate to a single board, and an on-board screen (ecigduino anyone?), with only a few wires required, hoping for:
Vin
Gnd
Fire Button
+/- Buttons (or 2 wires to a knob)
Vout

If I can get it down to those 6-7 wires, I think it would be readily adopted by the masses.

I am using a pot for two reasons.
1: I bought a Arduino Pro Micro, it does not have an analog output to control the voltage via the track pin on the DC-DC. It does have PWM control, but since I was(still) not sure how the DC-DC will work with a PWM on the track pin instead of an analog signal, I didn't want to start off with a questionable circuit for my first build.  I could build a low pass filter etc, but really, this was the first time I have ever messed with arduino hardware or code, so the priority was learning for this one.

2: I H A T E click buttons to change power output, knobs are faster and easier to use.

The teensy, mentioned in post 39, does have a analog output, so power control there would be very easy without any external circuitry or filters via the teensy and 2 buttons, a knob, or a gravity sensor.
« Last Edit: July 01, 2014, 06:46:59 PM by Claviger »

Offline CraigHB

  • PV Master
  • *******
  • Joined: Nov 2011
  • Location: Reno, Nevada
  • Posts: 2023
  • Karma: +246/-1
  • Gender: Male
Re: You asked mamu it's coming.
« Reply #43 on: July 01, 2014, 07:08:55 PM »
Knobs are better yes, but the problem is mechanical pots get jumpy once they get worn, doesn't take long for that to happen.  A rotary encoder dial would be a lot better, no wear.  I've never designed one so I don't know how practical that would be for an e-cig.

The input to the converter's voltage setting has to be analog, not only that but the circuit is sensitive to stray impedance and noise.  You have the choice of a mechanical pot or a digital pot, that's about it.  If you try to control that circuit with anything inline other than a resistor, the converter will fail to run properly.

Offline Claviger

  • Sr. Member
  • ****
  • Joined: May 2014
  • Location: Hawaii
  • Posts: 94
  • Karma: +4/-1
  • Gender: Male
Re: You asked mamu it's coming.
« Reply #44 on: July 03, 2014, 05:20:53 AM »
After adding the vape time, timer (what a mouthful that is) I am a bit shocked at the results! 25 minutes of fire time from 8.4 > uvlo warning?  So... average pull time of 3 seconds thats... 500 pulls.  At that rate, it means I take 29 pulls an hour all day while awake.. I guess that might be accurate :P Of course, this math doesn't account for idle draw of the mod, so yeah.

Interesting stuff you can learn lol.

Offline werkkrew

  • Full Member
  • ***
  • Joined: Sep 2013
  • Posts: 25
  • Karma: +2/-0
Re: You asked mamu it's coming.
« Reply #45 on: July 21, 2014, 02:48:43 PM »
Hey Claviger, are there any updates on this project?  I would love to see some more code and an finalized wiring diagram so that I could try to build one of these!

Offline jrweber02

  • Jr. Member
  • **
  • Joined: Jan 2014
  • Location: champaign il
  • Posts: 11
  • Karma: +1/-0
  • Gender: Male
Re: You asked mamu it's coming.
« Reply #46 on: July 21, 2014, 04:02:50 PM »
Haha was just bout to ask the same im excited to try this out

Offline werkkrew

  • Full Member
  • ***
  • Joined: Sep 2013
  • Posts: 25
  • Karma: +2/-0
Re: You asked mamu it's coming.
« Reply #47 on: July 22, 2014, 10:04:25 AM »
Maybe someone else who knows more about electronics/arduino's can answer my questions, so I'll just ask.

What is the purpose of the 100 ohm POT connected to the N-FET and A0 on the Arduino?  If it is required, would any 100 ohm pot be suitable?

The part of the circuit diagram with the 1.3k res + 1.5k pot on Rtrim of the OKL seems off, would it be ok to use a 1k or 1.5k ohm pot as specified in the arduino-less implementations of the OKL2?

The zener diode and 1A fuse in the circuit diagram are not needed, correct?

In order to use the arduino with Vout on the OKL2 of >5v, I would have to implement a basic resistor based voltage divider (2x 1k ohm resistors) and modify the code to adjust accordingly, correct?

Are there any other issues with the circuit diagram?


I am very comfortable writing the code for the arduino but I want to make sure the physical circuit is sound.

Also, does anyone know how the setup in this thread actually works, meaning, does the main pot connected to the OKL2 still just adjust voltage and the arduino does nothing more than provide a fancy display of various parameters or is there a way to make it function more like a DNA/Gi2/VariAnt whereby you are adjusting the wattage from A-B and the arduino takes care of the voltage adjustment.  I assume this would require the use of a digital pot or something but I'm not sure.

Offline CraigHB

  • PV Master
  • *******
  • Joined: Nov 2011
  • Location: Reno, Nevada
  • Posts: 2023
  • Karma: +246/-1
  • Gender: Male
Re: You asked mamu it's coming.
« Reply #48 on: July 22, 2014, 06:27:45 PM »
I haven't studied the diagram so I can't answer your most of your questions at this point, but the intent of the design is to provide a set of gauges for any regulated e-cig mod.  To make the design a complete controller would require the addition of a digital pot which is going to be specific to a particular DC-DC converter.  That would sort of defeat the point of a generally applicable gauge set.

Offline Claviger

  • Sr. Member
  • ****
  • Joined: May 2014
  • Location: Hawaii
  • Posts: 94
  • Karma: +4/-1
  • Gender: Male
Re: You asked mamu it's coming.
« Reply #49 on: July 22, 2014, 09:03:24 PM »
Project is not abandoned. I am still using it and tweaking it, but currently it is on hold waiting on a vendor to figure out how to mail a package (24 days since order was placed...).

Code is available in the 2nd post in this thread.
Diagram is NOT up to date, but it is close.

Once the missing item arrives I will document the construction of the next mod and provide an updated detailed diagram/code.

Breaktru Forum  |  eCigarette Forum  |  Modding  |  Topic: You asked mamu it's coming.
 

gfxgfx
gfx gfx
Powered by MySQL Powered by PHP Valid XHTML 1.0! Valid CSS!