gfxgfx
 
Please login or register.

Login with username, password and session length
logo
 
gfx gfx
gfx
19852 Posts in 1275 Topics by 5182 Members - Latest Member: charbuild March 28, 2024, 07:26:27 PM
*
gfx* Home | Help | Search | Login | Register | gfx
gfx
Breaktru Forum  |  eCigarette Forum  |  Modding  |  Topic: 1st Attempt w/ a Microcontroller
gfx
gfxgfx
 

Author Topic: 1st Attempt w/ a Microcontroller  (Read 95110 times)

0 Members and 3 Guests are viewing this topic.

Online Breaktru

  • Administrator
  • PV Master
  • *****
  • Joined: Nov 2008
  • Location: NY
  • Posts: 3344
  • Karma: +792/-4
  • Gender: Male
  • PLEASE participate in this forum
Re: 1st Attempt w/ a Microcontroller
« Reply #50 on: April 01, 2012, 09:41:25 PM »
It was a so-called Ultrafire 3000mah. See: http://breaktru.com/smf/index.php/topic,289.msg3456.html#msg3456

Offline jester

  • Sr. Member
  • ****
  • Joined: Dec 2011
  • Location: derby uk
  • Posts: 88
  • Karma: +14/-0
  • Gender: Male
Re: 1st Attempt w/ a Microcontroller
« Reply #51 on: April 02, 2012, 05:52:08 AM »
i got 2 of those batterys you  got my trustfire 14500 last long alot of them on ebay i will only be using tusted suppliers. :thankyou:jimmy

Offline asdaq

  • Jr. Member
  • **
  • Joined: Feb 2012
  • Location: Poland
  • Posts: 16
  • Karma: +7/-0
Re: 1st Attempt w/ a Microcontroller
« Reply #52 on: April 04, 2012, 02:15:58 PM »
Great projects guys! Tru, what size 'box' do you need to house this? In other words, what are the sizes of everything you need to fit inside?

Online Breaktru

  • Administrator
  • PV Master
  • *****
  • Joined: Nov 2008
  • Location: NY
  • Posts: 3344
  • Karma: +792/-4
  • Gender: Male
  • PLEASE participate in this forum
Re: 1st Attempt w/ a Microcontroller
« Reply #53 on: April 04, 2012, 02:33:41 PM »
Great projects guys! Tru, what size 'box' do you need to house this? In other words, what are the sizes of everything you need to fit inside?

Craig's board is amazing, ain't it Asdaq.
I have several in the approximate size. Just not impressed with them. Waiting for an Extruded Aluminum case that may have to do.
The project got a little out of control, size-wise.
If I go with the deeper box, 1¾" I can probably fit it in a 3¼" x 2¼"

Offline asdaq

  • Jr. Member
  • **
  • Joined: Feb 2012
  • Location: Poland
  • Posts: 16
  • Karma: +7/-0
Re: 1st Attempt w/ a Microcontroller
« Reply #54 on: April 04, 2012, 02:41:57 PM »
Most certainly. What if it weren't a box, but a tube or two? Any chance?

Offline CraigHB

  • PV Master
  • *******
  • Joined: Nov 2011
  • Location: Reno, Nevada
  • Posts: 2023
  • Karma: +246/-1
  • Gender: Male
Re: 1st Attempt w/ a Microcontroller
« Reply #55 on: April 04, 2012, 02:48:37 PM »
The hardest part is making things small.  You get better at it the more you do it.  The one I show in this thread is a product of all the ones I've done before it.  The first one I did was quite a bit larger.

I've kind of stalled on this one.  I've had a bunch of things come up that have kept me away from the project.  Haven't touched it for a while now.  I need to build a couple more PCBs, do some mechanical drawings, and go to a local guy that does 3D printing for a custom enclosure.  There's pretty much no way I'll be able to find something off-the-shelf for it.

Online Breaktru

  • Administrator
  • PV Master
  • *****
  • Joined: Nov 2008
  • Location: NY
  • Posts: 3344
  • Karma: +792/-4
  • Gender: Male
  • PLEASE participate in this forum
Re: 1st Attempt w/ a Microcontroller
« Reply #56 on: April 04, 2012, 06:06:07 PM »
Most certainly. What if it weren't a box, but a tube or two? Any chance?
Craig's right. Gets better each time. Perhaps the 3rd or 4th version will be more manageable. I would have to use all SMD parts. My PCB traces are critically close already though.
No way can this fit in any tube type. Maybe 2" pipe....  :laughing2: I know Asdaq would steam punk it  :rockin smiley:. Though the LCD would contradict the steam punk effect.

Offline asdaq

  • Jr. Member
  • **
  • Joined: Feb 2012
  • Location: Poland
  • Posts: 16
  • Karma: +7/-0
Re: 1st Attempt w/ a Microcontroller
« Reply #57 on: April 04, 2012, 07:04:32 PM »
Hey, I've got a length of ~36mm ID  :rockin smiley:

Offline SolarRay

  • Full Member
  • ***
  • Joined: Mar 2012
  • Location: MidWest
  • Posts: 48
  • Karma: +13/-0
  • Gender: Male
Re: 1st Attempt w/ a Microcontroller
« Reply #58 on: April 04, 2012, 07:38:40 PM »
How's are the Micro-Controllers coming? They Looks awesome some far.  :thumbsup:

Does it measure current flow under load?
Does it measure voltage under load?
What other features does it have?

When can I buy a kit from Breaktru? !   :begging:

I have some pic MCU experience and surface-mount experience and had conceived building something like after seeing a Lava tube and  before discovering this thread...now I think I would just be reinventing the wheel.

Incredible work....I love what we can do these days with programs like Eagle and short run circuit board fabrication.

are you guys soldering the surface-mount under a magnifying light (as I do) or doing the soldermask / solderpaste / toaster oven technique? Just curious?

Offline CraigHB

  • PV Master
  • *******
  • Joined: Nov 2011
  • Location: Reno, Nevada
  • Posts: 2023
  • Karma: +246/-1
  • Gender: Male
Re: 1st Attempt w/ a Microcontroller
« Reply #59 on: April 05, 2012, 04:24:56 PM »
I suppose you think of it as re-inventing the wheel since production VV and VP mods are available, but it's also a matter of building something yourself and making it to your own specifications.  When I build my own devices, they have all the features I want and none that I don't.  The feature set is unique to my device.

I do all my soldering by hand under a stereo microscope, 10x mainly, but I'll use 30x for inspection sometimes.  Though, that's not to say it's the best method, it's just how I do it.

