I have 2 ATTiny85 and a NPN CS-9011 used as a switch. They are both powered by the same 3.3V. I use pin 1 to run the base of the transistor with a 1K resistor. This is not working after an afternoon of tests. I can turn on a sensor, tested with BME280, with this set up but not an ATTiny85. Should I use another Transistor? Or can someone show me that the calculation that my Base resistor is wrong?

ATTiny85 Maximum DC Current per I/O Pin 40 mA

ATTiny85 turn on ATTiny85


  • 1
    \$\begingroup\$ What is the measured voltage on the switched tiny85? Note that switching 0V aka ‘low side’ is generally avoided as you can have ‘sneak paths’ via the other connected pins. Eg with the bme280 current can flow back through the I2C or SPI signals. \$\endgroup\$
    – Kartman
    May 5, 2022 at 1:38
  • \$\begingroup\$ I will avoid that then. Yes I suspected that current flowed by another way. I could not find one picture on the net that use an ATTiny85 to control an ATTiny85. I will report in a few days. Thank you \$\endgroup\$
    – pierre
    May 5, 2022 at 14:14
  • \$\begingroup\$ Here is some measured voltage: I used the the CS91011 on the low side(sorry) and a blue LED with a resistor on pin 3 just to see that the tiny85 on top, in the picture, is up. No sensor and no 1K at the Base(!?). it is working... no smoke. OK voltage up 3.16V and Voltage down 0.62V. This is not what I want of course I want 0V down. Measure is done between VCC and GND pins of the A85 on top. \$\endgroup\$
    – pierre
    May 11, 2022 at 0:13
  • \$\begingroup\$ When I say working I mean that I see the LED turning ON and OFF which is HIGH when the A85 at the top get 3.16V. (could not edit my previous comment.) \$\endgroup\$
    – pierre
    May 11, 2022 at 0:33
  • \$\begingroup\$ Hmm after fooling around with cable and components, top voltage is 2.30V and down is 0.61V and of course the LED does not light anymore. Why did it work before? lot more try and troubleshooting. \$\endgroup\$
    – pierre
    May 11, 2022 at 3:47

1 Answer 1


Switching power from the GND pin on the ATtiny85 is rather unorthodox way of controlling the supply of a uController but hey, whatever it takes. Perhaps you should consider utilizing a PNP transistor and power the tiny85 with it's collector instead. GND is GND is GND. Some weird things can happen via the other pins of the tiny85 when its GND pin is not tied to GND.

One possible problem may be from the CS9011 that is not bringing the tiny85 GND pin low enough. A transistor that have a max collector current of 30mA is definitely not the best candidate for switching power. If you really insist on this configuration you may want to consider changing the CS9011 for a VN2222 MOSFET. the ON resistance is 7 ohms, surely enough to bring that pin to GND adequately.

Here is another possibility:
enter image description here

  • \$\begingroup\$ OK let's change for the collector side and find a MOSFET that match the VN2222 in the land of disappearing component. GND is GND, thank you. \$\endgroup\$
    – pierre
    May 5, 2022 at 14:08
  • \$\begingroup\$ @pierre - If you are not in a hurry check AliExpress or Digikey. The go for less than $1 each \$\endgroup\$ May 5, 2022 at 14:17
  • 1
    \$\begingroup\$ @pierre, Both these MOSFET could work for your application. One doubt I have is about the Vg value (from 2 to 4 V) if you supply the Tiny85 with 3.3v the output of an IO pin may not be sufficient to trigger the MOSFET. The VN2222 show a Gate Threshold of maximum 2.5V, that is more on the safe side for a 3.3V supply ( still low but better than 4V) . Make sure you respect Gate Source and Drain pin configuration. \$\endgroup\$ May 16, 2022 at 15:53
  • 1
    \$\begingroup\$ ATtiny85 VOL is maximum 0.5V when powered with 3V. VOH is minimum 2.5V. An N MOSFET the gate threshold must be lower than 2.5V. With P MOSFET, its gate threshold must be higher than -2.5V. Voltages are near limits . Perhaps is the reason why it does not work with FQP, the datasheet mention gate threshold between 2.5 up to 4V. I posted another schematic using PNP 2N3952. Probably many other models may fit the bill. the 2N3952 has a collector current of 200mA and VCE(sat) of max 0.4V which should low enought lost to still permit adequately source enough voltage to power a second ATtiny85. \$\endgroup\$ May 19, 2022 at 14:46
  • 1
    \$\begingroup\$ 2N3962 is just an example. Any PNP that can handle 200mA collector current and a decent gain can do the job. Chances are you may have a unit that will do the job in your scrap box. \$\endgroup\$ May 26, 2022 at 17:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.