Some kind of one-shot?

Discussion in 'Power Electronics' started by Willsy, Aug 29, 2018.

  1. Willsy

    Thread Starter New Member

    Aug 23, 2018
    9
    0
    Hi there

    I have a battery powered loop (6V) broken by a normally open magnetic switch.

    When a metal object passes close by, the magnet closes the loop, and the 6V is fed into the opto side of an ASSR-1218 solid-state relay.

    I've sized the limiting resistors on the opto side to pull 5mA according to the ASSR-1218 datasheet. That closes an input into a micro-controller on the other side, which wakes it up and causes it to do its thing. All working.

    However, I'm worried that if the metal object stops right next to the switch, the switch will remain on (could be for hours), pulling 5mA all the time, and steadily draining the battery.

    How can I make the detection of a metal object send a single pulse of a few microseconds (approx 100 to be on the safe side), and then pull no current until the object moves away, which would reset the circuit?

    Any thoughts?

    Regards

    Mark
     
  2. Ylee5763

    New Member

    Sep 23, 2015
    25
    1
    I think you have to have the uC standby to monitor the status of magnetic switch in order to achieve this.
     
  3. AlbertHall

    AAC Fanatic!

    Jun 4, 2014
    6,171
    1,440
    Why do you need the solid state relay?
    Could you not connect the magnetic switch directly to the uC pin?
     
    crutschow likes this.
  4. Willsy

    Thread Starter New Member

    Aug 23, 2018
    9
    0
    Hi Albert,

    I can maybe do that... There's potential for it to be a long cable run. Maybe tens of metres. I don't know how much volt-drop one may encounter. Let's say it's a ten-metre cable run from the uC (which will be in a kiosk, mounted on DIN-rail) to the water purifiers. That's 20 metres (10 there, 10 back). What sort of volt-drop would one expect.

    Maybe there's a calculator for that online somewhere. I'll have a search online.

    Maybe volt-drop is not an issue. The input on the uC is weakly tied high, so the magnetic switch will simply ground the input.

    Regards

    Mark
     
  5. AlbertHall

    AAC Fanatic!

    Jun 4, 2014
    6,171
    1,440
    The current will be very low so the voltage drop along the wire will also be very low. You might need a capacitor across the uC input if the wire picks up some interference.
     
  6. Willsy

    Thread Starter New Member

    Aug 23, 2018
    9
    0
    Thank you, Albert. I'll bear that in mind. Any thoughts/opinions of the value of the capacitor? The pulse from the magnetic switch will only be a few 10s of milliseconds (I think!).

    BTW: I did find some online cable voltage drop calculators. As you mentioned, the voltage drop is indeed very low, so not likely to present a problem.
     
  7. AlbertHall

    AAC Fanatic!

    Jun 4, 2014
    6,171
    1,440
    What current is the uC pull up?
    The switch will discharge the capacitor quickly and it will then recharge from the uC current when the switch opens again. The value needed really depends on what frequency/amplitude the pickup on the cable is.
     
  8. Willsy

    Thread Starter New Member

    Aug 23, 2018
    9
    0
    There's a 20K pull-up resistor on the uC input, so, @5V current dissipated when switched to ground is 0.25mA

    Mark
     
  9. AlbertHall

    AAC Fanatic!

    Jun 4, 2014
    6,171
    1,440
    With a 100nF capacitor, after the switch opens, the recharge will take on the order of 2ms and be ready for the next switch input. The exact time depends on the threshold voltage of the uC.

    So 100nF seems to be a good starting point.
     
  10. Willsy

    Thread Starter New Member

    Aug 23, 2018
    9
    0
    Okay I'll start with 100nF.

    Many thanks for your input, Arthur.
     
Loading...