A lot of people use reflow soldering for SMD stuff.  It can be done with a simple toaster oven or hot plate.  You do need to add a temperature probe of some kind to avoid over-heating.  Pretty do-able actually.  It's way faster than hand soldering.  I've just been soldering electronics for a very long time and have always done it by hand.  Electronics have gotten smaller over the years and I've just been adjusting my hand soldering methods as required.  I really need to have a go with reflow myself.

For hand soldering, it's all a matter of scale.  There's no difference between soldering a thru-hole resistor and the smallest SMD component other than the tools and supplies you use.  The smaller you go, the finer the wire solder, the finer the tip, and the more magnification.  You need a good set of very sharp tweezers to handle the components.  A steady hand helps a lot too.

One note about PCBs and vaping.  You need to ensure the PCB is well protected from vapor as well as juice.  The vapor can condense on the PCB over time and short things out.  I've encountered that already myself.  Though, it's nothing a little cleaning with rubbing alcohol can't fix.
« Last Edit: April 05, 2012, 04:32:16 PM by CraigHB »

Offline SolarRay

  • Full Member
  • ***
  • Joined: Mar 2012
  • Location: MidWest
  • Posts: 48
  • Karma: +13/-0
  • Gender: Male
Re: 1st Attempt w/ a Microcontroller
« Reply #60 on: April 05, 2012, 05:25:46 PM »
Craig I hear ya. I have done just a few surface-mount projects using a lighted 5x magnifier  ...My girl won't loan me her Gemological stereo-micro scope for soldering  >:( Although I can use it for inspection and have.  :D

I love building things my-self or in collaboration with a good team for exactly the reasons you mentioned...unique feature set and self satisfaction and for experience.

I have a Weller WES51 that a love that does a good job on just about everything with the right tips (very fine to chisel)

Well, you guys rock. :rockin smiley: I hope these device are available soon I finding PV's are like other fun toys, you can't have too many devices

 

Offline CraigHB

  • PV Master
  • *******
  • Joined: Nov 2011
  • Location: Reno, Nevada
  • Posts: 2023
  • Karma: +246/-1
  • Gender: Male
Re: 1st Attempt w/ a Microcontroller
« Reply #61 on: April 05, 2012, 05:54:18 PM »
Sounds like you're all set up.  Time to hit the drawing board, eh?

Offline SolarRay

  • Full Member
  • ***
  • Joined: Mar 2012
  • Location: MidWest
  • Posts: 48
  • Karma: +13/-0
  • Gender: Male
Re: 1st Attempt w/ a Microcontroller
« Reply #62 on: April 09, 2012, 04:23:03 AM »
Been hitting the drawing board pretty hard. Its hard to not have the feature set snowball when using a micro controller.

My Design so far:
3.7 volt single Li-On cell powered
2x8 back-lit display
Variable voltage using a DC-DC booster  3.80v - 6.2v at  0.05v steps.
3 button interface.
display shows Volts, Amps, Watts, Resistance & battery SOC on demand.
device senses Shorted Atty, Open Atty
user can change voltage, display contrast, back light on/off via the 3 button interface.
user can change if display is on or off during vaping.
measures amp, volts, watts under load.
Low battery warning via display.
Over current warning via display.
USB charging.

Initial schematic finished.
Initial Software flow chart finished.
Initial Software psedo-code finished. (I forge out the psedo-code so I have a template used as a blueprint for multiple micro - controller platforms. All my past experience is with Microchip 8bit controllers. May go with one of their 16bit units or switch to ATMEL

Creative juices flowing for a possible tube-mode solution as enclosure, without being overly bulky.

Parts on order.















Online Breaktru

  • Administrator
  • PV Master
  • *****
  • Joined: Nov 2008
  • Location: NY
  • Posts: 3344
  • Karma: +792/-4
  • Gender: Male
  • PLEASE participate in this forum
Re: 1st Attempt w/ a Microcontroller
« Reply #63 on: April 09, 2012, 09:45:10 AM »
Been hitting the drawing board pretty hard. Its hard to not have the feature set snowball when using a micro controller.

My Design so far:
3.7 volt single Li-On cell powered
2x8 back-lit display
Variable voltage using a DC-DC booster  3.80v - 6.2v at  0.05v steps.
3 button interface.
display shows Volts, Amps, Watts, Resistance & battery SOC on demand.
device senses Shorted Atty, Open Atty
user can change voltage, display contrast, back light on/off via the 3 button interface.
user can change if display is on or off during vaping.
measures amp, volts, watts under load.
Low battery warning via display.
Over current warning via display.
USB charging.

Initial schematic finished.
Initial Software flow chart finished.
Initial Software psedo-code finished. (I forge out the psedo-code so I have a template used as a blueprint for multiple micro - controller platforms. All my past experience is with Microchip 8bit controllers. May go with one of their 16bit units or switch to ATMEL

Creative juices flowing for a possible tube-mode solution as enclosure, without being overly bulky.

Parts on order.

Looks like we have another killer mod in the works. Fantastic! Between you and Craig you guys have posted some interesting concepts.

I spent several hours yesterday bench testing. I have found mine a bit buggy on start-up. I went with an 8bit processor.
Perhaps I should keep my processor powered all the time and make it go into sleep mode when not needed. Shutting pwr completely off and on doesn't seem to be the way to go.
Funny though, when it was on a bread board, it worked consistently well every time. From complete power down to powering up.

Offline SolarRay

  • Full Member
  • ***
  • Joined: Mar 2012
  • Location: MidWest
  • Posts: 48
  • Karma: +13/-0
  • Gender: Male
Re: 1st Attempt w/ a Microcontroller
« Reply #64 on: April 09, 2012, 02:40:27 PM »

Perhaps I should keep my processor powered all the time and make it go into sleep mode when not needed. Shutting pwr completely off and on doesn't seem to be the way to go.
Funny though, when it was on a bread board, it worked consistently well every time. From complete power down to powering up.

Sleep mode is usually the way to go rather than killing the power to chip and have to redo all  that startup initialization each time.

Can wait to see more of your design.

I'm adding two more functions: (software based so easy to add  :))
1) Restricted upper Volt limit based on ATTY ohms.
2) User adjustable draw limit time.
        Two safety features that ensure the device doesn't melt down.



Offline CraigHB

  • PV Master
  • *******
  • Joined: Nov 2011
  • Location: Reno, Nevada
  • Posts: 2023
  • Karma: +246/-1
  • Gender: Male
Re: 1st Attempt w/ a Microcontroller
« Reply #65 on: April 09, 2012, 02:49:17 PM »
This is getting interesting now that we have another MCU guy on-board. 

