avrdude with arduino won't reset with simple 2N2222 transistor circuit? - Page 1
Forum section: electronics / general

author: sofakng
author_rank: Regular Contributor
timestamp: May 31, 2021, 06:34:42 pm
content: I'm trying to use a transistor to create a simple reset circuit between a Raspberry Pi (3.3v) and Arduino Micro (5v).I'm using the following simple circuit:2N2222 (base) -> 390 Ohm Resistor -> Raspberry Pi GPIO (3.3v)2N2222 (emitter) -> GND2N2222 (collector) -> Arduino RST (5v)I'm testing with avrdude and I can see the pin invert/reset but avrdude can't communicate with the device.I don't want to risk damaging the Raspberry Pi (3.3v) by directly connecting to the Arduino RST (5v).

author: DavidAlfa
author_rank: Super Contributor
timestamp: May 31, 2021, 07:07:42 pm
content: How much time do you wait with RST low? Are the GNDs connected together?10K for the base is more than enough to drive a signal low.

author: sofakng
author_rank: Regular Contributor
timestamp: May 31, 2021, 07:18:38 pm
content: Here is the schematic I'm using. It's from the PiKvm project:

author: WattsThat
author_rank: Frequent Contributor
timestamp: May 31, 2021, 08:12:44 pm
content: How are you powering the Arduino Micro?

author: T3sl4co1l
author_rank: Super Contributor
timestamp: May 31, 2021, 08:20:28 pm
content: The ground rails aren't shown connected. Does the level shifter have common ground?Tim

author: gamalot
author_rank: Super Contributor
timestamp: May 31, 2021, 08:46:05 pm
content: If you are using 2N2222 in TO92 package, you have to be careful that there are two different pinouts, one is the EBC pinout which is the same as most transistors in TO92 package, and the other is the CBE pinout used by ON Semiconductor’s P2N2222A.https://pdf1.alldatasheet.com/datasheet-pdf/view/277968/SECOS/2N2222A.htmlhttps://www.onsemi.com/pdf/datasheet/p2n2222a-d.pdf

author: sofakng
author_rank: Regular Contributor
timestamp: June 01, 2021, 12:51:51 am
content: Quote from: T3sl4co1l on May 31, 2021, 08:20:28 pmI've checked with a multimeter and the Raspberry Pi and Arduino are sharing a common GND.Quote from: gamalot on May 31, 2021, 08:46:05 pmThe part I'm using is generic and only shows "2N2222" on it. Is there a way I can determine the base, emitter, and collector?How long after the RESET is trigger can the SPI programmer (avrdude) communicate?For example, if I reset the atmega32u4 and then wait something crazy like 30 seconds, I won't be able to program it, right?I'm wondering the timings so I can also check on the oscilliscope how long after the reset is triggered that avrdude is sending SPI communication.

author: DavidAlfa
author_rank: Super Contributor
timestamp: June 01, 2021, 01:47:12 am
content: Set the DMM in diode mode.Put the positive in one pin and test the other 2 with the negative.The base is the pin that makes voltage drop with the other 2.The B-E junction voltage is slightly higher than B-C.Ex. If you get 627mV and 645mV, the emitter is the pin that makes 645mV.

author: gamalot
author_rank: Super Contributor
timestamp: June 01, 2021, 10:30:47 am
content: I am sorry that my previous post may be misleading. It is true that 2N2222 has different pinouts, and their C and E are swapped. After I read your post again, I noticed that when the resistance connected in series to the base is small enough (the simulation result is no more than 47K ohms), even if C and E are swapped, your circuit should still work as you expected.