« first day (1557 days earlier)      last day (3372 days later) » 
00:00 - 12:0012:00 - 13:00

Anonymous
12:34 AM
@jippie @Shalvenay can I have a word with either of you?
 
12:52 AM
@PatoSáinz -- sure, fire away
 
Anonymous
@Shalvenay I'm having a lot of trouble with a really dumb and common circuit
 
interesting, got a schematic and some symptoms?
 
Anonymous
let me draw up something in paint because now I'm really doubting about everything I've wired, hell, I've been a whole week into this and I still cannot get it to work
 
Anonymous
@Shalvenay k I'm almost done drawing but the problem basically is that I cannot get my PNP transistor to output current to the collector
 
Anonymous
literally everything is going to the base
 
1:01 AM
so Ie = Ib basically? O.o
 
Anonymous
and I'm using that PNP transistor to switch on and off (controled via my raspberry pi) a current that goes through a 12v relay coil
 
Anonymous
@Shalvenay I'm doing this:
 
Anonymous
 
Anonymous
but instead of that NPN
 
Anonymous
I'm using this PNP
 
Anonymous
KN2907/A
 
Anonymous
I've tried googling everything, reading a ton of examples, theory on PNP vs NPN but nothing
 
Anonymous
I still can't get my circuit to work
 
Anonymous
 
1:19 AM
@PatoSáinz Say, how is your PNP wired?
 
Anonymous
last config I tried was: collector to 0v (12v supply return path), emitter +12v and base to also 0v
 
Anonymous
but I've tried almost every possible combination, permutation, prayer and ritual and I still can't get it to work
 
I think a lot of the problem is that you want to be switching on the high side with your PNP
you just aren't able to turn it on :P
 
Anonymous
probably
 
Anonymous
I mean, I thought it was as simple as "PNP is the opposite of NPN", "if you want current to flow then don't supply from base, unlike NPN"
 
Anonymous
1:32 AM
but I'm troubled as hell
 
I have to go eat though
 
Anonymous
go replenish your tank, I can just wait :)
 
1:51 AM
back
but yeah -- how much emitter current are you getting?
 
Anonymous
2:38 AM
@Shalvenay i don't quite remember... also I just unwired everything and I'm back to zero
 
2:51 AM
@Pato -- the thing is that you need to forward-bias the B-E junction in order for a transistor to turn on
 
Anonymous
@Shalvenay I followed the instructions that this lovely page (radartutorial.eu/21.semiconductors/hl20.en.html) provides on how to forward bias-for dummies and I still can't get it to work... Could you please explain please?
 
@PatoSáinz -- with a PNP, the base needs to be at a lower voltage than the emitter in order to turn the transistor on
 
Anonymous
@Shalvenay and so I did
 
Anonymous
2 hours ago, by Pato Sáinz
I mean, I thought it was as simple as "PNP is the opposite of NPN", "if you want current to flow then don't supply from base, unlike NPN"
 
right...
what do you want your relay driver to do?
 
Anonymous
3:12 AM
I want my relay to go from NC to NO, which means that it should need 12V and enough current to defeat its 400 Ohm coil resistance (datasheet: omron.com/ecb/products/pdf/en-g5la.pdf), for this, I plan to use the PNP transistor to just supply the relay with electricity until I apply my 3.3V the raspberry pi can do from its gpio to the base, which should block current from flowing throughout the PNP and trigger a change of state of the relay
 
3:33 AM
so you want HIGH to turn off the relay
 
Anonymous
yes
 
try putting the resistor in series with the base, the other end of the resistor to the GPIO
 
Anonymous
or in more broad terms, I just want to make HIGH from my RasPi to be state NX in the relay and LOW from my RasPi to be state NZ... just to have a change of state when my raspi turns on and off the gpio
 
Anonymous
@Shalvenay how many ohms should the resistors be?
 
value for the base resistor is non-critical, I'd start with 1k or so
wire the emitter to the relay coil, the collector to ground, and the other end of the relay coil to 12VDC
 
Anonymous
3:40 AM
will do right now
 
Anonymous
@Shalvenay I have an 800 Ohm resistor handy, will try with it
 
Anonymous
@Shalvenay done
 