I power my MCU full time.  I use the wake on "port change" interrupt to wake the MCU when a button or the trigger is pressed.  If you use an LDO regulator with an ultra-low quiescent current, you can get draw pretty negligible in sleep mode.  My total sleep draw is only 7.5µA.   Of that, 3µA is for the MCU, 3µA is the quiescent load of the MCU's regulator, 1µA goes to the digital pot, .25µA is for a voltage detector, and the rest is leakage.

In any case, you should have a stable power-up.  Here's some things that can give you trouble;

Do you have decoupling capacitors on all your power pins for the MCU.  It's standard practice to put a .1uF capacitor between all the MCU power pins and ground as close to the pins as possible.  The same is true for any chip that utilizes digital logic.

Do you have adequate input and output capacitors on the MCU's regulator as close to the regulator as possible?.

Do you have any heavy capacitive loads on any of the port pins.  That can cause a power spike and over-load for the MCU on power-up.

Is the dc-dc converter's ground plane isolated from the MCU's ground plane?

Is there anything in your code that is switching a heavy load too close to power-up?

Online Breaktru

  • Administrator
  • PV Master
  • *****
  • Joined: Nov 2008
  • Location: NY
  • Posts: 3344
  • Karma: +792/-4
  • Gender: Male
  • PLEASE participate in this forum
Re: 1st Attempt w/ a Microcontroller
« Reply #66 on: April 09, 2012, 03:58:11 PM »
Very good Craig. Very useful info, thanks.

Yes to the .1uF (100nF) on the VCC pin. I have 3 VCC pins tied together w/ (1) .1uF to ground.

My regulator is using the recommended caps but maybe too high drain for continuous power on (LM317).

I suspect the Amperage Sensor may be causing a capacitance problem. The very 1st time powering on after wiring up the PCB, I had to
remove the sensor for it to work at all.

The DC-DC conv is sharing the ground plane. o'boy. This will be hard to fix.

I have a 3 sec banner display on power up before code calculations begin.

Offline CraigHB

  • PV Master
  • *******
  • Joined: Nov 2011
  • Location: Reno, Nevada
  • Posts: 2023
  • Karma: +246/-1
  • Gender: Male
Re: 1st Attempt w/ a Microcontroller
« Reply #67 on: April 09, 2012, 06:38:44 PM »
Each VCC pin should have it's own decoupling capacitor located as close the pin as possible.  Believe it or not, the additional trace length that results from tying all three pins to one decoupling cap can make a difference.  It's because you want to minimize ESR.  Trace resistance acts like additional ESR for the capacitor.  ESR reduces the effectiveness in which the capacitor smooths the supply.  That's also why decoupling capacitors are always ceramic, they have the lowest ESR.

You can probably go as high as you want on the regulator's input cap, but don't go over the recommended value on the output cap.  It's because the higher the capacitance on the output cap, the longer it takes for voltage to ramp up.  MCUs have a certain tolerance for ramp-up.  If it's too slow, it might not power-up properly.  Also, regulators have a limit on the in-rush current they can handle.  More output capacitance means more in-rush current which can cause unstable start-up characteristics for some regulators.  Some LDO regulators call for electrolytic or tantalum capacitors for proper stability.  Make sure the data sheet says ceramic caps are acceptable if that's what you are using.

You don't need to go so far as to use active isolation for your ground planes.  Just put a slot in there to separate the converter plane from the MCU plane with a common connection at battery negative.  What you're doing is mitigating cross-inductance by routing high return currents away from sensitive digital circuits.  Routing return currents under their positive counterparts makes induction cancel.  When high currents flow in the ground plane under traces carrying low voltage signals to high impedance inputs, it can induce considerable voltages in those circuits which plays hell with them.

If you need to power up something with the MCU that has a capacitive load, isolate it with a complimentary MOSFET pair.  You can get them in very small packages like SOT-23 or even SC-70 if you want to go that small.   They're usually good up to an Amp and can handle any in-rush currents.  I use this one myself;

http://www.fairchildsemi.com/pf/FD/FDG6332C.html

Online Breaktru

  • Administrator
  • PV Master
  • *****
  • Joined: Nov 2008
  • Location: NY
  • Posts: 3344
  • Karma: +792/-4
  • Gender: Male
  • PLEASE participate in this forum
Re: 1st Attempt w/ a Microcontroller
« Reply #68 on: April 09, 2012, 08:14:42 PM »
I'll try adding a couple of more decoupling caps and breaking the ground plane. If that don't work I will remove the DC-DC conv off the board.
I'm thinking of also replacing the LDO reg with an ultra-low quiescent. I roughly calculated the out put need to be 136.2 ma because of the LCD backlight.
Looking for a 5 Vout, 150 ma or up to 1a. Found some 3.3v. Still looking.

Offline SolarRay

  • Full Member
  • ***
  • Joined: Mar 2012
  • Location: MidWest
  • Posts: 48
  • Karma: +13/-0
  • Gender: Male
Re: 1st Attempt w/ a Microcontroller
« Reply #69 on: April 10, 2012, 05:31:43 PM »
Yeah Craig is bang on with all the theory and best practice(s).  :yes"  Everything mentioned I have been heard from other digital  engineers. (one of them worked on space-shuttle, B2 stealth, and various spy satellites).

I planing a using 3v LDO reg with an ultra-low quiescent, as well and all 3v components:
Digi-pots, sensors, & MCU

Since I am using only a 3.7 volt battery, I don't have much overhead to play with. Hopefully the battery voltage won't drop off too much under load. I found some pretty good 3v and Adjustable LDO's than can source up to 500mA.  I have calculated that about 300mA would be highest possible amp demand for my particular setup.  (on the digital side) and typical less than 100mA during normal  operation and just micro amps when sleeping.

It will be interesting to see what the actual amp draw is compared to the calculated.


Some of the LDO's were in the SOIC8 package, which I find pretty easy to deal with. I have some SOIC8 to bread board adapters that I use during the prototyping phase and SOIC8 is NOT too high on the P.I.A. scale for soldering.

Will post some pics soon.



Online Breaktru

  • Administrator
  • PV Master
  • *****
  • Joined: Nov 2008
  • Location: NY
  • Posts: 3344
  • Karma: +792/-4
  • Gender: Male
  • PLEASE participate in this forum
Re: 1st Attempt w/ a Microcontroller
« Reply #70 on: April 10, 2012, 05:36:12 PM »
Yeah Craig is bang on with all the theory and best practice(s).  :yes"  Everything mentioned I have been heard from other digital  engineers. (one of them worked on space-shuttle, B2 stealth, and various spy satellites).

