Breaktru Forum

eCigarette Forum => Modding => Topic started by: Claviger on June 12, 2014, 05:33:00 AM

Title: You asked mamu it's coming.
Post by: Claviger 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.
Title: Re: You asked mamu, I'm delivering
Post by: Claviger 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;
Title: Re: You asked mamu it's coming.
Post by: Claviger on June 12, 2014, 05:40:26 AM
(http://i195.photobucket.com/albums/z226/tcclaviger/MatchingCircuit-Working_zps61a692c0.png)

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.
Title: Re: You asked mamu it's coming.
Post by: Breaktru on June 12, 2014, 05:44:57 AM
That display looks like what I used here --> MCU mod (http://breaktru.com/smf/index.php/topic,582.0.html)

(http://breaktru.com/ecig/mcu2_mod_2.jpg)
Title: Re: You asked mamu it's coming.
Post by: Claviger 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?
Title: Re: You asked mamu it's coming.
Post by: Breaktru 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.
Title: Re: You asked mamu it's coming.
Post by: CraigHB 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.
Title: Re: You asked mamu it's coming.
Post by: Claviger 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.
Title: Re: You asked mamu it's coming.
Post by: CraigHB 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.
Title: Re: You asked mamu it's coming.
Post by: Claviger 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. 
Title: Re: You asked mamu it's coming.
Post by: CraigHB 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.
Title: Re: You asked mamu it's coming.
Post by: mamu 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:
Title: Re: You asked mamu it's coming.
Post by: Claviger 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.
Title: Re: You asked mamu it's coming.
Post by: Claviger 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.
Title: Re: You asked mamu it's coming.
Post by: CraigHB 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.


Title: Re: You asked mamu it's coming.
Post by: Claviger 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
(http://i195.photobucket.com/albums/z226/tcclaviger/BatteryprotoMCUmod_zpse1c05003.jpg)

Early in the (poor)soldering process:
(http://i195.photobucket.com/albums/z226/tcclaviger/boardsprotomcumod_zps2da35354.jpg)

Finally got around to using a nice button, also, Mini-Din balance charging from an external charger!
(http://i195.photobucket.com/albums/z226/tcclaviger/SideprotoMCUmod_zpsc5499d6f.jpg)

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:
(http://i195.photobucket.com/albums/z226/tcclaviger/gutsprotomcumod_zps99d897aa.jpg)

Finally a shot of the (ugly cutout) display:
(http://i195.photobucket.com/albums/z226/tcclaviger/protMCUworking_zpsae4c2c1a.jpg)
Title: Re: You asked mamu it's coming.
Post by: Breaktru 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.
Title: Re: You asked mamu it's coming.
Post by: CraigHB 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.


Title: Re: You asked mamu it's coming.
Post by: Claviger 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
Title: Re: You asked mamu it's coming.
Post by: CraigHB 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.
Title: Re: You asked mamu it's coming.
Post by: fusionboy 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 ????
Title: Re: You asked mamu it's coming.
Post by: Claviger 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?
Title: Re: You asked mamu it's coming.
Post by: Jasen 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:
Title: Re: You asked mamu it's coming.
Post by: Claviger 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.
Title: Re: You asked mamu it's coming.
Post by: Visus on June 22, 2014, 04:12:17 PM
Awesome

Ya made it easy.

For cutouts the geek forum recommended this nibbler over many others.

http://www.amazon.com/Parts-Express-Nickel-Plated-Nibbling/dp/B0002KRACO/ref=sr_1_2?s=hi&ie=UTF8&qid=1344350024&sr=1-2&keywords=nibbler+tool


Title: Re: You asked mamu it's coming.
Post by: CraigHB 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.
Title: Re: You asked mamu it's coming.
Post by: Breaktru 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.
Title: Re: You asked mamu it's coming.
Post by: Claviger 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

Title: Re: You asked mamu it's coming.
Post by: CraigHB 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.
Title: Re: You asked mamu it's coming.
Post by: Visus 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
 
Title: Re: You asked mamu it's coming.
Post by: mamu 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:
Title: Re: You asked mamu it's coming.
Post by: Claviger 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.

(http://i195.photobucket.com/albums/z226/tcclaviger/IMG_20140626_194230_zpscd4cff6f.jpg)

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:

(http://i195.photobucket.com/albums/z226/tcclaviger/IMG_20140626_194049_zps1e84e738.jpg)

https://www.youtube.com/watch?v=THTb6blhewM&feature=youtu.be
Title: Re: You asked mamu it's coming.
Post by: Visus on June 27, 2014, 02:46:21 AM
Embedded it for ya

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

woot it works
Title: Re: You asked mamu it's coming.
Post by: CraigHB 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.
Title: Re: You asked mamu it's coming.
Post by: miskol on June 27, 2014, 06:39:43 AM
Hi Claviger,

nice work u did there  :rockin smiley:
Title: Re: You asked mamu it's coming.
Post by: Breaktru on June 27, 2014, 07:58:34 AM
Very good Clav, congrats  :beer-toast:
Title: Re: You asked mamu it's coming.
Post by: zeus17 on June 27, 2014, 03:26:21 PM
so when will you take our money :)


really good work :)
Title: Re: You asked mamu it's coming.
Post by: Claviger 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.
Title: Re: You asked mamu it's coming.
Post by: 72xmulch on June 29, 2014, 03:57:19 AM
joined this board to follow these posts.keep it up! :rockin smiley:
Title: Re: You asked mamu it's coming.
Post by: Jonttu 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
Title: Re: You asked mamu it's coming.
Post by: Claviger 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.
Title: Re: You asked mamu it's coming.
Post by: eveshka 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."
Title: Re: You asked mamu it's coming.
Post by: Claviger 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.
Title: Re: You asked mamu it's coming.
Post by: CraigHB 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.
Title: Re: You asked mamu it's coming.
Post by: Claviger 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.
Title: Re: You asked mamu it's coming.
Post by: werkkrew 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!
Title: Re: You asked mamu it's coming.
Post by: jrweber02 on July 21, 2014, 04:02:50 PM
Haha was just bout to ask the same im excited to try this out
Title: Re: You asked mamu it's coming.
Post by: werkkrew 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.
Title: Re: You asked mamu it's coming.
Post by: CraigHB 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.
Title: Re: You asked mamu it's coming.
Post by: Claviger 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.
Title: Re: You asked mamu it's coming.
Post by: Claviger on July 22, 2014, 09:13:30 PM
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 purpose was to allow a variable resistance to calibrate the Ohm measurement circuit. Following the original wiring diagram, I have found that it is not totally necessary as the values can be adjusted via code. You do need a refference load to calibrate it with.

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 values were chosen to provide I wider range of voltage control they are not "off" they are simply not exactly what was used in that build. These values if I remember right should go from 2.5-6 volts rather than 3-5.5 like the other build.

The zener diode and 1A fuse in the circuit diagram are not needed, correct? Correct, not needed at all and totally redundant.

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? Yes, that is correct. It is the same way I did the battery voltage measurement. You can duplicate that voltage divider on the atty voltage input. The code is already setup for the divider, the wiring diagram just doesn't reflect it.

Are there any other issues with the circuit diagram? Probably. I need to go through it again :P Take it as a starting point but not a 100% one. I am learning as I go too!


I am very comfortable writing the code for the arduino but I want to make sure the physical circuit is sound. If you read through the second post, you will see what aspects of the circuit are working 100% (most of it).

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. The way it works is the 1st way you describe, adjustment is done via the pot. I hate buttons and find that it is way more efficient to just grab a knob and turn than press a button like 100 times to go from low to high power.

As craigHB mentioned, this design in totally separate from the converter/regulator chosen, so can work with any of them, or multiple in parallel if you really feel the need to push .1ohm builds at 6 volts lol. I have since found some significantly miniaturized components for the project and am almost at the point where it is not worth integrating them onto one board as far as size is concerned. At this point I think the main reason to combine it into a single board would be simplicity and cost.
Title: Re: You asked mamu it's coming.
Post by: werkkrew on July 23, 2014, 12:26:59 PM
Thanks for the response Claviger.

I realize you are working on having it totally integrated as a drop-in module, which is awesome!  However, I already have an Arduino Pro Micro and an OLED display I could use.  If it wouldn't be too much trouble could you help me out with a finalized/working circuit I could use with your code in conjunction with either an OKL2-T/20 or a NSR020A0X43Z (Naos Raptor 20A), preferably the raptor.  I would love to build one of my own just as you have.

I have the Arduino, the display, an OKL2 and a Naos Raptor sitting at my house just waiting for this project.  I wish I was smart enough to figure it all out on my own but I'd be a lot more comfortably learning from your mistakes and following a finalized diagram provided by you.

Thanks so much for your time!
Title: Re: You asked mamu it's coming.
Post by: Claviger on July 25, 2014, 04:47:08 AM
I'll work up a revised diagram this weekend. PCs been down getting a thorough cleaning, 1.5 years without a water change or dust removal is a bit too long lol. 
Title: Re: You asked mamu it's coming.
Post by: karadorde on August 02, 2014, 12:14:20 AM
I can't believe I stumbled onto this thread. I have been searching far and wide for something like this. Recently saw some similar projects on reddit but unfortunately they are not nearly as generous as you. No one shared their code base or anything close to that. I am so thankful that you are willing to share diagrams/code/etc. I can't wait to read up on this some more and start tinkering. Excellent work so far!! Too cool!!
Title: Re: You asked mamu it's coming.
Post by: karadorde on August 04, 2014, 10:19:57 AM
Beginning to look at how to put one of the 20A Raptors into this schematic. This is by no means anywhere near complete/correct. I just scabbed the raptor board into your layout minus a few parts. I referenced Mamu's diagram and a few others just to get a rough idea. Currently trying to determine how to work a digital pot into the schema.

(http://i.imgur.com/uNNSsCh.jpg)

I found this schematic for a digital pot.

(http://i.imgur.com/hDwTG2N.png)

Claviger, I know you aren't big on using push buttons for the wattage adjustment, but I think it is something that I'd like to work into the scheme just to see if I can get it to work. Need to research how to incorporate that through the Pro Micro though, that way the up/down can be used for other adjustments and such.

Anyway, hope you don't mind me jumping in on this. Not trying to beat anyone to it, I just love this idea.
Title: Re: You asked mamu it's coming.
Post by: CraigHB on August 04, 2014, 07:03:52 PM
It's hard to find digital pots with an up/down interface like that.  When they do have an up/down interface, it's typically multiplexed with a serial bus so there isn't a discrete up and down input.  What they have is an up/down input and a direction input.  Not a big deal but it takes some extra components and different wiring to facilitate use of buttons that way.

Another issue is that converter module requires a 200 Ohm pot.  Digital pots are not available with a 200 Ohm range.  I think the closest you can get is 1k or maybe 500 Ohms, which is fine if the pot has enough taps. 

Normally you would just control the digital pot with one of the MCU's serial buses.  The only reason not to would be if you adamantly want to avoid any additional coding or wiring changes to the original design.

Running the digital pot off a serial bus is going to be a lot easier than trying to multiplex tactile inputs with a pot and an MCU separately.  That's still going to require code changes, and hardware changes too.  Why not just add code to control the POT serially which will avoid any hardware nonsense.
Title: Re: You asked mamu it's coming.
Post by: Visus on August 04, 2014, 07:55:29 PM
You could toss in a micro mini servo that rotates an analog pot.  I at first wanted a digi pot but no luck finding any.   
I have even stopped mounting exterior dialing pots on my mods.
They have some that are uber tiny too, smaller than a dime, hella accurate too. Ya stop it, it stops.
That would be kinda cool put a 12-24 turn on it and hear the servo  spin them up  awesome..lol

Now thinking I might do this in future lol..  :thumbsup:
Title: Re: You asked mamu it's coming.
Post by: karadorde on August 04, 2014, 07:59:38 PM
Craig, I see what you are saying. Looking at it now, that digipot schematic doesn't make much sense for this application. Even if I had that pot with the correct ratings, why wire it up like that and use the buttons only to adjust the pot.

Personally, I have no problems adding additional wiring/hardware and code. I know it strays from Clav's original design, but adding a digipot/buttons does that already.  Now it is just a matter of finding the right potentiometer and figuring out how to wire it in properly. I do believe another use with the same type project is using this: http://parts.arrow.com/item/detail/analog-devices/ad8403arz1#gnyF I am just not sure how he has it wired. Other forums aren't quite as generous as the crowd here.

Visus, that's an idea. Sounds like something out of a Rube Goldberg box mod, ha! Not something I'd want to venture in to but I'd be anxious to see what you come up with.
Title: Re: You asked mamu it's coming.
Post by: werkkrew on August 05, 2014, 09:25:54 AM
I'd like a digital pot which can be adjusted using a knob with 360 degrees of rotation (not an analog pot).  I know DNA boards support either buttons or knobs, I am also partial to knobs.
Title: Re: You asked mamu it's coming.
Post by: CraigHB on August 05, 2014, 04:41:39 PM
Problem with mechanical pots is they wear out and get jumpy.  A rotary encoder would be the best option there.  I have a DC power supply that uses a rotary encoder to set output voltage.  I really love that dial control and it will never wear out.

I've had to dispose of DC power supplies before because the pots in them wear out and get too jumpy to use anymore.  I've tried to clean them at times, but it's only a short-term fix.  Doesn't take long for the pots to get jumpy again.  In any case, those cheap DC power supplies with the mechanical pots are something to avoid.
Title: Re: You asked mamu it's coming.
Post by: karadorde on August 06, 2014, 11:10:07 AM
I think the closest you can get is 1k or maybe 500 Ohms, which is fine if the pot has enough taps. 

Craig, can you elaborate on that a bit? Please and thank you.
Title: Re: You asked mamu it's coming.
Post by: karadorde on August 06, 2014, 05:21:13 PM
Ah, I see what you're saying now. I did the math for each step on a 1k ohm - 256 step digipot and once you get past 60 watts, it starts to get jumpy. I couldn't find much in the way of higher step count or lower ohm rating. Hmm...

(http://i.imgur.com/iNOLy2s.png)


I did find this (http://www.analog.com/static/imported-files/application_notes/AN-582.pdf) which talks about wiring several digipots together in parallel to achieve a desired output that is not available with a single pot. I need to do some more research on this before I can fully understand how it is done unless someone can provide some insight.

Edit:
Additionally, after speaking with someone, adding a 1k resistor in parallel with the pot's wiper and ground gives us a much better solution. We can get much closer to the values we want using that. It isn't perfect but it is pretty darn close.
Title: Re: You asked mamu it's coming.
Post by: CraigHB on August 06, 2014, 07:10:39 PM
Sounds like you have a handle on it, yeah, more taps means less difference in resistance as the you increment or decrement the resistance value.  In other words you get better resolution. 

Resolution also depends on the overall value of the pot.  For example, a 50k pot with 1024 taps has about 50 Ohms per step.  A 10k Pot with 256 taps has about 40 Ohms per step.  In this case resolution is similar, but range is greater for the 50k pot.

One trick to get high resolution over a wide range is to run series digital pots.  For example, with a 1k pot that has 256 taps, you have about 4 Ohms per step.  If you put that in series with a 50k, 64 tap pot, you have a resolution of 4 ohms per step over a range of 50k.  That's like a 50k pot with 12k taps.  However, you can't do that with a low overall range in value since digital pots are only available in a small selection of range.  To some extent, the range of the first pot has to fit inside one step of the second pot.

Trying to run parallel digital pots results in non-linearity issues.  You cut range half and you only improve resolution in the middle of the range.  You're going to lose resolution at either end of the range.  Plus it's going to be a big headache to code output levels based on two tables with a parallel relationship.  I would avoid doing that myself.
Title: Re: You asked mamu it's coming.
Post by: karadorde on August 06, 2014, 11:51:18 PM
Sounds like you have a handle on it, yeah, more taps means less difference in resistance as the you increment or decrement the resistance value.  In other words you get better resolution. 

 :thumbsup:

Well, that small victory feels really good, haha.

So that solves that problem, for the most part.

I wasn't sure how I would go about the paralleling of digipots. I just know another modder managed to parallel a quad pot and make it work. I was just afraid that was the only way to do it. I am glad I was able to learn something and heed your advice and figure this out. Many thanks for the direction and education, Craig!!

So, all things considered, using Clav's diagram and dropping in that digipot with the right connections to the Arduino, I don't think I am too far off from at least a V1 of his design but with the Raptor. Woohoo!

Speaking of Claviger. I know he was tearing down his PC for a little late spring cleaning. Hopefully he got it back together alright. Could really use his input on this, considering I am bastardizing his work, ha.
Title: Re: You asked mamu it's coming.
Post by: karadorde on August 08, 2014, 10:44:13 AM
Hmm, coming up short due to my lack of knowledge in regard to the Arduino/ATMEGA32U4. I have seen a couple of ways to wire digipots, just not sure which is the best. One way would go through the SCLK, MISO, MOSI pins, but those are taken by the OLED. I could grab an I2C OLED screen and wire it through the I2C pins (SDA/SCL)but the SDA is taken by the PFET and fire switch. I need to figure out what the limitations of the board are I guess. If I can possibly reprogram/repurpose certain pins or some other method. Or find out if there is a specific reason Clav is using that SDA pin in the PFET scheme.
Title: Re: You asked mamu it's coming.
Post by: CraigHB on August 08, 2014, 06:07:18 PM
There's two main serial bus types used to interface an MCU with a peripheral IC.  I2C and SPI are the ones commonly provided as an interface on general purpose ICs.

I2C is better suited for running mulitple devices on a single bus.  SPI is better for one or two devices on a bus.  SPI is slower and requires more pins for two way comms.  However, SPI is more robust since it uses low impedance lines and lower frequencies.  In other words it's more immune to noise and connection quality.

SPI only requires a clock and data line for one way comms so overhead is pretty much the same in that case.  Two way comms are typically not required for a display or digital pot in our application.

You can use either bus type so it really comes down to which is more convenient for your particular design.  The parts you will want to interface with your MCU generally don't support both bus types so that usually makes the decision for you.
Title: Re: You asked mamu it's coming.
Post by: karadorde on August 12, 2014, 04:19:29 PM
Craig, you spoke about non linearity issues and some other stuff when using pots in parallel. I kept researching and found out what you meant. If you take four 1000 ohm 8 bit digital potentiometers and wire them in parallel, it gives you 4,294,967,296 different combinations of steps. So I decided to do the math for that.

Taking a 1000 ohm 8 bit quad digital potentiometer, wired in parallel, and used in a rheostat configuration. I figured out every unique possibility of resistance based on the step each pot was on along with some other things like wiper resistance. I know there are other things to think about like variations in wiper resistance or accuracy of the potentiometer itself, but with the bare calculations, I've come up with a fairly accurate way of finding just the right steps to assign each of the four pots in order to achieve a certain voltage/wattage.

My database is still building as we speak (go figure! evidently it takes time to do four trillion calculations) but it is returning results already. Right now I have http://goatweb1.tinyw.in/test.php returning values for a certain wattage range on a .30 ohm coil. I have to do some testing and more math before I can put this into practice, but I think I might be on the right track. If not, it was a fun little project.
Title: Re: You asked mamu it's coming.
Post by: CraigHB on August 12, 2014, 04:59:19 PM
That sounds like some rather complicated math.  I wouldn't do it myself, but that's interesting you did the formulation.  A good routine can make it usable I suppose.  But yes you end up with 32 bits you have to deal with which is a lot.  You can run into issues with sluggish response if using a closed loop system to regulate voltage.  I'm running into that possibility with 10 bits (1k steps), let alone 32 bits (4G steps).
Title: Re: You asked mamu it's coming.
Post by: karadorde on August 12, 2014, 05:05:38 PM
The calculations alone are ridiculous. But, once I run these, I have them and never have to run it again unless it is for a different size pot. My best guess, depending on the storage I'll have onboard the MCU, is to generate all the info beforehand for each resistance of an atomizer (I am thinking .30 to 1.5 ohms. I could always expand that later). So I'd have an array of steps for all possible wattages for all possible coils. That way I could check my atomizer resistance, and then just grab the corresponding array for said resistance.
Title: Re: You asked mamu it's coming.
Post by: CraigHB on August 12, 2014, 07:11:11 PM
Hopefully you have a routine already in mind for that.  I imagine the formula is looks rather ugly with 4 resistors in parallel.  Don't know if you could use a table with that, not enough program memory available with a typical MCU.  How would you even program a 4 dimensional table anyway, I don't have a clue.  Well I guess someone did it already so it's possible, goes beyond my programming ability though.
Title: Re: You asked mamu it's coming.
Post by: karadorde on August 13, 2014, 05:23:06 PM
Depending on how I could set up the data structures, it might not be too ugly. The hardest part would be culling out the data for each setting available to the user. I'd have to do more research that will come a little later in the game.

I may also simplify it and find the correct keys for stepping up an ohm of resistance at a time. And just use that as my range for what to fire the atomizer at. That gives me 250 steps of adjustment. Something like this: http://thirdshift.co/oneOhmIncrements.php It would be a lot easier to use that rather than an individual dataset for every possible resistance in a given range.
Title: Re: You asked mamu it's coming.
Post by: karadorde on August 18, 2014, 11:50:58 PM
And so it begins.

(http://i.imgur.com/sTyOvTy.jpg)

I think I've got just about everything worked out (for the most part.) Digikey, Adafruit, and amazon orders should all be here by Thursday. I hope to have everything bread boarded by this weekend. After that I will report back with pics, schematics, and some code. Hopefully. ^_^
Title: Re: You asked mamu it's coming.
Post by: slaw_dawg on August 19, 2014, 09:33:00 AM
I joined this board and am closely following the progress in this thread. I really hope to make a 120W raptor box mod with all the features of a DNA 30 chip. Thank you everybody involved for your work!
I am an automation engineer, so I may be able to contribute some to this work once I get all the parts in the mail and start tinkering around!

 ;cheers;

Edit to correct spelling
Title: Re: You asked mamu it's coming.
Post by: hanukun on August 23, 2014, 06:17:00 AM
what about adding a color screen to add a custom picture on load up or would it be to much recoding in arduino http://www.adafruit.com/products/684 (http://www.adafruit.com/products/684)
Title: Re: You asked mamu it's coming.
Post by: CraigHB on August 23, 2014, 06:46:00 PM
Probably not too much.  Though display drivers are not generic, you have to write code for each type of display based on its controller anyway.  It probably would not be too much additional coding for a color display over a monochrome one.  You just have some added bits for color definition.
Title: Re: You asked mamu it's coming.
Post by: karadorde on August 23, 2014, 06:47:42 PM
The Arduino libraries are actually really well developed and easy to use. I don't see it being too difficult to get a color screen running, I have seen them on projects like this elsewhere. I, myself, don't see the point. I am using a 128X32 monochrome OLED for my project (got it wired today) and I think it works really well.

EDIT: Also have the AD8400 (just going with one pot for now) and the current sensor wired up. Between hand soldering SOIC 8 boards and building that box mod today, my nerves/hands are fried. Time for some light datasheet/code reading before bed. Going to try to get it all up and running tomorrow.
Title: Re: You asked mamu it's coming.
Post by: karadorde on August 25, 2014, 11:53:18 AM
Just a quick update. I got most everything breadboarded over the weekend along with redoing the Raptor bread board connections (yeesh that was hideous.) Right now I have it up and running with the very basic bare bones.

I am rewriting everything rather than using Claviger's code, mainly because I don't know enough about the ClickButton library and because the OKR board uses negative logic whereas the Raptor uses positive.

I am also using an I2C display so that I can free up the SPI pins on the board to use with a digital potentiometer.

Next steps are going to be building a couple of voltage divider circuits so I can measure battery voltage and output voltage of the board. Claviger was using the raw input pin on the Pro Micro to measure voltages. This is a great way to check unregulated voltage but it won't be a viable option in the long run when I go to make a custom PCB.

After that it will be connecting the current sensor and digital potentiometer and the corresponding code for each of those.

Here's hoping I can pick up where Clav left off.
Title: Re: You asked mamu it's coming.
Post by: geothee on August 25, 2014, 12:04:53 PM
Sounds interesting. Will be watching  :popcorn:
Title: Re: You asked mamu it's coming.
Post by: slaw_dawg on August 25, 2014, 01:16:13 PM
Karadorde,

I am very anxiously awaiting your notes and progress. Thank you for your work on this. Your rockin bro :rockin smiley:

I have my 20A raptor board and box, just waiting on some notes and code so I can make myself 20a raptor box mod like no other!

If theres anything I can do to add to this or help please let me know.
Title: Re: You asked mamu it's coming.
Post by: karadorde on August 25, 2014, 03:55:42 PM
Karadorde,

I am very anxiously awaiting your notes and progress. Thank you for your work on this. Your rockin bro :rockin smiley:

I have my 20A raptor board and box, just waiting on some notes and code so I can make myself 20a raptor box mod like no other!

If theres anything I can do to add to this or help please let me know.

Good to hear!! And thanks!! Once I have a little bit more done, I will put out a schematic and some code. Hopefully by this weekend I will have a lot of the features up and running. The work that Clav has done is making this a whole lot easier for me on the Raptor end.


On another note, is there any reliable way to calculate proper resistor values for use in a resistive voltage divider circuit? I've found the math needed to get values that will provide a safe output voltage to the Arduino based on a max input voltage from the board/battery bank, but I want to get values for my resistors that offer the greatest range in order to measure my voltages more accurately. Short of testing the math on rather arbitrary values for resistors, I am coming up short. Any help would be appreciated.
Title: Re: You asked mamu it's coming.
Post by: CraigHB on August 25, 2014, 04:38:44 PM
You have the range of the atomizer value then the other value that follows from the math.  The constraint is the power consumption of the circuit.  If you use a lower value you'll get higher currents and more power consumption, but better resolution.  If you use a higher value you'll get less power consumption, but less resolution.  Like most things with electronics design, you have to arrive at a reasonable trade-off for either.

One of the tricky things with measuring something using a divider is the small voltage levels you have to measure.  There's a couple ways to handle that.  You can use a low voltage reference with your ADC, but then you can run into the limitations of your MCU.  Or, you can linearly amplify the voltage level to allow the use or a higher ADC reference, possibly even the MCU's supply voltage if you use an LDO (low drop-out linear regulator) with high accuracy.

In any case, whether you use a lower voltage reference or amplify the signal, there are noise considerations.  When you amplify a signal, you also amplify the noise.   It's better to use lower gain or a higher reference, but then you can have issues with power consumption.  You will need some kind of filter on the ADC input to the MCU however you do things.  Not a big deal, just a cap and resistor.

I don't think anyone can say, "use such and such a value whatever the case."  It depends on how you want to do things, the range of resistance you want to cover, and how much power consumption you're willing to accept.


Title: Re: You asked mamu it's coming.
Post by: jimmothy86 on August 29, 2014, 01:01:06 PM
Trying to put together a raptor build based on mamu's diagram, still need two things, preferably from digikey, I need the reverse polarity led and the voltmeter any recommendations?
Title: Re: You asked mamu it's coming.
Post by: karadorde on August 29, 2014, 01:05:06 PM
Trying to put together a raptor build based on mamu's diagram, still need two things, preferably from digikey, I need the reverse polarity led and the voltmeter any recommendations?

I don't think you'll find the volt meter on digikey and the LED doesn't have to be any special kind.
Title: Re: You asked mamu it's coming.
Post by: bob salter on September 01, 2014, 06:52:48 AM
Any recommendations for the fet? I just placed an order with mouser and dont want to get hit with massive postage for a couple of fets. How about bf245c and 2n3820 on ebay uk. Cheap as chips and free postage.

Bob
Title: Re: You asked mamu it's coming.
Post by: bob salter on September 04, 2014, 01:21:20 PM

@karadorde  Did you get any further with this? Can I use the same code for the raptor as the okl? If not I have some okl2 20s but they are positive logic. Would that involve a change in code? Just waiting for the screen, I found some fets on ebay so would be good to start this at the weekend.

Bob
Title: Re: You asked mamu it's coming.
Post by: karadorde on September 04, 2014, 01:26:51 PM
The code that Claviger provided is written for a board with negative logic. The Raptor is a positive logic device so the code doesn't have to be completely rewritten, but it has to be changed as well as some of the wiring. It is not terribly difficult. I will work on getting some info up so. I stopped active development on this for a bit and have been doing A LOT of research on somethings. I changed a lot of my initial plans around to make everything as efficient and accurate as possible.
Title: Re: You asked mamu it's coming.
Post by: bob salter on September 04, 2014, 03:14:59 PM
I assume then I need to invert all digitalwrite(powerconvertor )  code for positive logic? I think this is going to be GREAT fun. I THINK I follow all the code OK otherwise but will report back once its running.

Bob
Title: Re: You asked mamu it's coming.
Post by: ShadowBlade on September 13, 2014, 01:23:27 PM
Hey everyone, new guy here. I found a 100 ohm Digital Pot; can we use this? I know its not 200 ohm, but its a lot better than 1kohm or 500ohm.

http://www.mouser.com/ProductDetail/Intersil/X9C103SIZ/?qs=dAsayXGOMrtxfD7JtBRmDA%3d%3d

data sheet: http://www.mouser.com/ds/2/465/fn8222-86825.pdf

I want to use an arduino to control my raptor chips; i like the re-done schematic (claviger's with the raptor instead) anyone tested the code (from page 1) with this?

Any luck on turning this all into one PCB with oled and everything (like a vape shield?)

thanks!
Title: Re: You asked mamu it's coming.
Post by: karadorde on September 13, 2014, 01:36:49 PM
That's a 10k ohm potentiometer with 99 resistive elements. The description is kind of wonky but the data sheet clarifies it: X9C103 = 10k. They offer a 1k version, but it is a poorer choice than something like the 1k AD8400 which offers 256 resistive elements since it is an 8 bit digipot.


Don't pay attention to the raptor schematic. It is very basic and it won't work with claviger's code. I need to pull it down and upload an accurate one.
Title: Re: You asked mamu it's coming.
Post by: karadorde on September 16, 2014, 05:00:07 PM
This is kind of where I am at right now.

Some important things to note about this schematic:

Other things to point out:
- The AD8403 is the digital potentiometer.
- The TPS63060 is the power supply for everything (minus the raptor obviously).
- The INA225 is the current sensor.
- There are no values for the resistors in the voltage dividers. I haven't sat down to do the math yet.
- The LM4040 is an external voltage reference, because I don't like using the internal reference on the Arduino.
- It is currently laid out for an Arduino Micro board. Later I will revise it to be wired straight to an ATMEGA32U4 or perhaps a different mcu.

I am waiting on PCBs from Oshpark right now. After that I will revise and post my code. At that time I should have the programming done for reading the raptor output voltage, the overall battery voltage, each cell's voltage, as well as the amperage output and the coil resistance.

(https://i.imgur.com/r94l6bd.png)
Title: Re: You asked mamu it's coming.
Post by: miskol on September 25, 2014, 08:33:15 AM
building electronics and OLED especially, is very very fortunate for Arduino users... there' a lot of OLED library that can be used just like that... i have been working for weeks now to port AVR / Arduino libraries for use with PIC and unfortunately its not going very well haha...

unfortunately also there's this one guy who shared his OLED library for use with 128x64 I2C OLED... i'm using 128x32 SPI OLED and i edited some parts of his library, it is not working well but it is from his work that i got to display text on the OLED for the first time hehe.

still hoping some other forumers to reply on different other forums regarding OLED library for PIC.
Title: Re: You asked mamu it's coming.
Post by: ShadowBlade on September 25, 2014, 02:09:07 PM
wow karadorde thats a lot of work! Thanks for sharing. Looking forward to your finished version!
Title: Re: You asked mamu it's coming.
Post by: karadorde on September 25, 2014, 02:11:20 PM
PCBs to test the Current Sensor and the External Voltage Reference arrive today. I screwed up and didn't order a SMD resistor for the VREF board so I have to wait for Digikey to send me some goodies. Hopefully I can have some code up by next week :-).
Title: Re: You asked mamu it's coming.
Post by: norcalreballer on September 29, 2014, 06:46:22 PM
Hi, I just joined up.  Designing my on MCU mod using teensy 3.1.  I'm also using an lm4040(2.5v though). Teensy 3.1 has a 470ohm resistor from aref to agrnd, so I soldered the little sot23 right to the bottom of the board on the aref pin to agrnd.  I'm learning as well..  Works perfect, right now, though. Anyways, I see people are using current sensors and I'm not sure about Claviger's way of reading resistance.  I'm using an lt3092 constant current source set at 10ma and going to use analogReadDifferential to read the voltage across the atty.  This way we can read resistance before firing and hopefully within 1% accuracy after calibration. 

I haven't seen anyone talk about it on here(new here), but there are around 20a regulators with 5.5v or so max output that can be controlled via i2c/PMBUS.  Someone linked me to one a week or so ago.  I still think pulsing a mosfet may be better, as your only limits are the limits on your batteries. :)  I'll be following this post and posting up when I have more progress.

Title: Re: You asked mamu it's coming.
Post by: karadorde on September 29, 2014, 07:58:24 PM
The GE DLynx can be controlled with PMBus and I have seen some projects using it. I am working on some ideas that incorporate an MCU with a new Murata chip that is coming to market. I will share as I have more details.

The constant current set up works and works pretty well. However, there are some issues with it that I didn't really care for. For my project, I think the in line current sensor is a better and safer alternative. I can go into more detail on this if you'd like.

Claviger is not reading resistance. He was setting the resistance of the coil in his actual source code. 

Are you talking about pulsing a mosfet to send power to the coil without the use of a power converter like the OKL2 or the Raptor?
Title: Re: You asked mamu it's coming.
Post by: norcalreballer on September 29, 2014, 08:02:59 PM
Hi, thanks for the quick reply.  What is the problem with 4 wire resistance measurement?  I'm just learning, so some insight is greatly appreciated.  Yes, I'm talking about controlling the power to the coil(s) using PWM via digital pin. 
Title: Re: You asked mamu it's coming.
Post by: scripto23 on October 06, 2014, 07:16:49 PM
The GE DLynx can be controlled with PMBus and I have seen some projects using it. I am working on some ideas that incorporate an MCU with a new Murata chip that is coming to market.

Do you happen to know a part number for the new Murata chip you are referring to?
Title: Re: You asked mamu it's coming.
Post by: miskol on October 14, 2014, 04:50:12 PM
hi guys,

i tried to build my own Booster circuit, but the converter part is not working, burnt MOSFETs everywhere lol.

so i connected an OKR T/10 to my board for the moment :)

(https://dl.dropboxusercontent.com/u/52287186/Forum/OLEDokr1.jpg)

every info on the OLED is real-time, battery level, OKR output, ohm checker, Watt estimation.

but there's some problem with the OKR output read and current measurement. apparently when the RL (coil resistance) is changed, the ADC reading for the OKR output and current measurement would be different and out of range, when software-adjusted, it will work nicely (by varying the OKR output) as long as the same RL is used and not changed to different ohm.

(https://dl.dropboxusercontent.com/u/52287186/Forum/OLEDokr2.jpg)

from the circuit shown, voltage divider of two 3.3k resistors are used to divide half the max 6V OKR output for ADC reading (max 3.3V). its a simple process for ADC reading isnt it?

so my question is,
1) does the changes of RL effect Vfb?

2) should it be better for the R2 voltage divider is changed to connect between R1 & RL?


hope others could help, thank you.
Title: Re: You asked mamu it's coming.
Post by: CraigHB on October 15, 2014, 03:23:11 PM
There's something else going on there.  The voltage Vfb will always be 1/2 the voltage applied across R2 an R3 regardless of the R1 and RL values. 

In any case, that's how you would typically measure a voltage higher than the ADC reference.  You should add a 100nF filter capacitor across R3 or the readings will jump around a lot.  You can alternately filter readings in software, but I always use a hardware filter as it's a simple thing to do with a voltage divider (and one is often required).

There's lots of things that can cause issues when taking ADC measurements.  For example, if you're trying to measure a voltage higher then the ADC reference, your readings will get clipped by the ADC reference.  Then there's the reference itself.  If you are using supply voltage as your reference, ADC accuracy is dependent on the supply.  If supply voltage dips, then so will ADC readings.  Then there's issues you can run into with sample and hold timings.  If those are not ideal, you can get pretty wild swings in readings due to external conditions.

BTW, what controller were you using to build a boost converter.  Usually with converters getting them to work at some level is not a big problem, getting them unconditionally stable is where things get tricky.
Title: Re: You asked mamu it's coming.
Post by: miskol on October 15, 2014, 11:34:40 PM
noted with thanks Craig, will try to add cap, the ADC does fluctuates like crazeh!

however for the problems that i'm having, i dont think it relates with ADC reference since the problem only occurs for reading ADC value of 510 output where i have to re-adjust by software to get the value within OKR voltage range whenever RL resistance is changed. reading ADC value of the battery level is not affected (from what i remembered, will have to confirm back).

it seems that the current circuit looks like a Wheatstone bridge?

if the circuit is modified into below circuitry would it solve the problem?
(https://dl.dropboxusercontent.com/u/52287186/Forum/OLEDokr3.jpg)

video:
http://youtu.be/GPV-AmsKNJo

i'm using the old school way Craig, using a gate driver to control two MOSFETs.
(https://dl.dropboxusercontent.com/u/52287186/Forum/Boost%20Topology.jpg)
Title: Re: You asked mamu it's coming.
Post by: CraigHB on October 16, 2014, 01:09:04 AM
You know what, I'm not fully understanding your circuit configuration, I think I misread the first drawing.  Regardless, if you want to measure voltage at the atomizer then that's where you should put the tap for your ADC's voltage divider.  The above drawing shows that to be the case. 

If I'm understanding the previous drawing correctly, it shows an additional resistance R1 inline with the atomizer.  In that drawing you are not measuring voltage at the atomizer.  You're measuring atomizer plus R1.  There would be an error with respect to atomizer voltage introduced by the voltage drop at R1.

Putting a cap on the ADC's divider serves a two fold purpose (across R3 in your diagram).  Firstly, it filters the ADC input to keep it stable.  It also provides a low impedance source for the ADC.  The way ADC's work is they charge a small capacitor when they take a sample, usually around 5pF.  That being the case, they are sensitive to hold times defined by ADC software configuration and the impedance of the source under measurement.  A filter capacitor provides the energy to charge the ADC's capacitor quickly reducing error and sensitivity to hold times.  To get the most benefit a low ESR cap should be used, ideally an MLCC cap, those have the lowest ESR.

It can be helpful for accuracy to use a precision voltage reference some amount lower than supply voltage.  Linear regulators are typically not that accurate, they can vary a few percent over changes in load.  If using supply voltage as a reference, readings can also vary over load.  Voltage references are designed specifically for use with an ADC and will eliminate that issue.  Here's an example;  http://www.ti.com/product/lm4040-n


Title: Re: You asked mamu it's coming.
Post by: CraigHB on October 16, 2014, 01:59:36 AM
I'm going with a separate post on the converter stuff.  This is going to be long and I want avoid making one giant reply that obscures the main topic.

You can use a stand-alone MOSFET driver in designing a converter and it's not particularly old school.  There's some benefit in using a separate driver.  Converter controllers with built-in drivers are limited in how much gate charge they can drive.  In some cases, specifically for high power stuff, you need to drive low resistance MOSFETs that have a relatively large gate charge.  This means you need a more powerful driver. 

Most converter controllers with built-in drivers are limited to MOSFETs with a gate charge under 20nC @4.5V (assuming a typical PWM frequency around 500kHz).  That's fine for lower power stuff, but when you get into higher power outputs, you need MOSFETs with lower on-state resistance.  That translates to higher gate charge.  There's a dependence between those.  Lower on-state resistance calls for larger gate junctions which have more capacitance. 

You can find powerful MOSFET drivers specifically designed for switching converters.  They can drive MOSFETs at high speed with gate charges as high as 100nC @4.5V.  However, there is a trade-off there.  Power consumption in driving a switch is gate charge times frequency times voltage so you can see where that goes.  With high gate charges and low power outputs, you can consume as much power driving the switches as the load.

Once you have your MOSFET driver you still need to control it.  You can do it with an analog controller or digitally with a DSP (high speed MCU).  Some MOSFET drivers have built in shoot-through protection which is a critical aspect of design.  I think this may be where you were having issues. 

Shoot through occurs with a timing issue that results in both MOSFETs conducting at the same time.  Adaptive shoot-through protection is best since it minimizes the resulting dead time.  This is the amount of time both switches are off and there's a big efficiency hit that occurs when there is too much.

If your driver does not have shoot-through protection, then the controller must have it.  Either too much dead-time or not enough can cause issues.  Not enough dead time causes excessive shoot-through which can overheat MOSFETs to the point of failure.  Too much dead time can kill efficiency.

You can use a DSP like the Texas Instruments C2000 series to provide the PWM signal and control for your converter, but you must take care to handle dead time properly in code if you go that route using a driver without shoot-through protection.  You should also program cycle by cycle current limiting.  That can be done by sensing voltage drop accross the low side MOSFET when in full conduction.  Again this is required to protect the MOSFETs and keep them from overheating.


Title: Re: You asked mamu it's coming.
Post by: miskol on October 21, 2014, 02:51:39 PM
thank you very much for your explanation, very insightful with lots of new information for me.

will take time for me to understand all of it.

but some did makes sense hehe, which is the part regarding the driver's shoot-through protection because there is a design problem on the PCB that makes the driver unstable. will further research on your comments. the driver and mosfets worked on my previous design that uses Buck topology, but with my latest design i used a different and smaller mosfets and also changed the circuit for Boost topology. will design a new PCB to repair the current driver problems and revert back to using the previous working mosfet, this should better clarify where the problems are.

again tq very much Craig and very sorry especially to Claviger and karadorde since some discussions has swayed from the main topic haha, sorry guys.


will continue the development regarding the ADC's voltage divider. i've repaired the connection and followed the latest circuit configuration, unfortunately the problem is still the same but at least by checking with DMM, Vfb relates closely with theory (where the voltage Vfb will always be 1/2 the voltage applied across R2 an R3). so most probably the problem is on software. i'm sure there's no problem with the ADC reading part, supposedly, since there's no problem on reading the battery level. maybe some ports aren't configured properly or some functions of the pin are not disabled.

Title: Re: You asked mamu it's coming.
Post by: CraigHB on October 21, 2014, 07:17:09 PM
Configuring ADCs can be a bit of a headache sometimes.  You can get error if the timings are too tight.  I usually start them liberally, then tighten them up to where they start having problems to get an idea what the available range is.  There's external factors like source impedance that can have an effect on the limits of ADC timing.  However, using two 3.3K resistors in your divider is plenty low enough.  That shouldn't be a problem.

To make sure it's not an ADC timing issue, decrease the sample rate and increase the hold time liberally just to check it.

Another thing that can give you trouble is excessive noise in the power supply.  You should be isolating the ground planes for your digital and power circuits.  You should also run a 1uF MLCC cap as close as possible to each of the power and ground pin pairs for your MCU, especially the analog power pins if they are separate for the MCU you are using.
Title: Re: You asked mamu it's coming.
Post by: norcalreballer on October 26, 2014, 02:28:41 PM
I had my first go at creating a schematic.  Please let me know if you see anything that isn't correct.  There has to be something, as I killed a teensy when I powered it via the LM317 configured like this...  I tried to create a pic, but you can't see anything.. Used designspark to create the schematic.

lt3092 - constant currect source.  Decided to use kelvin measurement for resistance of atty
MIC4420 - Mosfet driver
LM4040  Voltage reference



https://www.mediafire.com/?xur31ozm2rizqi8
Title: Re: You asked mamu it's coming.
Post by: miskol on November 04, 2014, 01:33:34 PM
thanks for the suggestions Craig, i've tested both, its not timing issue.

Another thing that can give you trouble is excessive noise in the power supply.  You should be isolating the ground planes for your digital and power circuits.  You should also run a 1uF MLCC cap as close as possible to each of the power and ground pin pairs for your MCU, especially the analog power pins if they are separate for the MCU you are using.

it might be the isolation problem, although i'm not absolutely sure about it because it could be that maybe my Booster's PIC ADC pin is damaged somehow, maybe lol. but still, i believe isolation is really the problem. i used a different external PIC to read the ADC from the OKR output and also to read ADC from the current sensor, my setup is as below image.

(https://dl.dropboxusercontent.com/u/52287186/Forum/mC%20OKRT10%20test%20setup.jpg)

so by using external PIC, the ground planes are isolated. only a single cable is connecting the external PIC's ground to the Booster's ground (joined on the proto board).

the results:
OKR setup, 220 ohm fixed resistor and a 200 ohm trimmer potentiometer. The approximate output range is 3.4v to 6v

0.5ohm(5% tolerance) load  test
top pic: pot set to min, Vout = 2.83V under load; Iout = 4.86Amp; Rload = 0.58ohm
bot pic: pot set so that approx. Vout = 4V under load; Iout = 5.97Amp; Rload = 0.67ohm
(https://dl.dropboxusercontent.com/u/52287186/Forum/mC%20OKRT10%200-5ohm%20test.jpg)

1ohm(X% tolerance) load  test
top pic: pot set to min, Vout = 2.99V under load; Iout = 3.33Amp; Rload = 0.89ohm
bot pic: pot set so max Vout = 5.63V under load; Iout = 5.45Amp; Rload = 1.03ohm
(https://dl.dropboxusercontent.com/u/52287186/Forum/mC%20OKRT10%201ohm%20test.jpg)

so as can be seen, i have accuracy issues with the detected load resistance. might be better to compare with load readout with DNA, to be continued hehe.

tested with DNA 30's ohm reading, for the 1ohm load test it reads 1.0ohm and for the 0.5ohm load test it reads 0.6ohm.
Title: Re: You asked mamu it's coming.
Post by: Bruno_B on November 11, 2014, 02:51:43 AM
I am also using an I2C display so that I can free up the SPI pins on the board to use with a digital potentiometer.

You don't have to free up SPI pins. All your SPI devices share the same MOSI, MISO, and SCK pins. Each device gets a discrete SS pin which you pull low to let that device know that it is the one you are speaking to. https://learn.sparkfun.com/tutorials/serial-peripheral-interface-spi/slave-select-ss You can have as many SPI devices on your Arduino as you have IO pins minus 3. (That 3 is for the MOSI, MISO, and SCK pins.) This is really important when you start using smaller AVR chips like I do here:
https://www.youtube.com/watch?v=c4k59CFpYCA
Title: Re: You asked mamu it's coming.
Post by: CraigHB on November 11, 2014, 06:26:05 PM
I2C is a better interface for running multiple peripheral devices.  First the bus is two way requiring only 2 pins and devices are addressed in software rather than hardware.  For example, to run 4 SPI devices you need 3 bus pins plus a CS pin for each device requiring a total of 7 pins, though you can multiplex the CS pins to get that down to 5 pins.  I2C can run four devices with only 2 pins. 

SPI does have some advantages, it's more robust and can be a lot faster.  Also, SPI has one way modes that require only two pins for the data bus.  One way SPI is often used by peripheral devices where they only receive and not send.  Genrally, SPI is better for one or two devices running high speeds where I2C is better for multiple devices running at lower speeds.
Title: Re: You asked mamu it's coming.
Post by: Bruno_B on November 11, 2014, 10:25:24 PM
@CraigHB, that is all true. I prefer I2C devices when I can find them. One nice thing about SPI is that it's pretty easy to analyze with a scope. If you have a peripheral that is a little wonkey in its implementation of SPI, It's easy to bit-bang the protocol with only the wikipedia article and an hour of not so focused time. (I did it while watching an episode of The Walking Dead.) In order to bit-bang I2C, you pretty much have to hate yourself or be working on a Thesis.

I love the way they state it in this article (http://www.byteparadigm.com/applications/introduction-to-i2c-and-spi-protocols/). "SPI is quite straightforward – it defines features any digital electronic engineer would think of if it were to quickly define a way to communicate between 2 digital devices." Yep, if I needed to quickly whip up a protocol for 2 devices, that's about how I'd do it. The rest of that article is worth reading too.
Title: Re: You asked mamu it's coming.
Post by: CraigHB on November 12, 2014, 11:18:20 AM
Yes SPI is very easy to work with and you can quite easily verify the data stream with a couple channels on a scope.  As I2C is not synchronous, it can be a bit tricky to analyse without a DSO having ample memory.  I like SPI a lot myself because it's so easy to work with, but it does have a lot more overhead.  I usually use SPI unless I have a need to run a number of devices and don't have the spare pins for it.
Title: Re: You asked mamu it's coming.
Post by: miskol on November 12, 2014, 11:48:35 AM
Another thing that can give you trouble is excessive noise in the power supply.  You should be isolating the ground planes for your digital and power circuits.  You should also run a 1uF MLCC cap as close as possible to each of the power and ground pin pairs for your MCU, especially the analog power pins if they are separate for the MCU you are using.

Finalizing the PCB design to solve the isolation of ground planes. Two different ground planes are isolated (Analog & Digital) which only inter-connects by a single 0 ohm resistor. This should solve the ADC issues right?

(https://dl.dropboxusercontent.com/u/52287186/Forum/mC%20OKRT10%20grounding.jpg)
Title: Re: You asked mamu it's coming.
Post by: CraigHB on November 12, 2014, 12:35:08 PM
The biggest source of noise comes from induction and voltage spikes due to changing currents acting on impedance.  Most generally, it's the parasitic impedance encountered by current flow that gives you trouble.  You minimize those effects by routing return currents from power circuits away from sensitive high impedance connections.

For the board you show, I can't tell for sure where the pickup is located for battery negative.  It should be in the area of the orange arrow you show as common ground.  You want to keep return currents for the power circuits from running through the digital plane.
Title: Re: You asked mamu it's coming.
Post by: DOUG36854 on November 14, 2014, 02:49:54 AM
Hopefully someone can help me on this. I plan to build a regulated box using a delta electronics chipset. Undecided on 200w/300w/400w as of yet. Regardless, it is a neg logic chip like the OKR so I should be able to swap it into this schematic and use the programming as written. However, I would like for the MCU to be able to read the resistance of the coil. It looks like the n-fet, pin A0, 5v from the MCU and the 100 ohm pot are being used as a voltage drop calculator to read the ohms of the coil (using the signal off of A8 to switch the nfet) but I don't see anything in the code to read this voltage on A0 and calculate the resistance. Did that portion of the code get removed for simplicity sake and the coil resistance is just being manually entered via code? If I am wrong regarding that portion of the schematic being a voltage drop for that purpose, is it possible to switch a mosfet from a signal off the MCU and have it read voltage on a pin to calculate resistance of the coil? Maybe I'm over looking it but I would really rather have the MCU calculate everything rather than have resistance set as a variable entered in the code.
Title: Re: You asked mamu it's coming.
Post by: CraigHB on November 14, 2014, 08:00:13 PM
I haven't looked at the code and hardware for this project in detail, but my understanding is it uses a voltage divider to determine atomizer resistance.

There's a couple ways to find atomizer resistance.  You can use a current sensor or you can use a voltage divider.  Either way is reasonable, but I prefer to use a current sensor since it provides real time current monitoring and the best accuracy.  However, using a divider can have advantages too. 

There should be a FET in the circuit that momentarily switches atomizer output through a voltage divider, though like I said I'm not intimately familiar with this project.  The code measures voltage at the output and voltage at a known resistance then calculates atomizer resistance based on the math of a regular voltage divider.  Once resistance and voltage are known, current and power are calculated from that.

When using a current sensor, you measure output current and output voltage then determine resistance and power from that.  In terms of the math and code, it's more simple to use a current sensor, but you can't measure resistance on demand.  The atomizer has to be normally powered.  Plus there's more hardware involved in a current sensor.  Still, the ability to monitor current on the fly is a big advantage in my opinion.
Title: Re: You asked mamu it's coming.
Post by: DOUG36854 on November 14, 2014, 08:08:49 PM
From a size standpoint,  won't a current sensor capable of up to 80A with accuracy into the .1st range be a little large to fit into a portable box mod?  Current shold be able to be real time concerning voltage changes (resistance changes should be small while firing and not need to be re-read unless the coil is changed). This project appears to already have a voltage divider planned I just can't find anything in the code for the MCU to switch the fet or read the voltage input from that circuit. Maybe the original poster/designer can chime in with some insight.
Title: Re: You asked mamu it's coming.
Post by: miskol on November 14, 2014, 08:28:26 PM
It looks like the n-fet, pin A0, 5v from the MCU and the 100 ohm pot are being used as a voltage drop calculator to read the ohms of the coil (using the signal off of A8 to switch the nfet) but I don't see anything in the code to read this voltage on A0 and calculate the resistance. Did that portion of the code get removed for simplicity sake and the coil resistance is just being manually entered via code?

Based on the code, the resistance of the Atty is first known and then its value is inserted in the R2 variable (float R2 = .90). karadorde have also verified this on post #94 that Claviger's work is not reading resistance.
Title: Re: You asked mamu it's coming.
Post by: CraigHB on November 14, 2014, 08:34:54 PM
The OP for this project has not signed on to the forum for several months now so you probably won't be able to get any advice from him in this thread.  Others have used this project as a starting point for their own and you might get some advice that way. 

In terms of current limitations, there's one that comes from the FET used to switch the divider in and out.  However, current sense resistors and current sensing chips typically have limits lower than high power FETs.  That's going to be a consideration. 

There is actually more physical size involved with a divider since the high power FET required to handle large currents would be larger than the sense resistor or sensing chip required for current sensing.  Plus, the lower the value of the reference resistor the better the accuracy and the size of resistors goes up quickly with power rating.

The part count can be lower for a divider, but then current sensing chips provide a single chip solution.  Current sense resistors require an amplifier using a number of parts unless you happen to be using an MCU with an available milli-Volt ADC.
Title: Re: You asked mamu it's coming.
Post by: miskol on November 14, 2014, 09:20:25 PM
The biggest source of noise comes from induction and voltage spikes due to changing currents acting on impedance.  Most generally, it's the parasitic impedance encountered by current flow that gives you trouble.  You minimize those effects by routing return currents from power circuits away from sensitive high impedance connections.

For the board you show, I can't tell for sure where the pickup is located for battery negative.  It should be in the area of the orange arrow you show as common ground.  You want to keep return currents for the power circuits from running through the digital plane.

(https://dl.dropboxusercontent.com/u/52287186/Forum/mC%20OKRT10%20grounding2.jpg)

Thanks Craig for the comment.

following up, hope this will help you advise if the PCB should be okay. shown is the battery negative contact (Black rectangle). basically top and bottom PCB plane is the same, there is no Analog grounding that runs through or under the Digital grounding or vice versa.
Title: Re: You asked mamu it's coming.
Post by: CraigHB on November 14, 2014, 10:19:50 PM
The digital plane is still not fully isolated since return currents for the digital circuits are going to be common with return currents for the power circuits.  Think of it as running two separate ground connections on two separate boards.  One plane should connect next to the the negative pickup and the other plane should connect next to the negative pickup with no other connections between the planes.  This is a two connection version of the "star topology" for ground connections typically recommended for minimizing noise in electrical circuits.
Title: Re: You asked mamu it's coming.
Post by: norcalreballer on November 15, 2014, 01:08:27 AM
DOUG36854  I just scored an ACS709 75a version, but haven't tested it yet.  It's on a little board.  Very small.  There's also other current sensors that can handle(supposed to, anyways)75a+.  I'm hoping to test it this weekend.  Unrelated, my idea of using 4 wire measurement worked with a multimeter, but it has problems... The voltage being read by the adc in this setup is way too low.  I read an InAmp is the way to go, but there's another problem.

I was using the differential input feature of the teensy 3.1 and didn't account for that circuit always being on.  Needless to say, the MCU smoked when the analog pin got 5v over the max it could handle.  One option would be a mosfet, which adds even more hardware.  So current source + InAmp + mosfet.  Even if it worked, that's too much stuff for me.  I was hoping to get resistance before firing, but doesn't matter. Seems like it's the best way is the current sensor. :)

I'm not understanding the get resistance with a voltage divider thing.  Could someone link me or explain that?  I'm guessing you'd need some actual high quality resistors?

EDIT:

I'm working on a little side project where I'm using a 3.3v pro mini(328p) with a 128x32 oled display.  I'm switching an NFET via digital pin that's switching a PFET to the atomizer.  PWM frequency is 480hz.  Reason for the PFET is because I can't read the average atomizer voltage at the 510 any other way.  If you know of one, please let me know.  I know an NPN transistor will work instead of the NFET, but I just used what I had.  That part is working great.

I mapped the analog input from a pot(going between a high digital pin and ground)from 3.3 to 5.5.  This is what I'm using for target voltage.  With no filter(software or hardware)I'm getting mostly reads of battery voltage.  I averaged the reads in software from 10-250 times, and it just jumps like crazy. 

I tried some different combos with resistors(in the voltage divider to read the atty avg voltage) and capacitors along with different amounts of averaging, but they seem to either jump too much or the cap takes too long to charge.  Any ideas here?  I'm using a 10k and 2.2k for the voltage divider now. 
Title: Re: You asked mamu it's coming.
Post by: CraigHB on November 16, 2014, 05:41:00 PM
I'm not understanding the get resistance with a voltage divider thing.  Could someone link me or explain that?  I'm guessing you'd need some actual high quality resistors?

With two resistors in series one known and one unknown, you can find the unknown resistance if you know the applied voltage and and voltage at the common point of the two resistors.  It's just a matter of some algebra with the the equation for a voltage divider.

By putting an NMOS on the return for the atomizer jumped with a resistor, you can switch the divider in and out by turning the MOSFET on and off.  You would run an ADC connection to both the high and low side of the atomizer.  You can alternately do it on the supply side using a PMOS, but an NMOS would be preferable.

You don't need a particularly high precision resistor.  A typical 1% resistor would be fine.  The one consideration is that the lower the value of the series resistor the better the resolution of the measurement, however, that also increases power demand and resistor size up goes up exponentially with power rating.  Though if you minimize the "on" time for the divider, you can use a typical 1/4 watt resistor without issue even for larger currents.

Quote
I know an NPN transistor will work instead of the NFET, but I just used what I had.  That part is working great.

Yes a bipolar junction transistor will "work" but one of the issues in using a BJT over a FET is they have a collector-emitter drop similar to a diode.  It's a lot less than a diode, typically around 200mV.  That's not much, but when you get into big currents, you can start getting into appreciable losses and excessive component heating. 

Also the CE drop varies depending on the BJT so that's something you have to check in the part's data sheet.  The reason MOSFETs were invented was to alleviate those issues encountered in using BJTs for switch applications, especially for high power stuff.
Title: Re: You asked mamu it's coming.
Post by: norcalreballer on November 16, 2014, 11:22:27 PM
Thanks for the info!  Last night I tried 10x lower value resistors. Ended up with 1k and 220ohm. My batteries don't last anyways. :)  I got it to read smoothly and quickly with a 220uf cap and only reading 3 times then averaging.  It's a very tiny bit jumpy, but not bad for only 3 lines of code for the MCU to try to get it to regulate the average voltage.   
Title: Re: You asked mamu it's coming.
Post by: miskol on November 17, 2014, 12:24:08 AM
The digital plane is still not fully isolated since return currents for the digital circuits are going to be common with return currents for the power circuits.  Think of it as running two separate ground connections on two separate boards.  One plane should connect next to the the negative pickup and the other plane should connect next to the negative pickup with no other connections between the planes.  This is a two connection version of the "star topology" for ground connections typically recommended for minimizing noise in electrical circuits.

(https://dl.dropboxusercontent.com/u/52287186/Forum/mC%20OKRT10%20grounding3.jpg)

okay Craig, i think i've understand it and got it now hehe. the digital ground now goes directly alone to the negative pickup.

hope you could advice on this revision, thanks :)
Title: Re: You asked mamu it's coming.
Post by: CraigHB on November 17, 2014, 10:56:36 AM
That's the idea, but you should do a copper fill on the whole board, unless you're trying to conserve copper.  Otherwise use a liberal width on that trace feeding the digital plane.  The fill would look something like this;
Title: Re: You asked mamu it's coming.
Post by: zotek on November 24, 2014, 01:03:19 AM
hi what kinda of Potentiometers are u using? thannks

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.

(http://i195.photobucket.com/albums/z226/tcclaviger/IMG_20140626_194230_zpscd4cff6f.jpg)

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:

(http://i195.photobucket.com/albums/z226/tcclaviger/IMG_20140626_194049_zps1e84e738.jpg)

https://www.youtube.com/watch?v=THTb6blhewM&feature=youtu.be
Title: Re: You asked mamu it's coming.
Post by: miskol on December 04, 2014, 12:03:58 AM
Update :)

That's the idea, but you should do a copper fill on the whole board, unless you're trying to conserve copper.  Otherwise use a liberal width on that trace feeding the digital plane.  The fill would look something like this;

yes thanks Craig, my board's final version is copper-filled.

(https://dl.dropboxusercontent.com/u/52287186/Forum/mC%20Buck%2010Amp.jpg)

it is working nicely :) again, thank you very much Craig!

will be playing with the programming now :)
Title: Re: You asked mamu it's coming.
Post by: Breaktru on December 04, 2014, 07:29:02 AM
Looking really great. Very professional   :thumbsup:
Title: Re: You asked mamu it's coming.
Post by: Visus on December 04, 2014, 08:36:34 PM
Badarse Miskol


That is awesome, so many modders want that board. 
Title: Re: You asked mamu it's coming.
Post by: sKyZ on December 31, 2014, 11:38:53 PM
Hello :)

I joined this forum just for this thread. I'm a huge nerd and love vaping. With the new chips coming up, new mods, and other such technology, I have been really interested in programming my own chip to do so and stumbled upon this thread.

I am looking to order the parts to get started and was wondering, after the 3 pages of discussion, what parts you guys suggest ordering and any other (updated) information you may want be able to share before I start this adventure.

Thank you!
Title: Re: You asked mamu it's coming.
Post by: cadcoke5 on January 03, 2015, 11:45:13 PM
I am interested in doing something like this, however, rather than collect the pieces myself, I would prefer to purchase either a full kit, or even an assembled version.

Do you plan on eventually offering a kit, or if not, is there any E-cig VW mod kit, that includes a programmable processor like the Arduino?

Thanks for any leads.
Title: Re: You asked mamu it's coming.
Post by: hill115side on January 06, 2015, 03:09:09 PM
Just want to leave this here...
Title: Re: You asked mamu it's coming.
Post by: hill115side on January 06, 2015, 03:12:10 PM
OKL2
Title: Re: You asked mamu it's coming.
Post by: Bruno_B on January 06, 2015, 05:28:52 PM
Looks promising! I'm just not a fan of stacking batteries. I don't need 100W. (I don't know why anyone does.) I have looked at the OKL2 http://www.digikey.com/product-search/en?vendor=0&keywords=okl2 but for the 2.4v input version which can run off of a single battery, it only has up to a 3.63v output. So in order to get the full 44w it is capable of, you have to use a 0.3ohm build. For the 73w version that's a 0.18ohm build. I know some RDA vapers get that low, but I think .5ohm is the basement for a lot of us.

I'd like to be able to drive an Aspire Atlantis, but at .5ohm that's just 26w when 35w is recommended.
Title: Re: You asked mamu it's coming.
Post by: atu on January 28, 2015, 12:07:07 PM
Hi guys, congrats for your work!!

I'm really interested in working on an Arduino controlled Raptor but my electronic skills are not as good as my development skills are.
I've already written a good part of the code but I'm still trying to figure out how to get an accurate current measurement (or an accurate ohm reading but from what I understand based on your posts, it seems that calculating it based on current measurement is more accurate) and how to control the raptor output (digital pot or other solutions ??).

If you have some clear explanations to give me including part numbers that would be awesome !

Thank you guys for sharing all this knowledge !!!
Title: Re: You asked mamu it's coming.
Post by: doobedoobedo on January 28, 2015, 01:20:45 PM
Hi guys, congrats for your work!!

I'm really interested in working on an Arduino controlled Raptor but my electronic skills are not as good as my development skills are.
I've already written a good part of the code but I'm still trying to figure out how to get an accurate current measurement (or an accurate ohm reading but from what I understand based on your posts, it seems that calculating it based on current measurement is more accurate) and how to control the raptor output (digital pot or other solutions ??).

If you have some clear explanations to give me including part numbers that would be awesome !

Thank you guys for sharing all this knowledge !!!
I'm using this current sensor http://uk.farnell.com/webapp/wcs/stores/servlet/ProductDisplay?catalogId=15001&langId=44&urlRequestType=Base&partNumber=1791413&storeId=10151 it requires an opamp to boost the output to give the 0-5V scale used by the arduino as it only outputs 28mV/A.

I'm using a dual 5k digipot wired in parallel to set the voltage http://uk.farnell.com/webapp/wcs/stores/servlet/ProductDisplay?catalogId=15001&langId=44&urlRequestType=Base&partNumber=1840762&storeId=10151 I use a lookup table to set each pot to give the overall resistance for the required voltage. I wrote a little program which generates the table declaration to give me 0.01V steps from 1V to 8V although I'm not sure yet how high I'll take the voltage when it's done.

Using a scale of 0-25A I have 0.024A resolution and a scale of 0-8.5V gives me a 0.008V resolution for the output which should translate to pretty accurate resistance measurements.
Title: Re: You asked mamu it's coming.
Post by: atu on January 29, 2015, 04:49:30 AM
Thank you very much for your feedback doobedoobedo !
I'll look into it tonight  :)

Good luck for you project !
Title: Re: You asked mamu it's coming.
Post by: mamu on February 25, 2015, 04:50:30 PM
Claviger - where are you?  Hope you're ok.

Here's something as a kind of drop in module for those of us illiterate Arduino programmers lol.  Shows batt charge level, volts, amps, ohms, and you can set high/low batt voltages.  Would be perfect if it showed watts too, but then that's easily calculated.

Got some coming in to tinker with to see how compatible it is with the Raptor 20A.

http://www.aliexpress.com/item/Lithium-Li-ion-battery-tester-LCD-meter-Voltage-Current-Capacity-18650-26650-Free-shipping/32266677192.html (http://www.aliexpress.com/item/Lithium-Li-ion-battery-tester-LCD-meter-Voltage-Current-Capacity-18650-26650-Free-shipping/32266677192.html)

(http://i01.i.aliimg.com/wsphoto/v0/32273477601_1/Digital-Lithium-Li-ion-battery-tester-LCD-meter-Voltage-Current-Capacity-18650-power-18350-26650-lithium.jpg)

Title: Re: You asked mamu it's coming.
Post by: Visus on February 25, 2015, 06:18:01 PM
Excellent find Mamu

Wonder what happen over 10A tho
waiting for your testing with a huge bag of  :popcorn:

Clavinger disappeared off every forum,  ya,  hope is he is ok..

If only the guy who did the raptor programming with temp control was as giving as you guys lol..
30A, ohms,  tc, on/off, etc etc  someone will post it eventually lol..

I haven't played around with it but it'll probably be me by 2020 lol...
Title: Re: You asked mamu it's coming.
Post by: mamu on February 25, 2015, 09:28:50 PM
Thanks Visus! 

But it's not my find - I saw a few posts about it on a FB modding group a while back.  ebay has it, but I bought mine directly from aliexpress.

From what I've read, there's a few modders that are testing it with an unreg MOSFET mod and seems to hold up ok with the higher amps - 30A I believe he said and so far aok.  Time will tell though.

Title: Re: You asked mamu it's coming.
Post by: Visus on February 26, 2015, 01:26:31 AM
Ya, it would be nice to know the data sheets on the chips on the board so it could be jumpered a bit so when you fire off the reg the bat v-meter doesn't get all discombobulated lol its gonna freak the frack out if tryin to measure the reg vout and compare against battery lol...  :laughing2:


Definitely a tell what the reg is requesting which is cool 2.. 


On a mech mod it would be fine..  Hope ya figure it out.   
Title: Re: You asked mamu it's coming.
Post by: mugenman1111 on May 17, 2015, 06:36:17 PM
I am reviving what seems to be a dead thread but I plan on making something either based off claviger's work or independantly sourced.

I was planning on putting everything on Github or Bitbucket some type of git based repo in order to allow people to fork the work and make their own SW mods
as well as hosting PCB plans there.

The only things I have not figured out is how to calculate resistance of atty. I am sure that is simple resistance math with a divider as I have briefly researched.

Hopefully if anyone is still around they would be on board to make a open source mod :-p
Title: Re: You asked mamu it's coming.
Post by: PoppaVic60 on May 17, 2015, 09:51:55 PM
I'm still poking around arduino code, (arms still not arrived). I've been toying with the build-system, makefiles - the software.

Much as I like the OKR, I can't seem to find a reasonable alternative to the silly trimpot: I don't want to be installing and replacing pots (btdthts).

A single cell, (automatically covers parallel), and series build would cover the bases - satisfying anyone but the cloudchasers.

Let me know when you have some stuff up, I'll keep tinkering/doodling.
Title: Re: You asked mamu it's coming.
Post by: iusedtoanalog on May 18, 2015, 12:33:57 PM
Mugen and Poppa,
I have had much interest in building an open source type of mod based around an arduino controller. This is what a couple of modders have ultimately decided to run with their arduino based mods...... http://www.ericsson.com/ourportfolio/products/bmr450-series?nav=productcategory003%7Cfgb_101_378%7Cfgb_101_379 It is a POL module with 20A capability, but the reason this got the nod over the Raptor, it is controllable via PMBus. Which from what I understand can be done with an arduino......There is a thread here http://ukvapers.org/Thread-VapeShield-VV-VW-VA-Mod-Board where a few guys have been using these for (as best I can tell) at least a few months....The thread is ~138 pages long so it chronicles all the different incarnations from PWM to Raptor with digipot to the use of the erricsson module. They pass around code within the forum and do a generall nice job of keeping everything documented. Give it a look and see if it stirs your imagination......
Title: Re: You asked mamu it's coming.
Post by: PoppaVic60 on May 18, 2015, 03:25:37 PM
well, I've been thru 30 of the 130+ posts and seen very little code.

They are also building "hookah" stations - not mods. Although, I definitely approve of the nokia display (cheap and easy). I was interested in the nano once, but the pro mini and pro micro are my smallest at hand.

I did pick up a pair of those specialized displays Mamu had posted about, as well as a 1.8 and 2.4" tft. (The latter is probably good for building someone a desktop picture-frame). Eventually, I'll try one of the small graphic oleds (smaller meaning "than the nokia"), but the price/value of the 5110 nokia display is just too good to miss.
Title: Re: You asked mamu it's coming.
Post by: iusedtoanalog on May 18, 2015, 03:39:09 PM
If memory serves me correctly they branch to handheld devices around page 70...... there eventually are two folks who build different versions side by side.  And yes it was a long read but we'll worth it IMO....
Title: Re: You asked mamu it's coming.
Post by: PoppaVic60 on May 18, 2015, 04:27:58 PM
still reading... ;-)

BTW, is it just me or are a ton of videos defunct? (could be I lack membership, but I doubt it)
Title: Re: You asked mamu it's coming.
Post by: mugenman1111 on May 18, 2015, 10:56:18 PM
So realistically.

What is more feasable. Using a PMBus compatible buck chip or using a few digipots?

I honestly have just started dabbling in this and from what I can gather Claviger did not have control of the chipset only a readout of what was going on with it and to fire it?

Things I am wanting ..... seeking to accomplish

Live Ohm readout of atty
Wattage display with an easily adjustable method (hopefully with choice of either rotary or buttons both should be simple to setup with some ifdefs)
Voltage display and obviously intelligent voltage based off ohm reading and desired wattage
Current battery status. (not super important but would be nice to read the current value of battery vs expected and set a icon for it)
other things to me seem meaningless.... i vape..alot so i really dont care about how many times i push the button or how long i hold it.


I am going to start piecing together a repo I will make a github page for it and can assign a couple admins to the page to allow others to join and manage projects.

https://github.com/Open-Source-Vape

I will be happy to add members to the project


Title: Re: You asked mamu it's coming.
Post by: PoppaVic60 on May 18, 2015, 11:10:35 PM
I'm interested. Although, my Git-Fu and admin-fu are near zero.

I'm up to page 110 over there.. So far, almost nothing they expected from the PMbus seems to do what they wanted.

Further, we have NO digipots in the under 1K zone.. An EE buddy mentioned in a drive-by that a DAC might work, but I never heard more.

Part of the fun for me is the MCU programming, plus tinkering/soldering again. I've little hope of designing a 2-sided PCB myself. Further, I can happily live w/o ever replacing a pot in a mod again..

Back to reading..
Title: Re: You asked mamu it's coming.
Post by: mugenman1111 on May 18, 2015, 11:29:33 PM
I have extensive PCB design experience...

Git is more to let people who want to mod the code see what's been done and why and allow their own versions/forks/branches on a public space


git is SUPER easy to learn I taught a 12 year old how to do it
Title: Re: You asked mamu it's coming.
Post by: PoppaVic60 on May 18, 2015, 11:42:48 PM
The fun part is: I ran a photoplot dept. and did all sorts of layup, laminating, developing and press work.. Fixed inner layers and surface.. Just never understood the DESIGN part of it ;-)

I'd certainly stay with avr's and this thing, at least myself.. I don't feel like suffering mplapX again and I never did bother to order a PICkit 2/3.. (I've still got a half-dozen pic24's here I was unable to program).

In any event, sure. Sign me up. Can't help but learn something. Did you want to start a wiki as well, or create a thread herein, (with Breaktru's permission)?


Title: Re: You asked mamu it's coming.
Post by: mugenman1111 on May 18, 2015, 11:47:02 PM
I Think we should make a subthread for this project.... I can start a wiki off the git page too

if you sign up for a github account just shoot me your username/email you signed with ill add you to the github project page
Title: Re: You asked mamu it's coming.
Post by: PoppaVic60 on May 19, 2015, 12:18:39 AM
sent.
Title: Re: You asked mamu it's coming.
Post by: mugenman1111 on May 19, 2015, 12:23:42 AM
I have invited you as an owner of the git you have full read write access to all files/repo's

if you need some help i can give you a quick breakdown of git stuffs....
Title: Re: You asked mamu it's coming.
Post by: mugenman1111 on May 19, 2015, 08:03:38 PM
So recently I used a arduino in a project to control contrast of a character LCD instead of a 10k ohm pot.
This leads me to believe we don't need a digital pot to control sense. It kind of depends on how raptor chips work I'll have to pull datasheets for the raptor and other common buck boards

Title: Re: You asked mamu it's coming.
Post by: PoppaVic60 on May 19, 2015, 08:49:19 PM
I'm still trying to puzzle out what my EE friend meant about a DAC replacing the trimpot - mostly I think of the OKR, but I'm also fond of the single-cell in the Cloupor mini I got.

A single/parallel as well as a stacked/series design would likely be the way to go. (I've no interest in high watts or the raptor, myself: with a top end of 30w, I'm happily vaping along at 10-12).

BTW, finished reading all 138 pages of the UK forum. Didn't see much there, although I saved a few links.
Title: Re: You asked mamu it's coming.
Post by: mugenman1111 on May 19, 2015, 10:23:15 PM
How many volts are you pushing at your 10/12w ?

Title: Re: You asked mamu it's coming.
Post by: PoppaVic60 on May 19, 2015, 10:30:06 PM
The cloupor display says 3.18v @ 12w wth the orchid @ .84ohm (hmm, unicode ohm symbol didn't fly)

Usually, I find I need to drop at least 1w for the Russian, and the volts are above 2.7, iirc.
Title: Re: You asked mamu it's coming.
Post by: mugenman1111 on May 19, 2015, 10:48:53 PM
I am trying to determine what the best plan of attack in this situation would be so that there is a wide range of available output in order to facilitate all users more or less

I use the raptor 20a boards depending on what ohm impedance I run i keep it around 50-60w.

Title: Re: You asked mamu it's coming.
Post by: PoppaVic60 on May 19, 2015, 10:58:41 PM
I understand the Raptor is a bit of a hassle to find in stock, and really - that's about 4x the power most folks would end up using, (so why pay for it?)

I'm not sure what else is available, either. Why that particular converter?
Title: Re: You asked mamu it's coming.
Post by: mugenman1111 on May 19, 2015, 11:01:53 PM
Just what I've got experience with. Digikey has them in stock..
There's another by delta that's essentially the same.
 
In theory. If we can figure out a digital means of controlling trim +/- we can use any board... Okl okr raptor delta any with a trim +/-
Title: Re: You asked mamu it's coming.
Post by: PoppaVic60 on May 19, 2015, 11:10:27 PM
Might as well start that wiki as well, since this conversation is abusing a historical thread.
Title: Re: You asked mamu it's coming.
Post by: mugenman1111 on May 25, 2015, 12:46:48 AM
BTW those who want to mod clavigers work for a raptor board you need to invert the HIGH to LOW and LOW to HIGH where he references all mention of  powerConverter

HIGH = output voltage
LOW = ground style

if you change them around it will fire the raptor board set as it takes a positive voltage to fire it. You also probably dont need the zener diode to fire the raptor when using the digitalWrite(powerConverter, HIGH) function as it may not take the output depending on the levels the arduino produces... still havent throw a multimeter to it to test


https://github.com/Open-Source-Vape/Arduinocode/blob/Claviger-Raptor/Rebuild_V_1d/Rebuild_V_1d.ino

here is a rough draft will have some chips to test on later this week
Title: Re: You asked mamu it's coming.
Post by: homemadehp on August 08, 2015, 09:51:38 PM
I'm having trouble uploading the code into the pro micro.  Using Arduino IDE 1.6 and sparkfun pro micro.  I used avr, arduino as isp, arduinoisp and most of the times I get programmer not responding or didn't find usb device.  I've downloaded the drivers needed.  please help.
Title: Re: You asked mamu it's coming.
Post by: Breaktru on August 09, 2015, 06:39:10 AM
I'm having trouble uploading the code into the pro micro.  Using Arduino IDE 1.6 and sparkfun pro micro.  I used avr, arduino as isp, arduinoisp and most of the times I get programmer not responding or didn't find usb device.  I've downloaded the drivers needed.  please help.

Welcome homemadehp.
In the Arduino IDE software, have you checked the settings for board type and com port. Also in "File", "Examples" load the "ArduinoISP" program.

See video:
https://www.youtube.com/watch?v=muP1dp73Mdg (https://www.youtube.com/watch?v=muP1dp73Mdg)

SparkFun Pro Micro (https://learn.sparkfun.com/tutorials/pro-micro--fio-v3-hookup-guide/introduction)
Title: Re: You asked mamu it's coming.
Post by: homemadehp on August 10, 2015, 01:04:53 AM
Thanks for the help Breaktru.  I made a bit of progress.  I was able to compile and upload something to the chip so I know its communicating but the problem I'm having now is when I upload the code it gives me a bunch of errors with the code.  I'm pretty new with this.  On the first page it says to copy and paste then upload.  So I downloaded the file and opened it with Arduino IDE but it would say errors in the code.  Am I doing something wrong?

first error is clickbutton.h no such file or directory
complication terminated
error complining
Title: Re: You asked mamu it's coming.
Post by: Breaktru on August 10, 2015, 08:06:52 AM
Thanks for the help Breaktru.  I made a bit of progress.  I was able to compile and upload something to the chip so I know its communicating but the problem I'm having now is when I upload the code it gives me a bunch of errors with the code.  I'm pretty new with this.  On the first page it says to copy and paste then upload.  So I downloaded the file and opened it with Arduino IDE but it would say errors in the code.  Am I doing something wrong?

first error is clickbutton.h no such file or directory
complication terminated
error complining

You will need to include the library clickbutton.h
By inserting #include "clickbutton.h" into your script the library must be in your Arduino folder.
You will need to download the "clickbutton" library.  See "Importing a .zip library" or "Manual Installation" here -> https://www.arduino.cc/en/guide/libraries (https://www.arduino.cc/en/guide/libraries)

Also see -> https://www.arduino.cc/en/Hacking/Libraries (https://www.arduino.cc/en/Hacking/Libraries)
Title: Re: You asked mamu it's coming.
Post by: homemadehp on August 10, 2015, 04:22:47 PM
Thanks again.  Was working from my home computer all weekend.  Used my work computer today and it worked fine. So code is uploaded and just doing minor tweaks to the display then do testing on it. 
Title: Re: You asked mamu it's coming.
Post by: vapetech334 on October 21, 2015, 04:00:14 AM
has anyone made a working wiring diagram for ANY of the sketches on the github? is anyone continuing this program. I cant seem to find any help and lately ive been having the worst luck with vapes that arent modules like DNA chips, SX, Alien, and things like that. I want an arduino, even just to display ohms volts and maybe watts and battery power on a mosfet mechanical mod.

Ive got to order a new Serial-to-USB USB dongle to program my pro minis bc aparently the Prolific Systems one I bought isnt compatible with windows 8 and i recently had to upgrade.

ill admit ive been really busy with my pregnant wife, 3 weeks till my little baby girl Zelda Grace is here. Im so excited, but I need something to do when I have bad anxiety and cant sleep and so far im just having nothing but pure frustration and that is definately not what I want.

I wish there was a tutorial I could find to just give me a basic setup for an arduino vape and I could go from there and make it my own, but no one will ever do that... blah


Title: Re: You asked mamu it's coming.
Post by: norcalreballer on October 21, 2015, 08:19:30 AM
 :)
Title: Re: You asked mamu it's coming.
Post by: mamu on October 21, 2015, 12:05:45 PM
...I want an arduino, even just to display ohms volts and maybe watts and battery power on a mosfet mechanical mod.

Have you checked out the modmeter?
http://fatdaddyvapes.com/shop.html (http://fatdaddyvapes.com/shop.html)

https://www.youtube.com/watch?v=PMglrzuiDq0 (https://www.youtube.com/watch?v=PMglrzuiDq0)
Title: Re: You asked mamu it's coming.
Post by: vapetech334 on October 23, 2015, 05:48:35 AM
Yes, I've used it, but the nfet,problem makes its use ability limit3e