Anonymous
4:00 AM
nothing's happened
 
Anonymous
;_;
 
@Pato -- is the relay off all the time, or on all the time?
 
also, what's the voltage you're getting at the emitter when you put a HIGH into the circuit?
 
Anonymous
@Shalvenay I have done your setup, I'm currently doing +3.3V into the base pin from my GPIO port, and the relay is like I've never powered it, but, disconnecting the power from the raspi doesn't change the relay's position
 
Anonymous
4:03 AM
I'm going to measure the voltage...
 
Anonymous
@Shalvenay voltage at the emitter relative to...?
 
ground
 
Anonymous
16.05 (this 12v transformer overvolts a little more than specified)
 
@PatoSáinz -- the transistor is not turning ON then
 
Anonymous
@Shalvenay so what should I do 'bout it
 
4:06 AM
@PatoSáinz -- I wouldn't use a PNP for this job
 
Anonymous
what'd you use, a NPN?
 
I'd use a NPN instead
 
Anonymous
let me check my scrapbox for npns
 
Anonymous
@Shalvenay got this fairchildsemi.com/datasheets/FJ/FJP13009.pdf from fairchild
 
Anonymous
an NPN
 
4:44 AM
yeah
wire it up collector to the coil, base to resistor, other end of resistor to GPIO, emitter to ground, other end of coil to Vcc, and don't forget the diode across the coil (cathode of diode to Vcc, anode of diode to collector of transistor
 
aep
anyone knows a site where discussion of component choice is allowed? Could be useful every now and then.
 
 
2 hours later…
Anonymous
6:18 AM
@Shalvenay built your circuit (without the diode because protection isn't the first of my concerns, I'd rather have it working first) but no luck yet
 
7:16 AM
morning
 
Anonymous
morning @jippie
 
Anonymous
sorry to bother you this early but could you please help me out with this darned circuit?
 
@PatoSáinz The circuit as drawn will only work with an NPN, you can't just replace it with a PNP
 
Anonymous
@jippie of course I took that into consideration
 
Anonymous
but now I'm following the schematic properly
 
Anonymous
7:24 AM
with an NPN
 
Anonymous
and a proper 5 kOhm resistor
 
Anonymous
and the schematic which is the same @Shalvenay has directed me to
 
Anonymous
and still nothing
 
Anonymous
I'm stuck
 
5k may be a bit on the high side. Do you have a meter so you can check what's going on?
 
Anonymous
7:29 AM
@jippie also tried with just 800 Ohm, nothing. Also, of course I've got a multimeter, tell me where to probe and I'll do it :)
 
start with the voltage between ground an the gpio pin, which voltages does it toggle between?
 
Anonymous
currently the GPIO pin is sending 3.2V (its logical 1)
 
and if you toggle GPIO off?
and with your little circuit attached of course.
 
Anonymous
yea yea everything's being probed live
 
@PatoSáinz with the GPIO high, what voltage is at the transistor collector?
 
Anonymous
7:41 AM
@jippie GPIO's 0 here is 0.05 volt
 
Anonymous
@Shalvenay will test
 
Next check what the voltage at the transistor base, both high and low.
 
Anonymous
@Shalvenay @jippie relative to where?
 
always relative to ground unless explicitly otherwise specified.
 
Anonymous
gnd?
 
Anonymous
7:44 AM
oh ok :)
 
that's one of the basic rules in electronics :o)
 
Anonymous
the more you know
 
Anonymous
ok now probing
 
Anonymous
@Shalvenay 16.17V
 
Anonymous
checking base now
 
7:48 AM
both high and low.
 
Anonymous
@jippie base vs earth, gpio high -0.11V
 
Anonymous
now low...
 
black probe on ground, another basic rule "unless explicitly otherwise specified"
 
Anonymous
@jippie black probe is in ground
 
and you get a negative voltage?
 
Anonymous
7:51 AM
GPIO low, base vs earth, -0.56v
 
@PatoSáinz -- what voltage do you get from the collector to ground with the GPIO high?
 
Anonymous
@jippie I guess, god I'm not made for hardware
 
the base voltage is wrong, it can never work. Also if you are really measuring / connecting things relative to ground, your voltage cannot drop below 0
 