I planing a using 3v LDO reg with an ultra-low quiescent, as well and all 3v components:
Digi-pots, sensors, & MCU

Since I am using only a 3.7 volt battery, I don't have much overhead to play with. Hopefully the battery voltage won't drop off too much under load. I found some pretty good 3v and Adjustable LDO's than can source up to 500mA.  I have calculated that about 300mA would be highest possible amp demand for my particular setup.  (on the digital side) and typical less than 100mA during normal  operation and just micro amps when sleeping.

It will be interesting to see what the actual amp draw is compared to the calculated.


Some of the LDO's were in the SOIC8 package, which I find pretty easy to deal with. I have some SOIC8 to bread board adapters that I use during the prototyping phase and SOIC8 is NOT too high on the P.I.A. scale for soldering.

Will post some pics soon.


Being you are using a single battery, wouldn't it be possible to for-go the regulator and power just from the battery? I read that somewhere on a site.
I need 5v so I couldn't go that route.

Offline freelinuxer

  • Jr. Member
  • **
  • Joined: Apr 2012
  • Posts: 5
  • Karma: +2/-0
Re: 1st Attempt at Microprocessing
« Reply #71 on: April 11, 2012, 03:00:03 AM »
I think the size of the 8 x 2 LCD display will fit nicely in a small box. The results are tight. No room for a space between values.
Note: have to look at my math code on rounding the numbers. the power calc is slightly off. Should have been 6.71w. The resistor, amps and voltage are dead on. Compared against my MultiMeter.



Hello, Breaktru, would you tell me the input power requirement for that 8x2 lcd ? (and possibly site that I can buy one from as well)...
I am searching for one operates with low power.
I am trying to use TI launchpad, and the MSP430 chip's power limit is ~3.3v I believe.
It was a good way of approaching MCU world .. (price). Plus I liked the fact that it consumes the lower power so TI MCU could be powered up all the time until the device turned off.
( I could be wrong.. it's still my day1 in this fun MCU programmin' world).


Another question.. if you don't mind.
I thought that arduino operates with 5v input volt. How do you operate the arduino board from 3.7v batt ?
Are you using stepdown regulator in this project ?

Your previous reply opened me a whole new way of enjoying this modding hobby.
Really appreciate it.
-freelinuxer
« Last Edit: April 11, 2012, 03:27:11 AM by freelinuxer »

Offline SolarRay

  • Full Member
  • ***
  • Joined: Mar 2012
  • Location: MidWest
  • Posts: 48
  • Karma: +13/-0
  • Gender: Male
Re: 1st Attempt w/ a Microcontroller
« Reply #72 on: April 11, 2012, 04:17:03 AM »
Being you are using a single battery, wouldn't it be possible to for-go the regulator and power just from the battery? I read that somewhere on a site.
I need 5v so I couldn't go that route.

I have not check the upper volt limit on the all devices...some may not be happy at 4.01 volts, the upper limit of a fully charged Li-On battery. I believe the main reason for a volt regulator is the vRef for the D to A. I am so use to using regulators it didn't even cross my mind to go without one.. Plus I want the voltage stable when the during vaping, I am pretty sure the battery volts will drop off sharply when the current kicks in. I don't have a scope., so I have no way to measure this. Since I have never really tried it....I have no idea what problems a non stabilized voltage may cause. However, I have made some LED flashers using PIC 's that ran fine from a 3V button cell with out a regulator, but nothing as complex as this.

Offline SolarRay

  • Full Member
  • ***
  • Joined: Mar 2012
  • Location: MidWest
  • Posts: 48
  • Karma: +13/-0
  • Gender: Male
Re: 1st Attempt w/ a Microcontroller
« Reply #73 on: April 11, 2012, 04:36:24 AM »
Here is some shots of my LCD - not the final one, just one I had on hand...still waiting for parts so started flushing out some of my coding and display screens.  No doing any D to A yet. I want to get all the displays working and the math working correctly.

 Thank god for 16bit floating point math! I would have hated to do this in 8bit.

 I will be measuring only the output volts, the output current and the battery volts. Right now I am just plugging in the Hex values where code would normally get them for the D to A.  Then I calculate the power = V * A, the Resistance =  V / A,  the maximum recommend voltage level = Square root (max watts / R).

Some pics:

Offline CraigHB

  • PV Master
  • *******
  • Joined: Nov 2011
  • Location: Reno, Nevada
  • Posts: 2023
  • Karma: +246/-1
  • Gender: Male
Re: 1st Attempt w/ a Microcontroller
« Reply #74 on: April 11, 2012, 03:56:19 PM »
Some MCUs have a really nice feature of having an internal voltage reference for the ADC.  This allows you to avoid the use of  a voltage regulator as long as the MCU and peripherals can operate within the supply range.  However you still need to regulate voltage for any LED indicators and the LCD backlight.  Otherwise, they will start out brighter and end up dimmer as the battery discharges.  It's probably just easier to regulate the supply for the MCU and all its peripherals.  Though, it may be possible to avoid using a regulator.

MCUs that require a 5V supply are not as common anymore.  Ten years ago, they were the standard.  The MCU I'm using has an operating range 2 to 4V which is probably more the norm anymore.  My LCD has an operating range 2.7 to 5.5V.  So, I run everything at 3V.  That allows me to run the cell all the way down to a fully discharged state with no change in supply voltage.  The MCU calls a low a batt condition at 3.5V (measured open circuit) and a voltage detector shuts down the regulator at 3V which drops draw down to 200nA as over-discharge protection.  Of course, this is for a single cell.  For a dual cell mod, 5V would probably be a better supply voltage.

Battery impedance can be a considerable factor.  My device uses a high drain LiPo flat cell with about 10m Ohm DC resistance.  Even at maximum output, voltage sag is well within tolerance.  However, when using a cell like a NCR18650A, cell resistance is up around 75m Ohm which could result in voltage sag out of tolerance for the system.  You have to look at what you're using and account for any dips in voltage due to load.  In my case, it's why there's a half volt difference between a low batt indication (3.5V open-circuit) and supply voltage (3.0V).

That half volt margin would not be enough for a single ICR 18650.  I would have to run two ICR 18650s in parallel or one IMR 18650 to get battery DC resistance down low enough.  I'd also have to use a 2.7V detector for over-discharge protection.

Offline SolarRay

  • Full Member
  • ***
  • Joined: Mar 2012
  • Location: MidWest
  • Posts: 48
  • Karma: +13/-0
  • Gender: Male
