element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Experts, Learning and Guidance
  • Technologies
  • More
Experts, Learning and Guidance
Ask an Expert Forum 2N7000 as VCR
  • Blog
  • Forum
  • Documents
  • Leaderboard
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Experts, Learning and Guidance to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Suggested Answer
  • Replies 31 replies
  • Answers 6 answers
  • Subscribers 294 subscribers
  • Views 3620 views
  • Users 0 members are here
  • mosfets
  • attiny85
  • voltage controlled resistor
Related
See a helpful answer?

Be sure to click 'more' and select 'suggest as answer'!

If you're the thread creator, be sure to click 'more' then 'Verify as Answer'!

2N7000 as VCR

tibmeister
tibmeister over 9 years ago

Ok, so going to start off by stating the issue I am facing, Q1 (2N7000) is getting hot enough to cook with.  Seriously, I'm measuring 50C on the sucker.  What I can't figure out is why.  Now I will state, I am far from an engineer, I am easily classified as a noob.

 

Anyway, I have attached my schematic.  The sensor has a resistive heater that is driven by Q1 on the HA pin, and the trick is it has to cycle between +5VDC and +1.4VDC at regular intervals.  So since I am using an ATTiny85 (I love these little guys!) I'm looking at max Vout on the IO pin of +4.85VDC @ ~20mA.  So, I came up with using the LM324 as a small amp to bring my IO up to a full +5VDC and then as a buffer to ensure that even as I put load on Q1 Source I will maintain the desired voltage at the sensor's HA pin.  This may not be the best way to do this, but like I said, noob here.

 

So, if my calculations are correct, G1 of the LM324 should represent about a 10% amplification of Vin.  So at most I'm pushing something in the neighborhood of +5.5VDC into V+ of the LM324 G2, which should be well within specs.  As far as Q1, since I'm using it as a voltage controlled resistor I'm not running Q1 into saturation, which I don't think is bad but I'm almost wondering if my heat issue is coming from the fact that on the drain of Q1 I have +12V and on the source I have +1.4-5VDC, so that's a lot of Vdrop which I'm sure turns into wattage and dissipated heat.

 

I am struggling with this one and hoping someone could get my head straight on it.  Oh and yes, I have a lot of filtering caps and zener diodes for over-voltage protection.  It's cheap insurance in my mind having the zeners, and the caps, well it can't hurt to filter out any in-rush current image.

Attachments:
image
  • Sign in to reply
  • Cancel

Top Replies

  • D_Hersey
    D_Hersey over 9 years ago +1 suggested
    Using a power fet as a heater is not that great of an idea in practice as a warm fet has lowered Zin with low gain Switching resistors is a better idea as they are made to be heaters a bipolar Q cheap…
  • tibmeister
    tibmeister over 9 years ago in reply to Robert Peter Oakes +1
    Are you kidding, I've actually begun to understand this stuff much more than I thought I would and that alone is priceless. As for the offset, Rds(on) is 5.3 ohm and the current drain from source to drain…
