Go Down

Topic: Is my select of resistor ok for PN2222A base? (Read 1 time) previous topic - next topic

sineverba

Jul 09, 2017, 07:36 am Last Edit: Jul 09, 2017, 07:42 am by sineverba
Hi to all!
Background:

I did bootload an Atmega @8Mhz with BOD disabled. I feed it with 2XAA in series (~ 2.74volt when full charged and 1900mah).

I did read a DHT22 and send every 10 min data to a gateway (MySensors installation), all other time the Atmega sleeps.

The DHT22 min voltage is 3.3V, so I did buy this: https://www.amazon.it/gp/product/B06XHJCHX6/ref=oh_aui_detailpage_o00_s00?ie=UTF8&psc=1 and regulated exit to 3.3v.

So, battery direct to Atmega and Radio NRF24L01, both to 2.74 (and less) and fixed voltage at 3.3V for the DHT22.

All works in a breadboard, but I don't understand what's the quiescent current of MT3608 (here the datasheet: https://www.olimex.com/Products/Breadboarding/BB-PWR-3608/resources/MT3608.pdf ), cause data report different PFM and PWM.

So, I'm using the worst scenario: 2.2mA wasted. When full charged, battery last only for 1900/2.2 = 863h = ~ 35days . With data send ant other operation... not so efficient.

So, I thought to cut the ground of the booster with a NPN transistor (PN2222A , datasheet: https://www.onsemi.com/pub/Collateral/PN2222-D.PDF) and active from asleep the transistor, read, put outpit pin to low, send data and sleep.

Because the DHT22 only consume 1.5mA when reading (datasheet: https://cdn-shop.adafruit.com/datasheets/Digital+humidity+and+temperature+sensor+AM2302.pdf ) the PN2222A can supports the 5V from an Atmega PIN and the current beetween C-E.

I want connect the Ground of booster to the COLLECTOR of transistor and EMITTER to the rail ground, with a PIN moving the base.

1 - First question: is it right to put "ground" from booster to collector and base TO the ground rail of breadboard?

If I did understand, when I want saturate base the current need to be ~ 1/10 of the collector. All right? (From page 2 of datasheet, (IC = 150 mAdc, IB = 15 mAdc) under Collector−Emitter Saturation Voltage.

So, if all right, I can drive with max 20mA from Atmega (well below the 40mA max).

And so... final formula: ( 5V (Atmega) - 0.7V (drop) ) / 20mA (or 0.02A) == 215Ohm resistor.

Am I right?

Thank you very, very much!

Grumpy_Mike

Quote
1 - First question: is it right to put "ground" from booster to collector and base TO the ground rail of breadboard?
No it is not. This gives you a ground of a different voltage.

If you want to remove the power from a converter like this then cut off the input power with a PNP transistor.

sineverba

mmm... The two grounds are totally separated...

I did draw a simple (not correct, I know!) schematic just to render the idea.



But, if instead do you tell me - another time - that I need a PNP instead of NPN .. could you point me some tutorial that explain why in my case I need a PNP?

Understand me: I have no doubt in you but I want study and not only the "ready things done" :) :)




Grumpy_Mike

Quote
I did draw a simple (not correct, I know!) schematic just to render the idea.
It renders nothing, it is total crap. It is not even a schematic.

Grounds have to be common for things to work.
Have a read of this


high-side-switching

septillion

Wouldn't it all be easier if you just used a sensor that can go lower? For example the the Si7021 or a BME280 which are (I think) more accurate then a DHT22 as well.
Use fricking code tags!!!!
I want x => I would like x, I need help => I would like help, Need fast => Go and pay someone to do the job...

NEW Library to make fading leds a piece of cake
https://github.com/septillion-git/FadeLed

sineverba

It renders nothing, it is total crap. It is not even a schematic.

Grounds have to be common for things to work.
Have a read of this


high-side-switching
It was for render the idea. Sensor take voltage totally disconneted from the atmega.  Only link is the PIN reading the data.

Battery direct to atmega, via booster to the sensor.

sineverba

Wouldn't it all be easier if you just used a sensor that can go lower? For example the the Si7021 or a BME280 which are (I think) more accurate then a DHT22 as well.
Thank you for the hint. I will explore other 2 sensors.

By the way, for the moment my node ad descibed works very well: what do you think about my original idea (1st post) ?

Thank you

septillion

You mean with transistor?

It has some pitfalls like phantom powering things etc.
Use fricking code tags!!!!
I want x => I would like x, I need help => I would like help, Need fast => Go and pay someone to do the job...

NEW Library to make fading leds a piece of cake
https://github.com/septillion-git/FadeLed

sineverba

You mean with transistor?

It has some pitfalls like phantom powering things etc.
So.... If I cut the ground via NPN, current could be find his way to the PIN of the MC connected to read the DHT22... all right?

septillion

Half answering my questions, then I'll do the same to make it easy ;)

https://www.youtube.com/watch?v=2yFh7Vv0Paw
Use fricking code tags!!!!
I want x => I would like x, I need help => I would like help, Need fast => Go and pay someone to do the job...

NEW Library to make fading leds a piece of cake
https://github.com/septillion-git/FadeLed

Grumpy_Mike

Quote
It was for render the idea.
In English those words mean nothing.

Quote
Sensor take voltage totally disconneted from the atmega
That is not possible, it will not work without a common ground.

sineverba

Half answering my questions, then I'll do the same to make it easy ;)

https://www.youtube.com/watch?v=2yFh7Vv0Paw
Sorry, I saw the video... but I didn't understand what do you mean with your words :)

Go Up