Re: 1st Attempt w/ a Microcontroller
« Reply #75 on: April 11, 2012, 06:43:36 PM »
 :begging: (not begging, bowing down in Awe) Thanks again Craig! once more your vast knowledge and willingness to share has improved my design yet again. I have decided to ditch the LDO and go with the MCP1601 Synchronous Buck Regulator which is designed to power things like cell phones and PDA's from a single 3.7 Li-On cell and I will go with a single IMR 18650.   Double checked all the voltage ranges all my devices:       
                          min typ  max
Current Sensor   3.0   3.3   5.5
MCU                  1.8   3.3   3.6
Digi pots            2.7   3.3   5.5
LCD                   2.7   3.3   5.5
Above all on regulator


DC - DC booster   straight of battery requires - 3.3v to 5v
Battery is 4.01 to 3.2

Hey I guess everything but my MCU is within tolerance. I'm sure I can find on from the same manufacture in the same family that is 2.7 to 5.5

I still go with the MCP1601 or similar for the over discharge protection and voltage stability it provides.
Sure it will take up real estate on PCB board with all its required analog components, but were talking a PCB board the size of a stick of gum with a medium component and pin count already.

I am still at the breadboard stage so I can play with a lot of options right now.

Thanks Again!!!!




Offline CraigHB

  • PV Master
  • *******
  • Joined: Nov 2011
  • Location: Reno, Nevada
  • Posts: 2023
  • Karma: +246/-1
  • Gender: Male
Re: 1st Attempt w/ a Microcontroller
« Reply #76 on: April 11, 2012, 10:32:56 PM »
I had actually thought in terms of a DC-DC converter for the MCU supply at one point, but it causes more problems than it solves.  For one, a single chip buck-boost solution involves a much larger package than a linear LDO regulator.  Then you need an inductor and much higher value capacitors.  There's usually a few additional components for selecting options as well.  All that stuff takes up space.  Another issue is converters are not particularly accurate and they have a lot of ripple.  That means you need a well decoupled voltage reference for the ADC or your measurements would be unstable.  Again, that's more PCB real eatate.  There's also the quiescent draw to consider.  It's much higher for a converter.

If space is not a concern, a converter does avoid the problem of battery fade allowing you to run the MCU and peripherals at whatever voltage you want.  I don't think it's worth the trouble though.  Easier just to run the whole thing at 3V with a linear LDO regulator (or 5V for series cells).

Offline SolarRay

  • Full Member
  • ***
  • Joined: Mar 2012
  • Location: MidWest
  • Posts: 48
  • Karma: +13/-0
  • Gender: Male
Re: 1st Attempt w/ a Microcontroller
« Reply #77 on: April 11, 2012, 11:50:53 PM »
ALL good points. I can see how the switching frequency can generate noise that has to be dealt with.
Seem like the with an LDO, if the Vin is from a battery, the Vout is not really going to have hardly any ripple.
Not like a transformed / rectified AC source.

I am not planing on powering the ATTY with this buck converter.
I am powering the ATTY with a separate DC-DC booster I wondering if its going to create a bunch of noise as well...I had already planned on decoupling the MCU & the Amp sensor, I guess now the Digi-pots.

I foresee a scope in my future  :wallbash:


From the Data sheet -
The MCP1601 is a synchronous Buck (step-down) switching regulator that can continuously supply 500mA of load current. This DC/DC converter can provide output voltages of 0.9V to Vin with an operating efficiency that can exceed 92%. Although ideally suited for a single Li-Ion, or 2 to 3 cell NiCd, NiMH, or alkaline battery operation, the input range of 2.7V to 5.5V is also useful for converting bus voltages to standard system requirements.

Requires 3 caps (2x 10uF, 1x 47pf)  and 2 resistors and the coil (10uH - 20uH) so that is only two extra parts over an adjustable LDO. Comes in 8MSOP.  most of the LDO's I have look at are 8SOIC or Dpack 4 pin or Dpack5pin

I have plenty of luck with LDO's so I may yet stick with one....I try to keep my projects with the KISS philosophy...but that it is counter productive when using a micro controller for an e-cig project... when you can get a good vape straight off the battery with an LM350  :laughing2:
« Last Edit: April 11, 2012, 11:54:28 PM by SolarRay »

Offline freelinuxer

  • Jr. Member
  • **
  • Joined: Apr 2012
  • Posts: 5
  • Karma: +2/-0
Re: 1st Attempt w/ a Microcontroller
« Reply #78 on: April 12, 2012, 03:43:36 AM »
That half volt margin would not be enough for a single ICR 18650.  I would have to run two ICR 18650s in parallel or one IMR 18650 to get battery DC resistance down low enough.  I'd also have to use a 2.7V detector for over-discharge protection.

Is this a good alternative ?
http://www.orbtronic.com/batteries-chargers/protected-3100mah-18650-li-ion-battery-cell-is-panasonic-ncr18650a-protection-ic-made-in-japan-top-button/
it has 2 layers of protections : cell, protection pcb. also has max discharge current of 8.5A, Max. working discharge current of 6.2A, Discharge cut-off voltage at 2.5A.

Offline SolarRay

  • Full Member
  • ***
  • Joined: Mar 2012
  • Location: MidWest
  • Posts: 48
  • Karma: +13/-0
  • Gender: Male
Re: 1st Attempt w/ a Microcontroller
« Reply #79 on: April 12, 2012, 05:18:18 AM »
I could not find the spec for the internal resistance of the cell...What Craig and I are discussing is providing a 3.3 volt stable supply to the micro controller and its peripherals....when the atomizer is fired up...where it be powered by a DC-DC booster, A Linear voltage regulator or direct tap....what happens is there is a surge of current and on most batteries the voltage sags.....

Let say I'm using an LDO's that is trying to provide 3.3 volts to my micro-controller and sensors and it has a drop out voltage of 200 milli-volts, 3.3 + 200 millivolts = 3.5 volts required.


Let say the battery is full charged at 3.9 volts and the battery voltage sags under the atty load to 3.5  that is a difference of 0.4 volts which = 400 milli-volts  everything would be ok

So let say the battery has discharged down to 3.8 volts and under load it sags 0.4 volts and now only have 3.4 volts supplied to the LDO
3.4 volts - 200 milli volts = 3.2 volts would be the output of my LDO....which is below the target low limit of 3.3 volts..........  in my case I need to keep the output above 3.0 volts because of the AMP sensor I am using require 3.0 volts minimum (the rest of my devices can below this)  so I would still be ok