Parents
  • tibmeister
    0 tibmeister over 9 years ago

    Alright, taking everyone's comments and suggestions and applying them I cam up with the attached circuit that actually works the way I anticipate it!  The most difficult process is how to say who was right because everyone was in this case and little elements of each response is in this circuit.

     

    One thing I am going to do is use PIN0/ADC0 (Reset Pin/Pin 1 on die) as an analog input and hook it between the sensor's HB and the 2N7000 so I can monitor the voltage drop and adjust the PWM accordingly and when I can't maintain +5V then signal a low voltage alarm.  Since the circuit as a whole only draws 240mA I'm hoping that 4 AA batteries will power this little guy for some time.

     

    Now one thing I noticed when probing everything is that when my multi-meter is referenced to ground and I probe between the sensor's HB and the 2N7000 I get the voltage drop, not the voltage itself.  Not sure why I am seeing it like that and would love to understand that part of it.

     

    So now it's time to start testing this guy out and see how stable it is and get the code locked in.  Then time to make some choices and get it on a perf board, then I can start thinking about PCB fab prototyping.

     

    image

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Robert Peter Oakes
    0 Robert Peter Oakes over 9 years ago in reply to tibmeister

    your using the FET as  switch, not a linear device, so think of it as a mechanical switch, it is either open or effectively a short (A few milliohms anyway) so you wont be able to use the ADC to measure the voltage reliably, what you could do is measure the supply voltage and then derive a pulse width to give you the 1.5 or 5 volts

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • tibmeister
    0 tibmeister over 9 years ago in reply to Robert Peter Oakes

    Thought about that but I wouldn't be able to account for any variance in the supply voltage and make real-time adjustments.  One thing I did notice when probing between HB and the drain of the 2N7000 was that when I was on the high duty cycle I was reading about .0951V and on the lower duty cycle I was reading 4.25V.  It struck me that if I subtract those from the 6V supply then I am seeing the voltage of the sensor's heater, or rather the voltage differential between the supply and the heater.

    Are my observations correct?  If so then my plan is to measure for that voltage, keeping it around 1V on the high duty cycle to provide 5V to the heater, and 4.4V on the low duty cycle to provide 1.6V to the heater.  Man I hope I'm on the right track!

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Robert Peter Oakes
    0 Robert Peter Oakes over 9 years ago in reply to tibmeister

    If your measuring with a DMM then it may not be accurate as (Depending on the DMM) it may not be correctly interpreting the PWM based voltage

     

    You can however correctly measure the supply voltage, you may need a resistor divider for the Heater and supply it it is relatively simple

     

    Using the internal Band Gap reference voltage instead of the supply (1.1V vs maybe 5 ish volts and also provides more accuracy) and hooking up one analog input to the supply via a divider, same for the Sensor Voltage you can adapt the PWM with some simple math. right now as your using the Supply to the ATTiny as the VREF is is going to drift around anyway, this will make the measurements more stable and therefor accurate. You can adjust any inaccuracies in the resistors using software

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • tibmeister
    0 tibmeister over 9 years ago in reply to Robert Peter Oakes

    I will break out the oscope and check it out to see what is moving through the circuit.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Robert Peter Oakes
    0 Robert Peter Oakes over 9 years ago in reply to tibmeister

    Any news ??

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • tibmeister
    0 tibmeister over 9 years ago in reply to Robert Peter Oakes

    I got side-tracked by a code issue with timers but I will mock up a simple "pulse regulator" to test the VCR theory with the oscope on it tonight.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • tibmeister
    0 tibmeister over 9 years ago in reply to tibmeister

    Ok, so here's the screen shots of the scope at the drain of the FET.  The first one is at 10% duty cycle and the second one is at 88% duty cycle.  I am at a loss to try and figure out how to monitor the voltage going to the heater, I can feel the heater temp going up and then back down, so that's something but I don't know if I'm in the correct temp range though.

     

    Now, as this seems that this is a working VCR that I am controlling through a uMC I now have to figure out how to select the "correct" answer because I think there's been such awesome contributions that all the answers led to the correct solution image

     

    image

    image

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Robert Peter Oakes
    0 Robert Peter Oakes over 9 years ago in reply to tibmeister

    Not sure why there is 320mV offset when the fet is on but lets assume it is just the high (Relative) resistance of the fet and its the same for both, so we know the peak volts (6.08V) and it clearly shows the delta which is the volts across the heater (5.76V), this is not the average but the actual change from off to full on for the FET. so to get the desired voltage of 5V you need 5/5.76 * 100 duty cycle so about 87%, to get an average of about 1.4V you will need 1.4/5.76*100= 24%

     

    so all you really need to know is how many volts are applied tot he heater when the FET is on, then what percentage of that as a duty cycle is needed to make the average = what you need. Simple once you know image, no need to measure, just calculate.

     

    Now if you change the FET or the 6V supply then you may need to re-calculate the constants but this keeps it simple.

     

    You could use a calibration sub routine to turn on the FET for an instance, measure the volts across the heater, then use that to calculate the duty cycle automatically but that's down to you and how complicated you need this to be

     

    Have fun and I hope you learned plenty so far. Sorry I did not just give you the answer but I bet you agree you learned a lot over the last week or two

     

    Peter

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • tibmeister
    0 tibmeister over 9 years ago in reply to Robert Peter Oakes

    Are you kidding, I've actually begun to understand this stuff much more than I thought I would and that alone is priceless.

     

    As for the offset, Rds(on) is 5.3 ohm and the current drain from source to drain is 70mA so that's pretty dang close to the voltage drop observed considering I'm not fully on at the gate.

     

    So you confirmed my other theory which is to use the desired voltage / Vcc then take that and multiply by 255, or 100% duty cycle to determine the analogWrite value I need and just on that hunch I came up with the same numbers! 

     

    So absolutely, I didn't come here to be spoon fed but rather to learn and that I can say I did in spades.

     

    So so now armed with the MOSFET VCR knowledge and finding the bug in my code I am armed to bear And with the understanding I've gathered I can repeat this and pass the knowledge on as well.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Reply
  • tibmeister
    0 tibmeister over 9 years ago in reply to Robert Peter Oakes

    Are you kidding, I've actually begun to understand this stuff much more than I thought I would and that alone is priceless.

     

    As for the offset, Rds(on) is 5.3 ohm and the current drain from source to drain is 70mA so that's pretty dang close to the voltage drop observed considering I'm not fully on at the gate.

     

    So you confirmed my other theory which is to use the desired voltage / Vcc then take that and multiply by 255, or 100% duty cycle to determine the analogWrite value I need and just on that hunch I came up with the same numbers! 

     

    So absolutely, I didn't come here to be spoon fed but rather to learn and that I can say I did in spades.

     

    So so now armed with the MOSFET VCR knowledge and finding the bug in my code I am armed to bear And with the understanding I've gathered I can repeat this and pass the knowledge on as well.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Children
  • Robert Peter Oakes
    0 Robert Peter Oakes over 9 years ago in reply to tibmeister

    image I'm used to using FETS with an RDS On of about 20 mOhms rather than over an ohm so ok, that makes sense then

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • tibmeister
    0 tibmeister over 9 years ago in reply to Robert Peter Oakes

    Maybe I'm reading the datasheet wrong?  I'm still a noob so won't say I'm not, but going off a rough estimate of Vgs being 4.5V comes to 5 ohm max.  Just below the Vds(on) shows a .4V drop @ 4.5V Vgs, so pretty close in my book and it does match with observations. 

     

    Am I reading this all correctly and understanding it correctly?

     

    image

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube