long wire kickbacks are killing me - Page 1
Forum section: electronics / projects

author: andrewxxx
author_rank: Newbie
timestamp: January 15, 2016, 01:08:44 pm
content: the long wires acts as inductor which shutdown and sometimes damage my microcontroller(IC1) also the long wires at the ac side gets the lamb(BL1) to blink dimly (bearly noticable in room light) so i think something else is inducing it, for the AC part ill be implementing an optoiso along with triac and snubber circuit (lemme know if you have a better idea) but the SW1 is the part where i'm stuck, usually in simulation they turn the wire into inductor to add the diode (with resistance or zener) parallel to it but in this case i'm kinda lost of to how to snub that switch in addition ill be adding a low path RC filter (100k/10nf) so it won't get to the microcontroller

author: Zero999
author_rank: Super Contributor
timestamp: January 15, 2016, 01:34:04 pm
content: The cable should be terminated with its characteristic impedance. Try 10nF in series with 100R at the microcontroller input.I don't know what's causing the lamp to blink. Is it an LED?

author: andrewxxx
author_rank: Newbie
timestamp: January 15, 2016, 01:44:12 pm
content: Quote from: Hero999 on January 15, 2016, 01:34:04 pmnot really it's a 220v lamb, the relay was closed but there was a very little current but i can limit that with simply adding a resistance not to damage the lamb, but what bugs me is what this current doing on the other end at my circuitmind explaining that characteristic impedance part with a little wiring diagram, please and thank you

author: Fungus
author_rank: Super Contributor
timestamp: January 15, 2016, 01:46:29 pm
content: R1 should be bigger. 10k or more. The lower the current in your wire, the less problems you'll have with inductance. Right now you have 5mA in the wire when you press the switch. Put a capacitor from the microcontroller input pin to GND to reduce noise.Also try 1k of resistance in the wire close to the microcontroller. This will give the microcontroller's clamping diodes more chance to do their job.

author: Seekonk
author_rank: Super Contributor
timestamp: January 15, 2016, 03:05:29 pm
content: It is not the kickback of the long line, bit that line is acting as an antenna for the noise you create. That advice is just the reverse, R1 should stay 1K 3.3K in series with the input pin with a .1 to .47 at micro input to common.And try to get rid of the noise at source, 33 ohm .1uf X2 cap at relay contacts.

author: Kalvin
author_rank: Super Contributor
timestamp: January 15, 2016, 03:30:43 pm
content: One option is to use an optocoupler, so you will protect the MCU effectively from the EMC/EMI problems, problems with the ground loops and bounces, and the optocoupler will be current driven ie. low impedance thus better noise suppression.

author: macboy
author_rank: Super Contributor
timestamp: January 15, 2016, 04:11:35 pm
content: You should have a current limiting resistor to the input of the micro. This will help a lot in preventing damage from excess voltage. The micro has built in clamping diodes to help prevent damage, but they do their job better if the current is already limited. You can and should add a small cap to the between R1 and ground (across the switch but near the micro) for debouncing and to absorb transient voltages. You can add a small cap at the switch as well, to provide a path for that current to flow when the switch is released, so the wire inductance doesn't produce a high voltage spark. (10 to 100 nF is suitable for both). Twist the wires together to greatly reduce inductance and reduce EMI/RFI interference pickup.You also need a current limiting resistor for Q1, or you risk damaging both Q1 and the micro. Around 1 kOhm will do fine.Those 50 m lines are a big antenna, so I would also put the wires through aferriteto reduce the EMI picked up. You can buy snap-on types or salvage one from a VGA cable you don't need any more.

author: andrewxxx
author_rank: Newbie
timestamp: January 15, 2016, 04:48:12 pm
content: keep them coming guys ill try to figure out who's right and how to use most of the suggestions altogether to get it over with

author: max_torque
author_rank: Super Contributor
timestamp: January 15, 2016, 04:51:52 pm
content: As the switch wires are 50m long, can i assume they run external to building? In which case, you need to consider what might happen if lightning or other large voltage discharge was to find them..........

author: Seekonk
author_rank: Super Contributor
timestamp: January 15, 2016, 04:54:01 pm
content: Quote from: andrewxxx on January 15, 2016, 04:48:12 pmI've always wondered just how people do that.

author: Fungus
author_rank: Super Contributor
timestamp: January 15, 2016, 04:58:58 pm
content: Quote from: Seekonk on January 15, 2016, 04:54:01 pmAll the replies have "resistor in series" and "capacitor to ground" in common.That may be enough to fix it with no other changes.

author: andrewxxx
author_rank: Newbie
timestamp: January 15, 2016, 05:00:09 pm
content: Quote from: Seekonk on January 15, 2016, 04:54:01 pmEeny, meeny, miny, moe mostly, well ill try to combine answers that make sense yet doesn't contract each other and a bit trail and error too