Luckily
There are some LDO that are 100 milli volts at their current maximum output and lower if you are not maxing out the current capacity of the LDO.

Which means I could have a battery discharge all the way down to 3.1 volts and still keep things up and running.
at 3.0 volts the battery needs to be re charged.

I might be able use a 4v 3300uf tantalum capacitor as "power reservoir"   to power the sensor during the 5-20 second sag period:

but my calculations say:
10 milliamp typical current draw on the sensor
3.3 volts
= 300 Ohms ESR

a 4v 3300uf Capacitor charged up to 3.3v with will drain in 0.1 second trying to provide 10mA .so in theory I would need a capacitor with 100 times greater capacity to solve the problem that way.

When it comes to IMR and ICR 3.7v cells:
I don't know how good is is to run them all they down  to 2.5v...Ithey certainly won't give a good vape below 3v  no matter what you attach to it.  :laughing2:

But thanks for the suggested link...Those battery may work very well in some other simpler mods I have been working on....3100mah, 6.2amp working discharge current, max charge 1C = 3amps recommend charge (.3c) =1.1 amps is ALL pretty good from my limited experience in these type of cylindrical cells. I am more experienced in working the flat high discharge packs used in R/C

I don't think any of my mods would ever trigger the 8.2 amps current protection or the 2.5V cut off 
So would be buying that type of cell for the mah, and charge / discharge C rating




 



 
« Last Edit: April 12, 2012, 05:27:40 AM by SolarRay »

Online Breaktru

  • Administrator
  • PV Master
  • *****
  • Joined: Nov 2008
  • Location: NY
  • Posts: 3344
  • Karma: +792/-4
  • Gender: Male
  • PLEASE participate in this forum
Re: 1st Attempt w/ a Microcontroller
« Reply #80 on: April 13, 2012, 06:38:25 PM »
I'm about ready to stuff it all in an enclosure that came today. Perhaps tomorrow.

Offline michamer

  • Full Member
  • ***
  • Joined: Jan 2011
  • Posts: 38
  • Karma: +2/-0
Re: 1st Attempt w/ a Microcontroller
« Reply #81 on: April 13, 2012, 08:16:28 PM »
 :rockin smiley:
Don't forget to post some photos.

Offline CraigHB

  • PV Master
  • *******
  • Joined: Nov 2011
  • Location: Reno, Nevada
  • Posts: 2023
  • Karma: +246/-1
  • Gender: Male
Re: 1st Attempt w/ a Microcontroller
« Reply #82 on: April 13, 2012, 09:47:43 PM »
Seem like the with an LDO, if the Vin is from a battery, the Vout is not really going to have hardly any ripple.  Not like a transformed / rectified AC source.

That's normally true, but the transient currents the converter draws put a lot of ripple on input power, especially for buck.  Boost converters are noisy on the output end.  Buck converters are noisy on the input end.  Isolating the ground planes and using decoupling capcitors on the Vcc pins should cover it.  It's also a function of battery impedance.  The higher the battery impedance, the more input ripple.

If you look at supply voltage with a scope, you'll be able to easily see how much input ripple ends up at the MCU as a result of the converter driving the atomizer.  It's probably going to be as much as 50mV, but that's acceptable.  The power supply doesn't have to be perfectly flat.  The main thing is to get the edges off the ripple.  It's those sudden transients that play hell with digital circuits.  Smoothing the edges is mainly what isolated ground planes and decoupling capacitors do.

@freelinuxer, the Panasonic NCR18650A is probably the best 18650 LiCo cell out there.  However, the internal impedance is too high to run a booster.  You either need to run two in parallel, or use a CGR18650CH which is Panasonic's high drain 18650.  It has half the internal impedance and almost double the drain limit.  It comes at a cost in charge capacity, 2150mAh peak for the CGR18650CH versus 3100mAh peak for the NCR18650A. 

The other option is to use two of the NCR18650A cells in series with a buck converter.  A nice thing about buck converters is they also work nicely with a couple 14500 cells in series.  It's because buck is the opposite of boost.  Buck has half the input current of boost because input voltage is double.  As a result, input current is within tolerance for a couple protected 14500s.  It's because DC-DC converters conserve power, power out equals power in barring a small loss.  It's what differentiates them from linear regulators.

Online Breaktru

  • Administrator
  • PV Master
  • *****
  • Joined: Nov 2008
  • Location: NY
  • Posts: 3344
  • Karma: +792/-4
  • Gender: Male
  • PLEASE participate in this forum
Re: 1st Attempt w/ a Microcontroller
« Reply #83 on: April 13, 2012, 11:00:27 PM »
I had noticed my MCU regulator dipping when I fired up the OKR-T/6 that I had mounted on the same PCB. I did what Craig suggested by separating the ground plane for the DC-Conv and added the extra de-coupler for VCC to mcu but it didn't help.

I removed the OKT-T/6 off the PCB and NO dip in regulator voltage at all... Rock Solid output now.
When I cram it all into an enclosure I will keep the Converter away from the MCU circuitry and leave the converter separate.

Offline freelinuxer

  • Jr. Member
  • **
  • Joined: Apr 2012
  • Posts: 5
  • Karma: +2/-0
Re: 1st Attempt w/ a Microcontroller
« Reply #84 on: April 14, 2012, 12:09:43 AM »
...You either need to run two in parallel, or use a CGR18650CH which is Panasonic's high drain 18650.  It has half the internal impedance and almost double the drain limit.  It comes at a cost in charge capacity, 2150mAh peak for the CGR18650CH versus 3100mAh peak for the NCR18650A. 
...
@ CraigHB
Thank you, Craig, for the advice. Those CGRs are what I have now. I will use those panasonic ones in another step-down regulator mod.
It's always fun to learn new knowledge. :+)

@Breaktru, I can tell another cool mod's coming soon. Don't forget to mention here if you're  going to start another new thread for it.

I am just glad to know all these good knowledgeable people here. 

Offline CraigHB

  • PV Master
  • *******
  • Joined: Nov 2011
  • Location: Reno, Nevada
  • Posts: 2023
  • Karma: +246/-1
  • Gender: Male
Re: 1st Attempt w/ a Microcontroller
« Reply #85 on: April 14, 2012, 05:21:40 PM »
I had noticed my MCU regulator dipping when I fired up the OKR-T/6 that I had mounted on the same PCB. I did what Craig suggested by separating the ground plane for the DC-Conv and added the extra de-coupler for VCC to mcu but it didn't help.

