#avr | Logs for 2015-06-23

Back
[05:46:58] <twnqx> so.. TVS diodes vs Z-Diodes
[05:47:17] <twnqx> can one run TVS diodes to clam 250VAC to 15V?
[05:47:25] <twnqx> (with an extra silicon diode clamping the lower half of the sinewave)
[08:49:23] * LeoNerd received 3 ATtiny88A QFNs in the post today
[08:49:28] <LeoNerd> My my these things are small. Huuuuge box though
[08:49:35] <LeoNerd> I can't quite understand the size of the box
[08:53:00] <l_oliveira> it's to make a impression
[09:10:06] <twnqx> halp, elementary electronics question.
[09:10:22] <twnqx> i have a voltage divider, 50:50
[09:10:26] <twnqx> and on the center point a clamp diode to gnd
[09:10:31] * LeoNerd batterns down the hatches, splices the mainbrace, etc etc...
[09:10:33] <twnqx> to kill negative input voltages
[09:10:48] <twnqx> and also a TVS diode to protect against too high voltages
[09:11:05] <twnqx> i can see in spice that the resulting voltage is in the desired range
[09:11:42] <twnqx> but am i right that the maximum of half the input coltage drops over the first resistor, and later on when the diodes turn on less than that?
[09:11:53] * twnqx needs to figure out power dissipation inside the resistor
[09:12:08] <LeoNerd> I think at this point a diagram might be required
[09:12:19] <twnqx> thought so :X
[09:12:49] <Tom_itx> ---/\/\/\---
[09:12:57] <Tom_itx> ---/\/\/\----
[09:13:05] <Tom_itx> --|<---
[09:13:16] <twnqx> i think i need to draw a symbol for TVS diodes anyway
[09:13:16] <LeoNerd> Mm... duck diode
[09:14:42] <l_oliveira> :v <- quack
[09:14:53] <twnqx> mh
[09:15:02] <l_oliveira> but jokes aside what is that design you're working at ?
[09:15:07] <twnqx> if i used a bidirectional clamp diode i could save the first diode
[09:15:32] <twnqx> let me eagle that out
[09:19:02] <twnqx> hm
[09:19:12] <twnqx> i think tvs diodes are a... bad idea for this
[09:21:31] <Thrashbarg> o< quack
[09:24:56] <twnqx> http://i.imgur.com/1gNQo2X.png basically, the part around rn1-1, d1, r1, q1a
[09:25:08] <twnqx> and one of the d3 array
[09:25:27] <twnqx> the z-diode is chosen randomly, would be a nominallyl 18V
[09:25:45] <LeoNerd> So it seems the world is relatively devoid of articles or any other writings about people using tied TX/RX as a shared single-wire UART bus
[09:26:07] <LeoNerd> A few people explaining the physical hardware which is mostly obvious, but nobody really talking about such issues as collision detection
[09:46:36] <aandrew> twnqx: wow now THAT's an engineering desktop
[09:46:55] <aandrew> ZOMG you use mc too!
[09:47:17] <aandrew> I always called it "Morton Commander" after finding it (I was a religious norton commander user back on DOS)
[09:48:04] <twnqx> yeah, can't become friends with graphical file managers...
[09:52:53] <twnqx> so, either my understanding of bidirectional TVS diodes is wrong, or the spice model i have is broken
[09:55:36] <twnqx> right, NOW it's as expected :P
[09:56:06] <LeoNerd> I don't know about anyone else, but I have no idea what is, nor have ever heard of, a "TVS diode"
[09:56:54] <aandrew> well the schematic symbol is a pair of kathode-to-kathode diodes, I've called them TVSes, transzorbs, and transient diodes
[09:56:59] <aandrew> I know what he's talking about
[09:57:20] <LeoNerd> Oh a tranzorb
[09:57:22] <twnqx> surge suppressor diodes
[09:57:25] <twnqx> kind of like super-fast z diodes
[09:57:27] <aandrew> duck diodesty
[09:58:01] <twnqx> kthode-to-kathode is the bidirectional type, they also exist as unidirectional
[09:58:18] <aandrew> yep
[09:58:56] <twnqx> so i wonder if it will survive being used like a regular z-diode
[09:58:56] <twnqx> at ~1.5mA
[09:59:08] <twnqx> well, ordering some to test.
[09:59:19] <twnqx> and then... 250VAC stright to the digital input.
[09:59:46] <twnqx> though.. how to wire return :S
[10:00:04] <twnqx> just connect gnd to one of the two wires? hm
[10:00:31] <twnqx> i wonder if that will result in explosions.
[10:20:40] <sebus> twnqx what type of tvs stuff you're talking about?
[10:21:33] <sebus> huge ones (in SMB package like P6SMB family) does it's job very well
[10:32:25] <twnqx> SMAJ
[10:32:37] <twnqx> specifically, SMAJ15CA
[10:33:02] <twnqx> but i intend to abuse them as Z-diodes in worst case, at 250V/1.5mA "surge"
[10:45:45] <sebus> twnqx it should work fine.
[10:48:16] <twnqx> i'll still test it before putting... *counts*
[10:48:25] <sebus> in some extra conditions they are likely to short-out, but at much more current/voltage :D
[10:48:37] <twnqx> 144 of them onto boards
[10:48:52] <twnqx> together with hundreds of other parts :P
[10:49:02] <sebus> I use 33CA on 485 lines
[10:49:12] <sebus> also on power lines
[10:49:14] <sebus> 24VDC
[10:49:49] <twnqx> i now have a an extended input range for my project
[10:49:59] <twnqx> whould work from 3.3 to 250V :P
[10:50:07] <twnqx> should*
[10:50:49] <twnqx> 250VAC, that is, so +-125V survival
[10:51:22] <twnqx> after that i fear that the resistors will turn to smoke
[10:51:26] <sebus> Wide VIn...? ouch
[10:51:33] <twnqx> 0.063W is not all THAT much
[10:52:08] <twnqx> well, the goal was 3.3-24vin plus a bit of a safety margin
[10:52:25] <twnqx> replacing clamp diodes with TVSs just happened to extend the range
[10:52:38] <twnqx> more or less limited by current across the 100k input resistor now :P
[10:59:29] <sebus> what about safety, twnqx?
[11:00:01] <sebus> if you want to supply stuff from 230..250VAC
[11:00:22] <twnqx> i don't want to
[11:00:36] <twnqx> it's just in an environment where people might accidentally connect 250AC to a digital input
[11:00:48] <twnqx> i want it to survive that
[11:02:05] <sebus> you can look how it was done on... ICP-DAS I7188 series
[11:02:06] <twnqx> it's target voltage is 24DC, and it's "just" an i/o extender :P
[11:02:24] <sebus> there are huge resistors + tvs on digital in/out/adc
[11:03:02] <twnqx> way too large
[11:03:08] <twnqx> way, way, way to large
[11:03:40] <twnqx> 4cm² is max i can give the electronics
[11:07:11] <sebus> don't forget about nessecary trace gap between in/out
[11:07:55] <sebus> huh, it's almost 10mm or so.
[11:08:05] <twnqx> again a no-go :P
[11:08:15] <twnqx> i have 2.54mm spacing on the connector
[11:08:21] <twnqx> and need to go through the mins
[11:08:34] <twnqx> i hav .5mm, and that's fully sufficient for covered tarces up to 150V
[11:08:41] <twnqx> traces*
[11:08:52] <twnqx> according to DIN/IEC
[11:12:16] <twnqx> coverd = soldermask, btw
[11:12:17] <twnqx> i have no heat issues as the current is single-digit mA
[11:13:20] <sebus> but still "no-go" might be doing 100% idiot-proof input protection... ;p
[11:13:53] <sebus> in some cases... ok, but not everytime :/
[11:14:07] <twnqx> 100% is neigh impossible
[11:14:31] <twnqx> i am ok with 250VAC, 1.5mA limit
[11:15:03] <twnqx> clamped down to +-18V for a mosfet with +-20V VGS limit
[11:15:35] <twnqx> which in regular operation would be 0-12V
[11:15:42] <twnqx> actually, open or 12V :P
[11:20:01] <sebus> no optocouplers? anything?
[11:28:42] <twnqx> on the input side? no
[11:28:56] <twnqx> analog devices MEMs based coupler towards the µC though
[11:29:58] <sebus> adum <3 yeah i like these ones
[11:29:58] <twnqx> i need a total of 128 inputs and 128 outputs on the controller. friend went a bit over the top when renovating his apartment's electric wiring...
[11:30:53] <twnqx> so basically, one ADUM on each connector to the next in chain
[11:31:30] <sebus> adm's are nice
[11:34:18] <twnqx> not sure how to generate the local supplies though. those nice wide range switchers are pretty expensiev
[11:34:47] <twnqx> might use a common 5V regulator and using isolated switchers from there to 3.3V, plus an LDO to 1.8
[15:08:39] <kdehl> Okay, an embarrassing noob question. I want to use a 3.3 volt programmer in a 5 volt cicruit. I can't use a voltage divider for that somehow, can I? I'd better use transistors or level converters?
[15:09:59] <Tom_itx> a silly question: why?
[15:10:25] <Tom_itx> or why not use a 5v programmer?
[15:12:04] <kdehl> Because I only had one programmer and it died.
[15:12:11] <kdehl> So now I'm using a Raspberry Pi.
[15:13:24] <kdehl> Which is 3.3 volt only, and not 5 volt tolerant.
[15:13:43] <Tom_itx> A) get a new programmer
[15:13:50] <Tom_itx> B) use a level shifter
[15:15:02] <kdehl> I've ordered both already. I just need a temporary solution until then.
[15:15:22] <Tom_itx> take some time to reflect while you wait
[15:20:14] <RattusRattus> rPi ---> AVR MOSI (step up) use 2 x transistors
[15:20:34] <RattusRattus> rPi ----> ACR SCK (step up) again 2x transistors
[15:21:00] <RattusRattus> AVR MISO --- > rPi 2x resistors (step down)
[15:21:39] <RattusRattus> rPi ----> AVR nRST 2 x transistors (step up)
[15:22:14] <RattusRattus> thinking about it - IIRC you can get away with 1 transistor and tell AVR dude to invert the logic...
[15:22:17] <kdehl> I just got a tip that in the Raspberry -> AVR direction I probably don't need any conversion. It's only in the other direction that I do.
[15:23:51] <RattusRattus> indeed the AVR will cope with 3V3 logic, but at least make sure you have a series resistor...
[15:24:01] <RattusRattus> *probably* cope
[15:31:03] <kdehl> Should I have series resistors for normal programmers too in general? Or are those programmers usually already protected?
[15:31:25] <kdehl> If not, I suspect that's how mine died.
[15:33:15] <DKordic`> kdehl: You can not power AVR with 3.3V from RPi?
[15:33:58] <kdehl> DKordic`: The circuit has more than the AVR. It has a 5 volt 6502 CPU too, among other things.
[15:34:29] <kdehl> This kinda turned into a general question. I think I will build something that can program any 5 volt circuit from a Raspberry Pi.
[15:38:15] <kdehl> If I use transistors, isn't one transistor enough for each pin? All SPI pins are unidirectional anyway. And that way I protect the Raspberry from whatever the circuit might want to do to it.
[15:38:19] <kdehl> Or am I missing something?
[15:38:44] <kdehl> RattusRattus: Why do you say I need two transistors per signal?
[15:39:08] <DKordic`> kdehl: push-pull.
[15:40:00] <kdehl> DKordic`: Something I need to read up on.
[15:44:44] <RattusRattus> kdehl: kdehl well you can do it with a single transistor, if you use the emmittor as your input, and bias the base to 3v3 and have a pull up resistor on the collector (your output).... but I tend to prefer using 2 transistors (first inverts and 2nd inverts back).
[15:46:07] <kdehl> RattusRattus: Alright. This makes sense.
[15:46:18] <kdehl> I'll look into it later tonight. Thanks for the help!
[15:48:05] <RattusRattus> np. of cause you could just check your circuit with the AVR. I tend to issolate my AVR power net with a ferite beed, (and occasionly a diode as well) - if you have a ferite, then simply desolder that and power your AVR from 3v3....
[15:48:58] <kdehl> Heh. Well, I'm not that advanced yet. ;)
[16:13:27] <kdehl> RattusRattus: There is no danger to the Raspberry if the output pin is for some reason driven high by the AVR through the transistor, right?
[16:13:57] <kdehl> Especially not if I use two transistors. It won't work with just one if the output is inverted, so I'll need two anyway.
[16:14:06] <kdehl> So, eight transistors in total.
[16:32:33] <kdehl> No, I'm stupid. Six transistors for the Raspberry -> AVR signals, and just a two-resistor voltage divider on the AVR -> Raspberry signal.