Anonymous
@Shalvenay 16.19V
 
Anonymous
@jippie I'll double-triple check your instructions
 
7:53 AM
If I were you I'd remove the 12V power supply for now.
 
Anonymous
@jippie ok, I'll follow your instructions... but then how would I probe for voltage?
 
Use the 5V power supply until thing start working as expected. The relay won't work, but you should see the voltage toggle
 
Anonymous
ok
 
I think you made a wiring mistake
 
Anonymous
I'll use the Pi's 5V supply, is it ok?
 
Anonymous
7:55 AM
@jippie probably
 
@PatoSáinz sure, for troubleshooting purposes.
replacing the relay with a 1k resistor wouldn't hurt either, just to limit the currents while troubleshooting.
 
Anonymous
@jippie would a 9V battery (that for some reason its voltage has dropped to 8V work too?
 
Anonymous
because messing with the pi's gpio is a pain
 
Anonymous
 
Anonymous
 
Anonymous
8:02 AM
I want to tell anyone with skills in electronics viewing these photos: I'm sorry
 
@PatoSáinz Anyone truly enthusiastic of electronics probably started in a similar way.
Your soldering iron is ... suboptimal for electronics, it think it is like 100 or 150W and gets way too hot.
 
Anonymous
@jippie it is suboptimal
 
Anonymous
hell there's only that tip
 
Anonymous
so no precision soldering either
 
Anonymous
it's like using a hammer when you need a scalpel
 
Anonymous
8:08 AM
I want to get someday a good soldering station
 
Where do you connect to BBB's GND?
 
Anonymous
also, it's 120W so your estimate was right :). Ok I've got the 9V almost hooked up
 
Anonymous
@jippie BBB?
 
Anonymous
BeagleBoneBoard?
 
Anonymous
I'm not using any GND pins in my RasPi... did I royally f* it up?
 
Anonymous
8:12 AM
the only ground in my circuit is the return path of my ACDC 12V (it supplies 16V tho) transformer
 
@PatoSáinz black, oh you're using RPI?
 
Anonymous
yes I am
 
My fault I have two BBB's I'm troubleshooting on my desk.
 
Anonymous
ahhh hahaha
 
you haven't got a ground connection between your RPI and your little circuit?
 
Anonymous
8:14 AM
nope
 
Anonymous
just one pin connected
 
well there is one major problem then
 
Anonymous
GPIO, 3.3V
 
Anonymous
because safety or because it won't work?
 
because for electronics to work you always need a closed circuit
 
Anonymous
8:15 AM
 
like a light bulb also requires two wire to work
 
Anonymous
where's the return path of "from pi gpio"??
 
the ground symbol at the lower right should be connected to RPI GND
 
Anonymous
oh
 
Anonymous
damn
 
Anonymous
8:16 AM
wouldn't it fry my Pi?
 
Anonymous
getting like 12V when it's designed to merely do 3.3V in its pins?
 
if you do things properly, it shouldn't.
electronics is an unforgiving hobby in that respect. Unfortunately.
 
Anonymous
ok so you say I replace my converters ground with the raspi's ground pin and it should work?
 
Yup.
 
Anonymous
then my converter will have a return path too I guess
 
Anonymous
8:17 AM
ok
 
What was your base resistor again?
 
Anonymous
don't get fried pls
 
Anonymous
currently I'm using something like 5.2 kOhm
 
that's just fine for now.
 
Anonymous
ok
 
Anonymous
8:21 AM
ok wired it like you said
 
Anonymous
no changes
 
Anonymous
the relay still isn't switching
 
Anonymous
@jippie need any meter readings?
 
you did fiddle a bit with the circuit, so I'm not surprised it doesn't work yet.
Lets start at GPIO: What voltages do you measure between GND and GPIO pin? Both high and low.
 
Anonymous
@jippie gpio high: 3.28V
 
Anonymous
8:25 AM
gpio low: 0.06V
 
Anonymous
no negative voltages heh
 
ok, leave the GND probe at RPI, then probe the base pin of your transistor. Both high and low.
 
Anonymous
high 0.53V
 
Anonymous
low 0.06V
 
that looks roughly right
 
8:29 AM
high voltage is a bit on the low side, but it may work. I'd expect more like 0.6 to 0.7V
probe collector voltage now, both high and low
 
Anonymous
hmm nice directly from the pi's output the voltage is 3.28
 
Anonymous
but after the resistors at the base
 
Anonymous
it's 0.53V
 
Anonymous
didn't resistors only alter current?
 
@PatoSáinz -- Ohm's Law man
 
Anonymous
8:31 AM
(I'm currently ignoring ohm's law... there's probably some easy mental math I glossed over)
 
Anonymous
god damn it
 
Anonymous
I thought it wasn't necessary to do the mental math haha
 
Anonymous
@jippie probing collector
 
@PatoSáinz you'll get a feeling for it.
 
Anonymous
should I reduce R a little to raise the voltage at the base pin?
 
Anonymous
8:32 AM
collector: 0.03V high
 
Anonymous
0.60V low
 
@PatoSáinz no not yet, let's check how things work right now
 
Anonymous
why on earth did the voltage drop in gpio high at the collector if I'm using NPN not PNP
 
ok, decribe the circuit starting from collector going up.
 
Anonymous
@jippie what do you mean by that?
 
8:34 AM
@PatoSáinz GPIO shouldn't change, the base voltage is expected the toggle between 0 and 0.6V
 
Anonymous
circuit after collector is relay coil and positive from ACDC converter
 
tell me what you have attached to the collector of the transistor
 
Anonymous
a relay coil and the positive from the converter
 
and the power supply ground is connected to the other grounds too?
 
Anonymous
@jippie i meant that when gpio is HIGH collector voltage drops
 
Anonymous
8:35 AM
the power supply is what?
 
Anonymous
whaaaaa
 
Anonymous
so I also have to connect the power supply's ground to the pi's ground
 
yes that is expected, the transistor circuit you use inverts the signal
 
Anonymous
I'm getting the hang of it
 
@PatoSáinz you need a closed circuit
 
Anonymous
8:37 AM
ok I'm going to connect the power supply's return path to the wire that's between the transistor's emitter and the pi's gnd
 
Anonymous
wish me luck
 
Anonymous
done
 
Anonymous
no relay changes yet
 
Anonymous
but nothing blew up
 
so what voltages do you measure at the collector?
 
Anonymous
8:38 AM
16.18 low
 
that is expected.
 
Anonymous
10.09 high
 
ok, so it is somewhat working ;o)
 
Anonymous
yea
 
Anonymous
is it time to measure current?
 
8:39 AM
no need for that
little intermezzo first
do you have a diode in parallel to the relay coil?
 
Anonymous
wait there's something weird
 
you didn't draw it in your circuit
 
Anonymous
the collector voltage is dropping slowly
 
Anonymous
now it's at 9.94
 
switch low
 
Anonymous
8:40 AM
is it because I didn't put the diode?
 
the transistor is heating up
 
Anonymous
oooohhhh
 
Anonymous
well I have a nice heatsink
 
Anonymous
that's no problem
 
switch low anyway
 
Anonymous
8:41 AM
switched low
 
ok, back to the diode question
 
Anonymous
ok so now... nope, there's no diode in my circuit
 
Anonymous
I thought it was something for safety only... and after a week of tinkering I value working-ness before safety
 
if you want your transistor to live a long life, you need a flyback diode.
do you have diodes? like 1n4148 or 1n4001?
 
Anonymous
@jippie should we bother with a diode right now if we're still unable to get the relay fully functional? also about diodes... nope I have no handy diodes... I could scrap from an old psu but I don't know if I need those specific models of diodes to wrok
 
8:45 AM
ok, but don't blame me when your transistor says poof in a couple days ;o)
 
Anonymous
 
Anonymous
seems a little overengineered
 
Anonymous
but it's a diode after all isn't it
 
as I mentioned before, your base voltage is a bit low. This implies that base current is a bit low too and hence collector current is low, causing the transistor not to fully switch.
do you have a 2k resistor?
 
Anonymous
@jippie I can surely scrap one with ease... also, about the voltage... surely it's really not an optimal solution but what about attaching a nice 1.5 volt AA battery in series after the Pi's GPIO
 
8:48 AM
that diode is a bit oversized, but may do the job.
@PatoSáinz no that won't work, the transistor will always receive base current that way and never fully switch off.
 
Anonymous
alright
 
find a resistor 2k2 or so, while on the job find a 1k too.
values aren't too critical
 
Anonymous
ok be right back
 
Anonymous
does it matter if I just connect them in series?
 
Anonymous
say I find two 1k
 
8:50 AM
that'll work too.
/me having a sandwich in the mean while
 
Anonymous
enjoy
 
replace the 5k resistor with 2k, then test the output voltage, both high and low. Make sure you toggle to low when done.
back in a few minutes
 
9:05 AM
Intermezzo with regard to the diode: electronics.stackexchange.com/questions/115857/…
 
Anonymous
nice piece of info
 
Anonymous
btw i've got an assortment of resistors... I don't think they're enough to get the quantity of ohms you asked but well there's also the two big resistors I'm using for the 5.1 kOhm base pin
 
The 5k base resistor is too high.
But if you use a too low resistor, you will overload your GPIO pin.
 
Anonymous
ok, what should I replace it with?
 
Anonymous
2k?
 
9:11 AM
My estimate would be somewhere around 2k, maybe 1k
 
Anonymous
k, replacing
 
Anonymous
@jippie using 1.35 kOhm
 
so what is the collector voltage, both high and low?
 
Anonymous
checking
 
Anonymous
16.20 low
 
Anonymous
9:25 AM
0.15 high
 
Anonymous
AND IT WORKED
 
that's perfect.
 
Anonymous
@jippie thanks for babysitting me
 
your transistor will not heat up with 0.15V across it.
you're welcome
 
Anonymous
while I had no clue what I was doing
 
9:26 AM
do check the diode thing, carefully check the diode's polarity.
otherwise your transistor will fail before long
 
Anonymous
@jippie why did reducing base R decrease the voltage and cooled the transistor?
 
and it may affect your RPI too.
@PatoSáinz oh no, he's asking questions ...
;o)
 
