Remote pump control ideas.

Collapse
X
 
  • Time
  • Show
Clear All
new posts

  • redwire
    replied
    Re: Remote pump control ideas.

    You want the opto to turn on around 1/2 input voltage for noise immunity, not at say 2V but 6V up. The 470R resistor across the opto LED wastes a few mA, so the 1k5 current is not entirely going through the LED. It just ends up increasing the activation voltage to work better with 12V signals. If you had a 24VDC input that activated at 2V it can get easily fooled and is not what a PLC uses.
    It's best to have a few mA flow through the switch so humidity/dirt leakage current is not enough to activate anything. But not ideal for battery/solar systems.

    That circuit - the LED lamp sees ~7V when the switch is open, and 12V when closed, so the old/bright dim thing. 1N4148 only good for 100V spike. Why do you want to run the opto from 5V, you're using three rails already 12V, 5V, 3.3V it's too complicated. I would just make the opto input for 12V. Or add a series diode good for 1kV. Or use a simple voltage divider.

    If you need a low power-wasting digital input, I use small MOSFETs that have the built-in gate protection diode like 2N7002K or BSS138K, or go directly into an MCU input after protection diode/resistors. Again, set to trip at several volts. Remember 3.3V MCU will think >1.8V is a logic 1 which is very low in an industrial environment.

    Leave a comment:


  • Dannyx
    replied
    Re: Remote pump control ideas.

    Nice. Thanks. I was actually thinking of the same setup at some point. So we should scrap the Schmitt triggers entirely ???

    Recap: So SW1 is the auxiliary NO contact of the contactor and LP1 is the 12v LED indicator lamp for "motor RUN" ? Ok, got that

    The 1.5K resistor is for current limit through the LED of U1 - makes sense. I went with 2k last time I had 12v on PC817 in this setup (in my car window project). Now that I think about it, I think I can even go LOWER. The Vf of a PC817 is given as 1.4v max. So 12v-1.4 = 10.6v. Divide that by 1500ohms and we get approximately 8mA of current to the LED....did I get this right ?

    Can't I use 5/3.3v to drive the LED of U1 so that resistor can be smaller ? I'd only switch the GNDs of both the lamp and the cathode of the LED at once. Let me answer my own question with a schematic: no, because when GND is cut and the LED inside the lamp becomes forward-biased, 12v would flow through it and feed back into the 5v supply via the 1n4148 diode like in the schematic which I drew to illustrate this setup I had in mind...hence why named it "ProbablyBadIdea"

    The 10k on the far right pulls up the MCU pin when the opto is off - makes sense as well. Pulling up to 3.3v instead of 5v is probably a good idea in the case of the STM

    The 1n4148 is to clamp reverse voltage - I have this in that other project too. I've seen it as a 5v zener in some examples instead of a regular diode.

    Now that 470 resistor is the only thing left - what does it do ?

    The tank side does not have any lamps (energy conservation), so I could go straight to the input of U1 via the switch - either by pulling the anode side UP to 12/5/3.3v or the cathode to GND. It's a SPDT switch, so the COM (pole) goes to GND/V+ and the NO/NC (throws) go to either optocoupler anode/cathode, which each get a pin on the MCU. The resistor would indeed waste some power to keep the LED on, hence why I'd go with lower input voltage. The wire run from the tank switch to the control box is pretty long there, though it is shielded, if it matters at all, since we're talking small control signals, susceptible to noise...
    Attached Files
    Last edited by Dannyx; 10-29-2020, 02:35 AM.

    Leave a comment:


  • redwire
    replied
    Re: Remote pump control ideas.

    It can hurt because it's another part that can get zapped if not done right. The MCU will have Schmitt trigger inputs as well.

    The contactor switch is not a nice signal because it's close to mains wiring and an arcing contact. So you need good noise rejection and protection against spikes, and also need many mA of current to flow through it.
    I would use this (a typical PLC digital input) that makes the DI good (activate) for say anything above ~6V, and the slow opto does filter some noise.
    It's easier to standardize your digital inputs as say 12V switch to ground. But this would waste current for the tank switches...

    You don't care about debouncing or a Schmitt trigger because you turn on the contactor and then read the switch a good while later say 1 second, to confirm the motor overload relay has not tripped.
    Attached Files

    Leave a comment:


  • Dannyx
    replied
    Re: Remote pump control ideas.

    Originally posted by stj
    what the hell is that diagram?
    why are you using a schmit trigger anyway?

    i think later i'll have to do a diagram myself!
    It's a snippet of the KiKad schematic - I cut to only the part of interest which monitors the contact status of the 3 phase contactor. I could upload the whole thing if people really wanted to see it, though it could confuse the heck out of you and it'd have to write a wall of text to explain what's what

    I heard it's common practice to use a schmitt trigger between mechanical contacts and MCUs...it can't "hurt", now can it ?

    Leave a comment:


  • stj
    replied
    Re: Remote pump control ideas.

    what the hell is that diagram?
    why are you using a schmit trigger anyway?

    i think later i'll have to do a diagram myself!

    Leave a comment:


  • Dannyx
    replied
    Re: Remote pump control ideas.

    Yes, the board will have its own case.

    Good idea about the optoisolators. I'd drop them between the schmitt trigger's output and the Nucleo's pin like this. The Nucleo's pin would then require pulling up, so I guess this is a good place to use internal pull-ups.

    Should I also be concerned about the 2n2222 trannies spitting back voltage into the micro's pins ? I tested the outputs pretty hard the other days and it didn't seem to complain. There's currently a 1k resistor between the base and the micro's pin, for the record...
    Attached Files
    Last edited by Dannyx; 10-28-2020, 10:44 AM.

    Leave a comment:


  • stj
    replied
    Re: Remote pump control ideas.

    i dont know about your desk, but you need to be carefull with these type of large explosed boards - put them on/in a case or something
    you may want to run your inputs through opto islolators on the final design too - to stop long wires conducting esd into the board if there is a storm

    Leave a comment:


  • Dannyx
    replied
    Re: Remote pump control ideas.

    Originally posted by stj
    check the schematics to see where it goes - i think it's linked to the stlink mcu
    I did some measurements in the meantime and I think it really IS the STM32 that quit.

    I removed SB111 and SB177 to separate the STLink and LAN IC's own RST pins from the rest to see if either of them drags down the NRST line, but no change: it still reads 192ohms and never goes past 0.1v. I thought there might still be hope and something got busted at a more "logic" level (bootloader or stuff which I'm not familiar with), but that doesn't explain why the pin reads such a low value compared to the good board physically ! Ironically, the Aruino IDE seems to upload its sketches just fine and the board is detected as a mass storage device just like before (so flash is working ?), but nothing happens after that. In a more technical way (I THINK), it doesn't enter the "main loop". I even checked with the simplest sketch possible (blink the LED) and it didn't work, so it looks like the STM packed it...

    Scenario 1: I was worried about the 3.3v thing I mentioned, since my Schmitt trigger outputs 5v as "HIGH", but having a look at the datasheet for the STM32F767 IC itself, reveals the maximum input on its pins is VCC + 4v, so 3.3v+4 = 7ish, which puts me well into the safe zone I'd say. To drive the point home even further, this board didn't' even have any "inputs" The phenomenon occurred just as I was trying to add an input pin through a schmitt trigger. I tried loading the sketch with my new changes and noticed the board was just sitting there doing nothing. This led me to believe that the newly added input damaged something, but I doubt it. Meanwhile, the other board (which reads the float sensor and actually HAS two inputs) is happily sitting there with 5v on its pins no problem, so this couldn't have been it...

    Scenario 2: it may have been ESD or something dodgy related to the ethernet jack/my own body/soldering iron...

    Scenario 3: operator error. With so many exposed wires hanging around the bench, maybe one brushed against the board enough to kill it when I moved it around...

    Leave a comment:


  • stj
    replied
    Re: Remote pump control ideas.

    check the schematics to see where it goes - i think it's linked to the stlink mcu

    Leave a comment:


  • Dannyx
    replied
    Re: Remote pump control ideas.

    Just managed to kill one of the boards - the NRST pin is pulled low all the time so the board doesn't initialize....no idea how it happened...
    Last edited by Dannyx; 10-28-2020, 06:45 AM.

    Leave a comment:


  • Dannyx
    replied
    Re: Remote pump control ideas.

    Ok, there were two posts there, but I sorted out the first one - the one about the pin numbers (no delete option here unfortunately, since I would've removed that one).

    I sort-of worked out the second issue too: again, I checked all my connections and wiggled them around (I'm currently on breadboards) and it now works better - the LED no longer dims in sync with the buzzer, though I'm STILL a bit surprised that a "HIGH" pin only reads 3.3v. Having used Arduino so far, I was expecting 5v...

    Leave a comment:


  • stj
    replied
    Re: Remote pump control ideas.

    ???

    Leave a comment:


  • Dannyx
    replied
    Re: Remote pump control ideas.

    Call me an idiot after not realizing this after so long, but what is the operating voltage of these Nucleo boards ? It's only now I realized the digital pins put out 3.3v. I was afraid I messed something up somehow, so I tried the other board, set one of its pins to high and it too only puts out 3.3v...what gives ? HAS it been like this the whole time and I simply didn't notice ??? I could've sworn I saw 5v on one of its pins, and no, not just the 5v output...

    I noticed my LED lamp, which ran perfectly fine till now, dims when the buzzer I have attached to another pin comes on....even if I disconnect the buzzer entirely ! I can see the buzz pattern in the LED lamp ! The lamp is driven via a 2n222a transistor with a 1k resistor, which worked perfectly on 5v on the Arduino and even on the Nucleo....until now ! What's going on ?
    Last edited by Dannyx; 10-27-2020, 08:38 AM.

    Leave a comment:


  • Dannyx
    replied
    Re: Remote pump control ideas.

    I'm having trouble following the port numbering of the F767. Specifically, I can't figure out which pin the red LED (LD3) is connected to. The example sketch for the Arduino environment, mind you, gives it as "LED_BUILTIN" which doesn't help. The datasheet of the board says it's connected to PB14 which would be physical pin 75, but it's not coming on if I set that to "OUTPUT"...The only "true" map of the pins which DOES work is on pages 38-42. If I use the numbers THERE, the pins work as expected, but get this: PB14 is not on there It makes sense, since those pages list the pinout of the unpopulated morpho connectors and the LED is not connected to those - it's straight off the STM.

    I'm sure this would be "easier" in Eclipse, since it's designed specifically for these boards and I saw it even shows a map of the pins which you can click on and configure. The Arduino IDE does some hacky stuff in the background to get this to happen, so that's not helping either.....

    Really should get started with Eclipse (or was it "Cube" ?) Sorry - there's so many pieces to it that I forgot what I needed

    Leave a comment:


  • Dannyx
    replied
    Re: Remote pump control ideas.

    Win 7 x64, though it works at home. Also this is a VERY old laptop which I use strictly for messing around on. It's an Aspire 5920.....with a reflowed graphics card I might add

    Leave a comment:


  • stj
    replied
    Re: Remote pump control ideas.

    what os you running on the laptop?

    Leave a comment:


  • Dannyx
    replied
    Re: Remote pump control ideas.

    I based my setup on THIS, so the schematic looks like so, adapted from the one the chap gave in the post (gotta love that artwork I did in MSPaint because my POS laptop at work won't run KiKad due to openGL or some $h!t ), so the resistor you mention is already in place I think (R2 in this case).

    It seems to work fine this way: when "resting", the lamp if off and the output of the schmitt trigger is LOW, due to the pull-up resistor. You push the button, lamp comes on and output goes high (inverting action).

    I seemed to notice a very short spike in excess of 20v when measuring the the output of the schmitt trigger when I push the button. It quickly stabilizes to 5v as expected and no smoke came out. It could be a fluke of my meter due to noise or something, since I moved the connections around a bit and the spikes seemed to go away too. I haven't killed anything yet, but I'm not sure I should overlook this issue and regard it as "solved"....
    Attached Files

    Leave a comment:


  • stj
    replied
    Re: Remote pump control ideas.

    yes, anode to mcu input you can also use a series resistor to limit the current to the limit of the pin if you want.

    Leave a comment:


  • Dannyx
    replied
    Re: Remote pump control ideas.

    These lamps are not polarized either, so there's a rectifier in them, or two diodes. Still...

    I thought of a simple diode but couldn't figure out where to put it. Assuming we're still switching to GND through the contact like in the schematic, should I put it with the cathode facing the contact and the anode at the the MCU pin (or input pin of schmitt trigger IC in my case) ?

    Leave a comment:


  • stj
    replied
    Re: Remote pump control ideas.

    i think if you put a 1n4148 diode between the mcu and relay you should be good.
    it will block the 12v through the lamp from the mcu
    if that even happens.

    i have some led indicators that dont have polarity, i think they have a rectifier or multiple leds in them.

    Leave a comment:

Related Topics

Collapse

  • tmhobadcap
    Pioneer VSX-522-K remote control not working???
    by tmhobadcap
    I have this receiver for at least 10 years. Usually, we just use the remote for turning on/off and adjusting the volume. Recently, the remote control started not able to turn the receiver on. Later, the volume also could not be adjusted by the remote control.

    At first, I thought that it was the usual problem which can be fixed by cleaning the contacts on the switches and the pcb. I opened the remote and clean it with alcohol. The remote did work again after that. But after one day, it did not work again. I opened it again and clean with alcohol and contact cleaner. Again it worked...
    12-24-2020, 01:44 AM
  • Document Archive
    HP Mobile Thin Client mt44 Mobile Thin Client 3JG86EA Mobile thin client Specification for Upgrade or Repair
    by Document Archive
    This specification for the HP Mobile Thin Client mt44 Mobile Thin Client 3JG86EA Mobile thin client can be useful for upgrading or repairing a laptop that is not working. As a community we are working through our specifications to add valuable data like the mt44 Mobile Thin Client 3JG86EA boardview and mt44 Mobile Thin Client 3JG86EA schematic. Our users have donated over 1 million documents which are being added to the site. This page will be updated soon with additional information. Alternatively you can request additional help from our users directly on the relevant badcaps forum. Please note...
    09-06-2024, 06:50 AM
  • piipo
    Old Privileg 5.1 speakers remote control question
    by piipo
    Hi, I have an old Privileg brand 5.1 speakers. I have lost the remote control. I have an universal Harmony remote but there is no Privileg brand in it's software to add. Does anybody have an idea what alternative brand for a remote can I try instead? I'm attaching an image of what the speakers looks like. The image shows 2 main speakers, they are 5 + 1 in total. Thank you very much
    09-18-2024, 01:55 AM
  • Document Archive
    HP mt44 Mobile Thin Client Mobile thin client Specification for Upgrade or Repair
    by Document Archive
    This specification for the HP mt44 Mobile Thin Client Mobile thin client can be useful for upgrading or repairing a laptop that is not working. As a community we are working through our specifications to add valuable data like the mt44 Mobile Thin Client boardview and mt44 Mobile Thin Client schematic. Our users have donated over 1 million documents which are being added to the site. This page will be updated soon with additional information. Alternatively you can request additional help from our users directly on the relevant badcaps forum. Please note that we offer no warranties that any specification,...
    09-06-2024, 06:50 AM
  • Document Archive
    HP mt44 Mobile Thin Client Mobile thin client Specification for Upgrade or Repair
    by Document Archive
    This specification for the HP mt44 Mobile Thin Client Mobile thin client can be useful for upgrading or repairing a laptop that is not working. As a community we are working through our specifications to add valuable data like the mt44 Mobile Thin Client boardview and mt44 Mobile Thin Client schematic. Our users have donated over 1 million documents which are being added to the site. This page will be updated soon with additional information. Alternatively you can request additional help from our users directly on the relevant badcaps forum. Please note that we offer no warranties that any specification,...
    09-06-2024, 06:50 AM
  • Loading...
  • No more items.
Working...