author: Fungus
author_rank: Super Contributor
timestamp: January 15, 2016, 05:01:54 pm
content: Quote from: Seekonk on January 15, 2016, 03:05:29 pmSo it will go all the way down to 3.8V when he presses the switch...?

author: andrewxxx
author_rank: Newbie
timestamp: January 15, 2016, 05:05:45 pm
content: Quote from: max_torque on January 15, 2016, 04:51:52 pmill be attached to another object by an inclined plane wrapped helically around an axisQuote from: Funguslink=topic=61340.msg843150#msg843150 date=1452877138yeah which i pretty much have done in the real circuit and wasn't enough (after 2-5 times the microcontroller shutdown till it fails) which is why i'm kinda trying to keep the topic alive till i get something new to try

author: KM4FER
author_rank: Regular Contributor
timestamp: January 15, 2016, 06:43:26 pm
content: "ill be attached to another object by an inclined plane wrapped helically around an axis"Can you describe this a bit more? To me it sounds like your 50m of wire are not laid out in straight lines but are coiled up which would make some mighty fine inductors and could give you some pretty good kicks.Earl

author: andrewxxx
author_rank: Newbie
timestamp: January 15, 2016, 06:53:54 pm
content: Quote from: KM4FER on January 15, 2016, 06:43:26 pmattached to another object by an inclined plane wrapped helically around an axis means screwed, if a thunder storm induced current in my wires ill be screwedand it's a 50m twisted pair wire of 2mm dim, and i suspect kickbacks cause once i hit the sw1 all hell breaks lose which is why i'm still waiting for a definite answer by an experienced member

author: rich
author_rank: Frequent Contributor
timestamp: January 15, 2016, 09:12:26 pm
content: Does your circuit work with shorter wires?It may help to show us what your latest circuit looks like (maybe some photos would help) - can you tell us what you currently have as:Microcontroller input circuit protectionResistor between microcontroller and Q1 baseSuppression circuit across relay contactsVoltage and wattage of bulb BL1Details of V2 source (is this 220V mains feed?)Where is the 5V coming from? Is it stable when the relay is energised?

author: Fungus
author_rank: Super Contributor
timestamp: January 15, 2016, 09:26:22 pm
content: Quote from: andrewxxx on January 15, 2016, 05:05:45 pmYou really need to connect a 'scope to it and look at what happens. Post pictures.

author: Dubbie
author_rank: Unknown
timestamp: January 15, 2016, 09:30:07 pm
content: Even with all the other suggestions, it seems like a no-brainer to add an optocoupler to protect the micro.It's cheap and easy and you won't have to keep replacing your micro if it turns out you were mistaken about something.

author: Fungus
author_rank: Super Contributor
timestamp: January 15, 2016, 09:33:18 pm
content: Quote from: Dubbie on January 15, 2016, 09:30:07 pmNot really. It would need a separate, isolated power supply just for the switch.

author: TerraHertz
author_rank: Super Contributor
timestamp: January 15, 2016, 11:18:14 pm
content: Quote from: Fungus on January 15, 2016, 09:33:18 pmNo it doesn't. Just because an opto offers full isolation, doesn't force you to maintain that isolation in everything associated. Here the objective is to isolate the micro from fatal-level spikes on the cable to the switch. The supply rails can be decoupled to a lesser degree. Like in the pic below.The 2k2 resistors should be as high a value as allowed by the opto current requirements. Also perhaps make each of them two or more resistors in series, to increase HV withstanding. And spark-gap protectors on both of the cable leads to earth at entry to the box wouldn't hurt.

author: LukeW
author_rank: Frequent Contributor
timestamp: January 16, 2016, 04:04:53 am
content: Quote from: andrewxxx on January 15, 2016, 01:08:44 pmAssuming this is actually a cheap 230VAC compact fluorescent lamp, this is a well-known phenomenon, caused by parasitic capacitance in the long parallel pair of wires going down to the switch (or relay in your case) which slowly leaks AC current into the lamp's power supply.If the relay is not actually closing it's not your circuit doing it, and if the relay is closing then you'll hear it.

author: sarepairman2
author_rank: Frequent Contributor
timestamp: January 16, 2016, 07:24:06 pm
content: did anyone else think this is thread was about organized crime and the power company?

author: Simon
author_rank: Unknown
timestamp: January 16, 2016, 07:45:14 pm
content: How about twisting the wires that will reduce inductance, if you are trying to drive any load have you considered the actual resistance of 100m of cable that is feeding your light ?

author: donmr
author_rank: Regular Contributor
timestamp: January 18, 2016, 04:54:45 am
content: Clearly it must be a software bug.Said the hardware engineer.

author: trophosphere
author_rank: Frequent Contributor
timestamp: January 18, 2016, 05:44:19 am
content: To protect the input of your micro-controller, you can try seeing if the solution(s) presented inthis articlehelps.