Anonymous
:)
 
Anonymous
@jippie I'll do the flyback diode right now
 
Anonymous
how was it again?
 
9:28 AM
Your relay needs a certain amount of current to work; The transistor (simplified) is a current amplifier; For every mA collector current, you need a certain amount of base current.
If the resistor is too high, the base current is limited; Then the collector current is limited too. This causes collector voltage not to drop low enough, the transistor heating up and the relay not to work
In formulae: I(C) = h(FE) × I(B)
where h(FE) for your transistor is about 100, a usually safe rule of thumb for these small transistors.
 
Anonymous
I see
 
Anonymous
@jippie ok I've got mr. big diode here, how did I wire it up again?
 
Anonymous
parellel to coil?
 
The base voltage should be around 0.6 ~ 0.7V (so the 0.5V you measured was a give-away that things where wrong).
 
Anonymous
just one little sub-volt was a troubleshooting clue... wow
 
9:33 AM
so the voltage across your resistor would be 3.2V - 0.6V = 2.6V; The current through your resistor would be 2.6V / 1350 ohms = 2 mA.
So collector current will be approx 2 × 100 = 200 mA, more than enough for your relay. Actually the relay will limit current now and the transistor saturates.
@PatoSáinz parallel to the coil
but diodes are polarized
be very careful identifying the anode and cathode
remember I said electronics is an unforgiving hobby, if you get anode and cathode wrong, you will blow your transistor
 