I removed the OKT-T/6 off the PCB and NO dip in regulator voltage at all... Rock Solid output now.
When I cram it all into an enclosure I will keep the Converter away from the MCU circuitry and leave the converter separate.

Well, that's good to hear you were able to resolve the issue. Don't feel bad, a lot of times you run into weird issues that seem like FM (f'ing magic).  That's why there's an acronym for it.  Sometimes, all you can do is things by the book and hope no weird problems rear their ugly head.   When they do, you sometimes have to use weird solutions.

Online Breaktru

  • Administrator
  • PV Master
  • *****
  • Joined: Nov 2008
  • Location: NY
  • Posts: 3344
  • Karma: +792/-4
  • Gender: Male
  • PLEASE participate in this forum
Re: 1st Attempt w/ a Microcontroller
« Reply #86 on: April 14, 2012, 05:35:10 PM »
Yeah Craig weird. ya think it is the 600khz frequency of the OKR?
Everything is running stable now. I can even power down completely and power backup with no problem. Before, the code would freeze at different points of operation.

Right now I'm charging the batts in parallel mode. I ran the batteries down to as low as I can go. I'm monitoring them constantly. No heat felt. The batts are cool as ice. I put them in my tin can with the fire blanket over the can and a Halon auto fire extinguisher over that.  :laughing:
Crazy I know but the batts were out of balance. One measured 2.81v and the other 1.7v. Sounds dangerous.
Before I plugged in the charger, I put the 3PDT switch in parallel position for about 15-20 min, thinking maybe they would equal out without power and by just being connected in parallel. I know, sounds stupid right. So far so good.

Offline CraigHB

  • PV Master
  • *******
  • Joined: Nov 2011
  • Location: Reno, Nevada
  • Posts: 2023
  • Karma: +246/-1
  • Gender: Male
Re: 1st Attempt w/ a Microcontroller
« Reply #87 on: April 14, 2012, 06:15:33 PM »
Actually, the higher the switching frequency the better to a point.  It's because the reactive component of impedance increases at higher frequency which mitigates ripple.  600kHz is like the optimum switching frequency for performance and efficiency.  That's why they select it.  It's low enough to minimize switching losses and high enough to reduce component size and ripple.  I actually run my own booster at 550kHz to save a little on switching losses with a trade off in ripple.

With your cells in that depleted state, it doesn't take much of a charge differential to see those big voltage differentials.  When the cells get down that far, it only takes a slight change in charge to result in a big change in voltage.  So it doesn't surprise me that you'd see that.  Now, if you were seeing something like one cell at 3.7V and one cell at 3.2V, that would indicate a major problem since at that level, it takes a big difference in charge to make a small difference in voltage.

Online Breaktru

  • Administrator
  • PV Master
  • *****
  • Joined: Nov 2008
  • Location: NY
  • Posts: 3344
  • Karma: +792/-4
  • Gender: Male
  • PLEASE participate in this forum
Re: 1st Attempt w/ a Microcontroller
« Reply #88 on: April 25, 2012, 05:33:15 PM »
This did the trick filtering the ripple caused by the OKR (see attached):
« Last Edit: May 26, 2012, 10:13:44 AM by Breaktru Admin »

Offline CraigHB

  • PV Master
  • *******
  • Joined: Nov 2011
  • Location: Reno, Nevada
  • Posts: 2023
  • Karma: +246/-1
  • Gender: Male
Re: 1st Attempt w/ a Microcontroller
« Reply #89 on: April 25, 2012, 10:10:06 PM »
That's a good way to handle it.

If you use a 1uF cap and increase resistance to 2.2k and 6.8k, the filter will work exactly the same and you'll get less current draw.

Online Breaktru

  • Administrator
  • PV Master
  • *****
  • Joined: Nov 2008
  • Location: NY
  • Posts: 3344
  • Karma: +792/-4
  • Gender: Male
  • PLEASE participate in this forum
Re: 1st Attempt w/ a Microcontroller
« Reply #90 on: April 26, 2012, 09:36:15 AM »
That's a good way to handle it.

If you use a 1uF cap and increase resistance to 2.2k and 6.8k, the filter will work exactly the same and you'll get less current draw.

Yes Craig, I should have added the zero's to my 220 and 680 and made them 2200 and 6800 for less current. DOH!

Online Breaktru

  • Administrator
  • PV Master
  • *****
  • Joined: Nov 2008
  • Location: NY
  • Posts: 3344
  • Karma: +792/-4
  • Gender: Male
  • PLEASE participate in this forum
Re: 1st Attempt w/ a Microcontroller
« Reply #91 on: June 05, 2012, 08:30:25 PM »
Been playing around with an Atmel's ATMega328 Processor in 28 pin DIP package. Chip came pre-loaded with the Arduino Optiboot (Uno 16MHz) Bootloader. Installed it on a Programmer breadboard I made which I plan to also use for loading my own bootloader on future chips.
Chip worked fine and loaded simple sketches on it several times. The second day, I loaded a new sketch and received an error: Avrdude: stk500_getsync(); Not in sync; resp=0x00. Did some googling and found several people having similar issues. Seems to be communication problems. Tried every possible means unsuccessfully to get it working.
Finally this morning with changing devices to write to and com ports as I did yesterday, it worked  :banana: . Must be buggy Arduino software because the settings are the original settings.

I have found that the buggy-ness is caused by the additional pins to read inputs. So I found the best solution is to have a test board with only the bare necessaries (no inputs). I came to this conclusion writing to the chip after adding additional inputs.
I pop out the chip from my mod and pop it into the test board to load code and it works flawless this way.

Online Haileah

  • Full Member
  • ***
  • Joined: Oct 2010
  • Posts: 39
  • Karma: +10/-0
Re: 1st Attempt w/ a Microcontroller
« Reply #92 on: July 07, 2012, 07:28:53 PM »
Wish I had the know how to build one for myself  ;bow;

Offline sterling101

  • Super Member
  • *****
  • Joined: Jul 2012
  • Location: UK
  • Posts: 180
  • Karma: +16/-0
  • Gender: Male
Re: 1st Attempt w/ a Microcontroller
« Reply #93 on: July 25, 2012, 03:35:38 PM »
I (hopefully) should have something working soon based on a PIC MCU and using PWM for driving the atomizer itself.

Got a few scribbles put down on some paper but now it's a case of finding the best components to drive everything reliably and safely.
It will be put together in a tube mod too so space is a definite concern for me as heat will be too but expect a post to turn up soon asking silly questions about which component would best suit what etc as I start to fine tune things.

I've done a lot of work with PIC processors before and have used them to build an auxiliary ECU for controlling fuel on a turbo charged car so I understand the methods for reading signals and using the MCU outputs to control auxiliary outputs.
One thing I've not used is MOSFETs though as I've not had the need in the work I've done with MCU's but I can't see them causing too many issues :)

Will start a new thread once things start taking shape and get some pictures uploaded but for now I'll just give the heads up that there's another MCU mod on the horizon :)

