Mains surge!

Discussion in 'General Electronics Chat' started by geoffers, Jan 5, 2013.

  1. geoffers

    Thread Starter Active Member

    Oct 25, 2010
    239
    6
    Hi all,
    A fairly general question I think, I've a circuit which uses a PIC 18f2523, I've been running using a UK mains addaptor, this has a 12v output which I have regulated using a 7805, a bit old I know but I have a drawer full! The circuit also has 2 chips and a display on the I2C bus. I recently bought a four way socket which has 'surge protected' written on it. I had my computer, the circuit running on it, when I plugged my soldering iron in the computer went ping and turned off and everything on the circuit stopped! The computers fine but the pic won't run past trying to create a start condition on the I2C bus. I have decoupling capacitors all over the board, could a surge have done the damage?

    Cheers Geoff
     
  2. Dodgydave

    AAC Fanatic!

    Jun 22, 2012
    5,001
    745
    Replace the pic and reprogramme it, and try again see if it makes a difference.
    Don't know why you need an anti-surge socket ?
     
  3. geoffers

    Thread Starter Active Member

    Oct 25, 2010
    239
    6
    Thanks for the reply, I'll do that, i tried reprogramming and it's all ok in that sense,the pic runs ok though, well untill it trys to create a start condition. I was more concerned about the cause? I only really wanted a multi socket, the surge protection just happened to be there! The computer pinged off again this morn when I plugged in the transformer (a cheapo maplin job for my circuit). Should I be offering my circuit more protection? If so what? Theres obviously something in the computer that protects it by turning off. Is it possible that the 'surge protection' works both ways and a spike that would normaly be lost on the grid is being shared by the four sockets? It was only a 25w soldering iron! (I know I should probably have turned off at the wall before I plugged in and maybe doing that would solve the problem) I'm curious as to what could be going on?
    Cheers Geoff
     
  4. GopherT

    AAC Fanatic!

    Nov 23, 2012
    6,070
    3,841
    It would be interesting to see what the surge protection circuit looks like.

    I think you are correct that the surge protector only protects the four sockets from the mains but does not protect the from surges on other three sockets. It could also be adding noise to your system that interferes with your I2C.

    Depending on the quality of your soldering iron, they can generate a good bit of noise. For example, my Weller soldering station has a magnetically switched thermostat that slams the switch on and causes my o-scope to jump.
     
  5. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,395
    1,607
    Sounds to me like you overloaded the socket by adding the iron on to the computer, and the computer shut off for till you reset it. Try using a different outlet for the iron and computer.

    If am I2C device is ACKing a transfer when the master (PIC) is reset the device can stall the bus by keeping the data line low. It needs a power on reset to clear that.

    Happens to me a lot when debugging I2C devices.
     
  6. geoffers

    Thread Starter Active Member

    Oct 25, 2010
    239
    6
    Hi all,
    Thanks for the replies, I think there's somthing going on, the computer is laptop so the battery would keep it going if there was a dip in the supply? I've dissconected all but the I2C eeprom and still get the same effect, the pic stalls and waits for a start condition, either the PIC or the eeprom must be beggerd I guess? Think I shall open up the socket tomorrow and see whats in there!
    Cheers Geoff
     
  7. thatoneguy

    AAC Fanatic!

    Feb 19, 2009
    6,357
    718
    Have you tried a different power supply? Have you measured the supply you are using to ensure the correct voltage is being output?

    PICs tend to be quite hardy, while other components are very sensitive to power issues.
     
  8. geoffers

    Thread Starter Active Member

    Oct 25, 2010
    239
    6
    Thanks for the replies, I've built up another circuit to test the other components, the i2c display, the micro chip i2c clock, and i assume the eeprom? (its legs came off!) were all done for. The pic worked apart from the i2c bus. I guess the spike may have damaged the i2c components through the pull up resistors? Is there any extra protection i could offer them? They allready have 100nf caps. Power supply is a fairly steady 12v.
    Cheers Geoff
     
  9. toffee_pie

    Active Member

    Oct 31, 2009
    162
    7
    have you pull down protection diodes on the i2c lines?
     
  10. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,395
    1,607
    Typically *every* device added to the I2C bus adds extra EDS protection diode to the data and clock lines.

    geoffers: before your PIC issues the START command what are the states of SCl and SDA? Do they both start high before you begin to use them?
     
  11. geoffers

    Thread Starter Active Member

    Oct 25, 2010
    239
    6
    Thanks for the replies! Ernie I'm afraid I took my faulty circuit to peices! I did put my multi meter on the lines before, but I'm unsure if the pic had issued the start command? I think scl was around 3v and sda near 0v. I've tried the old components with the new pic and they are done for! I also tried a new lcd on the old pic and that didn't work! Do I need multiple pullups? Ie one for each ic on the bus or is one pullup each on scl and sda ok? (thats what I have at the moment) I'd just like to aviod a repeat!
    Thanks Geoff
     
  12. geoffers

    Thread Starter Active Member

    Oct 25, 2010
    239
    6
    Ernie, do I understand that each i2c component has protection diodes built in? I certinaly havn't added any diodes.
    Thanks Geoff
     
Loading...