Anonymous
@jippie transistor saturates... is that akin to when an amplificator clips a wave?
 
Anonymous
@jippie god forgive us
 
@PatoSáinz yes when an amplifier is clipping, the transistors in it saturate too.
in an amplifier you don't want that, when switching a relay you do.
you want the diode in parallel to the relay coil, you have two options ...
the wrong way and the right way
 
Anonymous
:o
 
the wrong way => the diode conducts when the relay is switched on (GPIO low), you'll blow up the transistor.
 
Anonymous
9:37 AM
@jippie how would current flow if I wired it wrong and why would it be so catastrophic?
 
the right way => the cathode of the diode is at + power supply and the anode is at collector
the diode should not conduct while the relay is powered.
 
Anonymous
hmm
 
Anonymous
great, I've run out of soldering tin
 
of course you can test is with a series resistor,
using a series resistor allows you to test without things blowing up. Then when you are certain about polarity, you remove the series resistor.
 
Anonymous
but where's the fun in that?
 
Anonymous
9:41 AM
:)
 
@PatoSáinz the fun is that you can buy nice things like soldering tin for the money you don't have to spend on a new power supply or RPI ;o)
 
Anonymous
@jippie touché
 
@PatoSáinz wait! you live in Santiago?
 
Anonymous
@jippie yes... why?
 