Offline CraigHB

  • PV Master
  • *******
  • Joined: Nov 2011
  • Location: Reno, Nevada
  • Posts: 2023
  • Karma: +246/-1
  • Gender: Male
Re: 1st Attempt w/ a Microcontroller
« Reply #94 on: July 25, 2012, 04:02:52 PM »
The hard part with PWM is measuring equivalent voltage since input voltage is a factor.  It would be tricky for a closed loop regulated system or to provide user feedback for an open loop system.  The other thing is it requires series cells.  Though, it's an interesting concept and does lend itself to very high efficiency.

It should actually be a pretty simple thing to do, just a micro-controller and a MOSFET really, would need a couple tactiles and a display as well.  I suppose user feedback could just be a matter of indicating duty cycle.  You would get battery fade though.  For example 50% duty cycle with fully charged cells at 8.4V would not be the same power output as 50% duty cycle with heavily discharged cells at 7V.  Regulating the duty cycle to avoid battery fade opens a pretty big can of worms.

Offline sterling101

  • Super Member
  • *****
  • Joined: Jul 2012
  • Location: UK
  • Posts: 180
  • Karma: +16/-0
  • Gender: Male
Re: 1st Attempt w/ a Microcontroller
« Reply #95 on: July 25, 2012, 04:11:09 PM »
Yeah that's the one thing I'm still mulling over - how to keep the voltages stable.
I was thinking of using a closed loop system that can measure the battery voltage, and using a look up table to control the PWM adjustment.
But like you say, it's a definite can of worms!!

The other option is to use it to cross drive a 4050 to try and keep the voltage to a maximum at all times, but that's still on the drawing board as I could just as easily use the MCU to just monitor things and use a digital pot to sort the rest out...

Offline CraigHB

  • PV Master
  • *******
  • Joined: Nov 2011
  • Location: Reno, Nevada
  • Posts: 2023
  • Karma: +246/-1
  • Gender: Male
Re: 1st Attempt w/ a Microcontroller
« Reply #96 on: July 25, 2012, 04:31:49 PM »
Should be able to do it with a formula.  Measure input voltage with the ADC then with the user setting, derive a duty cycle from it.  Since duty cycle would be regulated, you would have to indicate equivalent voltage to the user.  You could also measure current and indicate equivalent power.

It's not a simple program that's for sure, lots of math you would have to do in code, but it does benefit from very high efficiency and a simple hardware design.   The only losses are the MOSFET and the wiring.  With a good MOSFET, you're looking at efficiencies no lower than 98%.  You also have very high output capability, limited only by the MOSFET and the max drain on the cells.

Offline sterling101

  • Super Member
  • *****
  • Joined: Jul 2012
  • Location: UK
  • Posts: 180
  • Karma: +16/-0
  • Gender: Male
Re: 1st Attempt w/ a Microcontroller
« Reply #97 on: July 25, 2012, 04:47:52 PM »
So I suppose the question would be what would be the ideal mosfet to use?
I have got a 5v sub mini relay that I can use for the test work until I get the mosfet set up though which, although not perfect would allow for some test work on the breadboard at least.

I'm thinking of trying to set up a regulated output using the PWM from 3v up to 6v so using two cells in series should give enough headroom between full charge and low charge to still keep the MCU running and if I use the display to signal when charging is required at say 10% headroom I can then disable the output to prevent the cells from being discharged too much.

The discharge rate *should* be relatively even so the formula for controling the PWM adjustment should be relatively straightforward to set up all being well - although I've probably just completely jinxed that idea lol

Offline CraigHB

  • PV Master
  • *******
  • Joined: Nov 2011
  • Location: Reno, Nevada
  • Posts: 2023
  • Karma: +246/-1
  • Gender: Male
Re: 1st Attempt w/ a Microcontroller
« Reply #98 on: July 25, 2012, 05:05:32 PM »
It should be easy to find a good MOSFET.  Since you can run at a fairly low frequency, I would imagine in the low KHz, you dont' have to worry about gate charge.  Pretty much any ol' MOSFET will work well.  Just pick the one with the lowest RDS(on)

Finding a MCU with a wide voltage range and a built-in ADC reference would be ideal.  That way, you can drive the MOSFET gate with battery voltage which yields the lowest RDS(on) and does not limit you to a low VGS(th).  If the controller does not have a built-in ADC reference you can use an external one.

It might be hard to find an MCU with an 8.4V tolerance.  Probably 6V would be the highest you can readily get.  You'd have to use an LDO regulator to power it.  In that case, just use a precision regulator so you dont' need a voltage reference for the ADC, you can just use VDD.

The lowest voltage you would have to deal with is 6.6V because a 3.7V Li-Ion cell is pretty much fully discharged at 3.3 Volts.  3V is typically the threshold for over-discharge protection.  You could set up a voltage detector circuit, possibly driving the enable pin on the MCU's regulator, to cut out the power supply when voltage drops below 6.6V
« Last Edit: July 25, 2012, 05:13:18 PM by CraigHB »

Offline sterling101

  • Super Member
  • *****
  • Joined: Jul 2012
  • Location: UK
  • Posts: 180
  • Karma: +16/-0
  • Gender: Male
Re: 1st Attempt w/ a Microcontroller
« Reply #99 on: July 25, 2012, 05:12:38 PM »
The (numerous) PIC MCU's I've got are all 5v so will need to use an LDO to get the voltage for it, but the ADC should only need a simple potential divider to bring it into the range that the ADC can cope with.
I was considering an external current sensor for checking the ohms of the atomizer but wondered if a voltage divider could also work for that as with a known resistance and a set voltage across the divider it should be a very simple piece of math to calculate the atomizer ohms.  I'd guess I'd need to have the atomizer on the ground side of the divider though and use another MOSFET to switch out the rest of the circuit from the actual atomizer driving circuit to make sure it's not going to fry the ADC channel when actually triggering the atomizer.  The only thing I need to play with is the lowest voltage I can output through the atomizer without actually triggering it which will probably be a trial and error thing I'd guess.

Breaktru Forum  |  eCigarette Forum  |  Modding  |  Topic: 1st Attempt w/ a Microcontroller
 

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