A: How can I use a 2N2222 transistor as a temperature sensor?
Question How can I use a 2N2222 transistor as a temperature sensor? I’m supposed to use a TMP36 transistor for a class to read the temperature of the environment, but I only have a 2N2222 transistor; the Arduino will have an analog read of it, but the numbers won’t change even if I heat it up. Am…tlfong014419@Sredni Vashtar, Many thanks for your very important and critical warning. Do you know why some chips have the two terminals inverted? In my long electronics hobbyist life, I have never heard of such a ridiculously dangerous pinout trap, for newbies, ninjas, and even pros alike.@glen_geek. Ha, many thanks for your instruction, which I think is simple and concise. I must confess I don’t know at all your rationale or theory behind. But it so simple, so I guess both me and the OP which I guess is around 16 old student can also blindly follow your tip, and then do some measurement to see if your circuit might lead to anything promising. Then I will study the datasheet or other theories behind, and try to find why you suggest your design. / to continue, …I now see our approach is odd, because it is not like the photo transistor, which sort of using CE junction, without electrical but only photo/light input from base. Of course I know I can just use a diode, which according to the (Schottky?) diode equation, is current dependent to temperature. Anyway, I will stop selfie brainstorming, and start experimenting @glen-geek’s geek tip..@glen_geek, now I have set up the test circuit to test out your suggestion of using 1MR for Rb, varying Rc and see how it goes. I have also update the circuit and put it at the very top of my answer. Comments and counter suggestions welcome. Cheers.@Voltage Spike, Thank you for your advice. Actually some of the suggestions and tests in my answer are out of date, misleading and plain wrong. So I have decided to set up a GitHub page, and place the datasheet summaries there. This way I can make my answer perhpas many times shorter, and only refer to my GitHub page for not too relevant details. Thanks again. Cheers.@Sredni Vashtar, I agree with you that the vendor packages 2N2222 with pinouts as ordered by the Japanese buyers. I also notice that the new datasheets provide different styles of pin layouts for customers to order.@Transistor, Ah yes, I am not surprised to discover that the OP is just a 15 year old student and a member of a computer hobbyist club in his school. My thinking is that he might be happy if we guide him to read the datasheets and how he can convert the 2N2222 into a temperature sensor, however crude or non linear his converter sensor it is. I guess even the designer of TMP36 is doing some sort of curve fitting/straighten to make final product linear and accurate. We might explain to the OP, that even if we cannot DIY a temperature sensor with accuracy of 0.5 degree. / to continue, …But in many applications, eg, measuring the temperature of warm water in a bath, or even room temperature to control air conditioner/heater, an accuracy of two degrees is acceptable. My objective in making this answer is educational, learning how to read a datasheet, idea of non linearity and how to use software to workaround. Accuracy is never a requirement in my suggested DIY sensor, because it is not supposed as a accurate scientific instrument. / to continue, …As you said, grasping concept, doing/learning/appreciating engineering design, trade off, cost benefit analysis, and the joy of DIY/making things or just a toy, even the project ends up a “failure”, is important, not accuracy or applicability Tony Stewart Sunnyskyguy EE75When you combine a fairly accurate – 2.2mV/’C NTC characteristics of the Vbe with base-collector shorted and then use a common emitter with hFE changing with T you get an inaccurate temperature sensor. -1but great effort tlfong014419@Tony Stewart Sunnyskyguy EE75, Ah yes, everybody is talking about the magic number Vbe 2.2mV/C°. However, I am just a high school student, and my cheapy multi-meters have a ridiculously tiny current range of 2mA.And the real scientists are talking about the μAs. So the whole world’s high school students are weep in the dark.:(@Tony Stewart Sunnyskyguy EE75, If you watch the videos in my reference list #20, 21, which I suppose are the “best” YTs on this subject, because Google ranks them at the very top. I do think that the alien EE engineers in our neighour galaxy are now LOLing at our high school students weeping in the dark. Tony Stewart Sunnyskyguy EE75I don’t consider any of those YT’s video’s as expert design references tlfong01Ha, yes, the 2.2mV/C° elites are laughing loudly at the YTs, which of course are newbies’ sorrows. Tony Stewart Sunnyskyguy EE75yst 16:34actually the tempco increases from -2.0 to -2.2 as the current is reduced to 1uA. Any self heating is undesirable too with small plastic parts @ 0.2’C/mW tlfong014419Ha, so I need to get a volt meter in 10 μA range? You remind me that ages ago, when I was educated in college to become an engineer. I was told that any engineer worth his salt must always remember 6 words by heart: (1) Reliability, (2) Tolerance, (3) Accuracy, (4) Trade off, (5) Benefit, (6) Cost. Ah, I am missing my locking down lunch. Nice chatting with you. See you later.I remember very vividly, that not too many years after my graduation, I learned many more things that I found very useful in my work, including the following:(1) Appropriate Technology,(2) Second Sourcing,(3) Quality Control and Assurance,(4) Risk Analysis and Control (MTBF, Black Swan Theory (sort of).And the very important thing is the following:(5) Info/Enggr System Analysis and Design（ISAD）My journey in EE ended abruptly when most of the plants (including FairChild, Motorola, National Semi, Ampex, …) closed and or moved North. So I switched to software engineering, then to IT, … from transistor to IC, to MSI, LSI, to uP, to MCU, to SBC, to …Long story short, I am all the way back to transistor, to 2N2222, …And let me explain my 2N2222 temp sensor development with the following two things:(1) User Requirement and Constraint,(2) Functional Spec,(3) Selection of Development Methodology (WaterFall, Protopyping, … Agile, …)What I am now messing around withe the OP’s 2N2222 question is based on the Agile Methodology, which I see it as so called “Rapid Prototyping”, or “Meddling Through”,..I also see the OP’s question as a case study of PBL (Problem Based Learning) where I don’t expect a clean solution. I think it would be nice, if me and the OP failed in all our suggested approaches, because we can “Learn by Mistake”, the more mistakes we make now, the more lessons we learn, …I am just doing a selfie walkthrough of my electronics journey along a long and winding road, …Just brainstorming/thinking aloud, sorry for all the typo mistakes.I used to tell the newbies that my project development does based on the expert’s ideas, and the following is the text book I have been reading:System Engineering Analysis, Design, and Development: Concepts, Principles, and Practices – Wiley 2nd Ed Charles S Wasson
amazon.com/…For students such as the OP, I usually recommend the free 1st Ed eBook, because the basic concepts and recommendations by Prof Wasson are still up to date and very good. 1 hour later… Tony Stewart Sunnyskyguy EE7599.7kyst 18:24The question needs more specs on range and accuracy not more analysis. Was it for room temp with 0.5′ accuracy or -40 to 50’C with 2’C accuracyThe kid was high schoolhe just needed a current source a transistor as a diode and an amplifier or a $5 DMM 20 hours later… tlfong01441914:03(2) Let us deal with your second suggestion first. I agree with you that everybody says the best solution is to short the transistor’s CB and made it a diode then use the 2.2 mV and follow, say what you suggest, use a current source to apply constant current to the diode and the problem is almost solved.But our customer might not be very happy to what you suggest for two reasons, (a) He asks for the transistor question, but you twisted it to a diode question,Your suggestion is worse than the following: “Throw away the 2N222 and found a diode, just any diode, and search google for “2.2mV”, “Diode, temperature, sensor”. The point is that the OP might have spent hours on biasing the transistor, perhaps in the wrong way as I biased it as a switching transistor, in the saturated mode.If he shows me a photo or a schematic, I would repeat his situation and found that I actually did not know how to use 2N2222 as an amplifier. Then by trial and errors I found that I should bias it in the current amplification region and solved the problem. Now the OP might need to only change the Rb of Rc and solved the problem, and understand and learn how to use the transistor in two ways, as a switch and as a small signal amplifier. That is what I said “PBL”, / to continue, …If the OP already reported his problem to his teacher, of course the EE SE’s reputation will be damaged if the teacher know the quick and dirty solution is to forget and twist the old question, … You remind me what we enggr usually says “Necessity is the mother of invention”.Even I have no necessity for now, I usually browse a couple of forums and if newbies have any necessity, and I would try to invent or innovate to let the OP become sort of a spiritual rich guy with no necessity, because all problems solved, … 😦(1) Let us go back to your first suggestion of “Let us don’t do any analysis, and just start with the spec (temperature range and accuracy)” which does make me laugh, because it is just non engineering, / to continue, …
Leave a Reply