... I live in Netherland, about 20.000 km from there ...
@PatoSáinz Postage to Santiago takes forever and costs a fortune
 
Anonymous
9:45 AM
oh don't even think to send me any gifts mate :,) it's ok
 
Anonymous
well postage from santiago is cheap
 
Are there any nice webhops that deliver to Santiago, in time for valentines day? (a friend of mine lives there)
 
Anonymous
I don't know how it is to-santiago
 
Anonymous
hahahahahahaha I thought it was a gift for me
 
Anonymous
@jippie what kind of thing do you want to gift?
 
9:46 AM
@PatoSáinz an A4 sized envelope took over a month late last year...
@PatoSáinz ... don't know. No flowers, nor jewelry
A hallmark-like service would already be great I guess.
 
Anonymous
isn't hallmark only for greeting cards?
 
@PatoSáinz got any better idea to impress a girl?
 
Anonymous
there isn't a hallmark-esque service here BUT I can point you to some online retail shops (akin to dunno, target? what are the retail shops in the NL?)
 
Anonymous
@jippie clothing
 
@PatoSáinz hmm ...
@PatoSáinz I'm so bad at these things ...
 
Anonymous
here are two big retail shops
 
Anonymous
I'm sure they accept Visa or Mastercard
 
Anonymous
@jippie another recommendation:
 
Anonymous
it's a common joke in SF's comms room
 
9:51 AM
@PatoSáinz hmmm maybe not
 
Anonymous
@jippie other than those two retail shops and a couple of small electronics shops... I don't know much about "romantic" things online in Chile
 
is there an online beer shop :o)
 
Anonymous
let me remember
 
which is the second shop? or were you aiming at amazon?
back in a few moments.
 
Anonymous
the second shop is falabella
 
Anonymous
9:53 AM
the first one is paris
 
Anonymous
@jippie tienda.tiendaslavinoteca.cl/index.php <-- expensive wine shop
 
Anonymous
and mundogluck.cl/tienda.php?cPath=66 nice craft beer shop
 
@PatoSáinz ah right i didn't notice those were two url'
@PatoSáinz no she's into beer, not into wine
 
Anonymous
oh
 
Anonymous
@jippie what about champagne?
 
Anonymous
9:56 AM
la vinoteca sells champagne
 
nope, she preferred a beer (Belgian) over red wine and champagne when she was here
@PatoSáinz My spanish is poor, could you check if I can pay by credit card on the beer shop?
 
Anonymous
 
Anonymous
yes
 
@PatoSáinz hèhè you probably saved my valentines day ;o)
 
Anonymous
@jippie you're welcome hahaha... you saved my electronics day
 
Anonymous
10:07 AM
@jippie hit me up if you need help with purchasing
 
@PatoSáinz thnx
:o)
 
Anonymous
it's ok :)
 
Are you OK with your relay circuit? Am I dismissed?
 
Anonymous
i haven't wired the diode yet
 
Anonymous
I'm trying to solder everything first
 
10:09 AM
I haven't showered yet ;o)
But it's like way past midnight in Chile
oh it's dawn already
 
Anonymous
7:10 AM
 
early bird
 
Anonymous
lol no
 
Anonymous
I was up all night
 
Anonymous
actually... I'm a night owl
 
Anonymous
10:10 AM
not an early bird
 
Anyways I have to step away for a while. Thanks for your help. Carefully check the diode polarity then you solder it into your circuit.
 
Anonymous
k thanks!!
 
Anonymous
11:33 AM
@jippie ok, I've soldered everything with a nice diode, it's fully functional and it's no longer taped to my desktop
 
00:00 - 12:0012:00 - 13:00

« first day (1557 days earlier)      last day (3372 days later) »