Go Down

Topic: Transistor PNP (Read 820 times) previous topic - next topic

Igor16

I'd like to use a transistor PNP like a reverse switch, so when i cut the blue cable in the picture i want to turn on the current in pin 8 of Arduino... i think i made a wrong circuit in the picture... this is the datasheet of the transistor(mine is bc557).. can you show me the correct circuit? thanks a lot

CrossRoads

Something like these.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Archibald

. . . . .  i want to turn on the current in pin 8 of Arduino...
Virtually no current goes into pin 8.

To detect whether the blue wire is cut, connect the blue wire directly from pin 8 to ground (GND). There is no need for a transistor. In your Arduino code use pinMode(INPUT_PULLUP) to enable a pull-up resistor within the Arduino's microcontroller chip. The blue wire connected to ground will keep the input at a 'low' logic level, but when it is cut the pull-up resistor will make the input go to a 'high' logic level.

Igor16

i want to use this pnp transistor because i've seen that arduino always reads immediately from low to high, but from high to low sometimes it takes 3-4 seconds.. i can't understand why you put the resistors in that scheme, can you tell me why? thank you all

DrAzzy

i want to use this pnp transistor because i've seen that arduino always reads immediately from low to high, but from high to low sometimes it takes 3-4 seconds.. i can't understand why you put the resistors in that scheme, can you tell me why? thank you all
High to low and low to high can both be detected immediately by the Arduino.

If they're not, you're doing something wrong - probably you're just disconnecting the wire from the pin, but have not put in a pullup or pulldown resistor to ensure that it goes high or low when not connected to anything. As noted above, if you're connecting the pin to ground, you can use the internal pullup to ensure that it reads high unless it's connected to ground.
ATTinyCore for x4/x5/x61/x7/x8/x41/1634/828/x313 megaTinyCore for the megaavr ATtinies - Board Manager:
http://drazzy.com/package_drazzy.com_index.json
ATtiny breakouts, mosfets, awesome prototyping board in my store http://tindie.com/stores/DrAzzy

Wawa

Tell us WHY you think you need a transistor.
Leo..

Igor16

with the pullup it works very well!!! thank you all

Go Up