Announcement

Collapse
No announcement yet.

Remote pump control ideas.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Re: Remote pump control ideas.

    Ok, time for more details, since it's getting interesting Here's a picture of the box holding all the high power parts, including the contactor. In the original setup, their power supply was in here too, so I kinda rolled with it and put it in the corner there myself. Looking at it now, I realize all my wires going back and forth in there are a bit too close for comfort to those big three phase wires sticking out the top of the contactor, and to the contactor itself for that matter, so that's one aspect which may be a no-no, despite most of them you see being outputs to the LED indicators on the door and these are GNDs which are "behind" optocouplers.

    The only "direct" connection to my Nucleo144 is the GND wire and the 12v wire - the rest seem to be isolated, the way I see it, of course. There IS one other wire which is connected directly to the perfboard, which is a 5v wire coming from the PSU (12+5v output supply) which I send to the transistor sides of each of the optocouplers to drive the bases of the 2n2222a transistors which in turn provide the LEDs (and small control relay) with their GND, allowing them to switch on. I didn't want to use the Nucleo's built-in 5v regulator for fear I may overload it - since I have a 5v-capable supply, I figured I should use that.

    My "brains" sit in a box right above this one, with the Nucleo at the very top, that brown perfboard in the middle and a GSM dialer module at the bottom. I realize now, after testing it some more today, that this GSM module may be causing interference of its own - more on this later, as it can easily be removed and it's not mission-critical ATM. I just found it there and decided to keep it...

    The contactor is this one, in case someone's curious, plus it also allows me to look up the actual current draw of the coil, which the datasheet gives as 190VA at pull-in which then drops to 16VA holding (if I'm not mistaken by the numbers on pages 3 to 4). I was thinking these figures may be relevant when trying to design some sort of snubber for it.

    About this: varistor vs. snubber. I read about varistors and know what they are in general, having worked with power supplies in consumer electronics before which all have them, but reading more closely about their performance over time and also the possible fires they can start concerns me. This is out in the middle of nowhere, where power is anything BUT stable....so there's that. I'm not sure how an RC snubber would perform by comparison, what its strengths and weaknesses are and whether that formula I found holds true for AC as well...

    Originally posted by redwire View Post
    How is the earth-grounding to the 12V side done? Or is it floating? You can add a 0.1uF cap from 12VDC(-) to earth ground and that usually helps, if the EMI is present there.
    Let's talk about this: in the picture, you see two fat leads coming in at the bottom of the box. The bundle on the left, which goes into the MCB, is the three-phase input and the one on the right is the output to the pump from the contactor (after one of the phases passes through that motor protection). From what I can assume, since I'm no electrician, the fat blue wire is our neutral. However, I don't see a PE wire as well. The fat green/yellow "PE" conductor visible, which SHOULD ground the box is just going out to the pump, but I'm not sure if this is floating or is tied to the neutral conductor in the distribution box somewhere, so that may be of concern. The PE could be floating for all I know, since unless the fat green lead is tied to earth where the pump is at the other end of the loom on the right side, I'd say there IS no PE as it stands, so the box is "floating", since the white neutral terminal block at the far right (next to the "Eldon" fan thermostat) does not contact the metal frame, while the green ones purposely do, since they ARE meant to contact the metal frame and I measured them and it makes perfect sense to be that way. The blue wire does nothing but carry the neutral into my box and that's it...and I'm not comfortable enough to actually tie blue to the green PE wire (and chassis), even though I'm pretty sure this is a TN-C system and they are ALREADY tied together at the distribution box...this takes an electrician to do, which I'm not.

    This would mean the PE of my Meanwell supply up there is floating and not dissipating anything. Construction-wise, I'm expecting the supply itself to have a blue Y cap between the PE screw terminal and the the 12v GND terminal (our negative 12v, or "return" as I've seen it written on some supplies when talking about the SECONDARY side)...

    Oh and don't worry about that junction box at the far left - that's just something I threw in there to allow me connect multiple wires to GND or 12v more easily, since I knew I'd wouldn't be able to stuff all of that directly onto the screw terminals of the power supply, so I added those pre-assembled busbars to give me more screws to work with
    Attached Files
    Last edited by Dannyx; 03-04-2021, 01:06 PM.
    Wattevah...

    Comment


      Re: Remote pump control ideas.

      You can measure ACV between the backpan and some known earth-ground, such as the motor frame or tank etc.
      If it's a low ACV reading, then proceed to measure ohms to see if the panel is actually grounded or it's going to Neutral.

      GSM modules do make a lot of RF. Easily 2A pulses on power.
      What is the antenna? Sometimes I have seen a grounding problem with the antenna bolted to equipment metal, so the antenna is grounded to the frame and thus the coax and GMS module and maybe everything get grounded that way.
      It's not good to have the module+antenna grounding everything. I've even seen melted PCB traces.

      There is a chance you've saved too much money stuffing all the low V and high V into a rat's nest.
      The Meanwell PSU should have been bolted to the metal backpan so the case is grounded, not the top of the box so water can get in when it rains. Usually you have no holes on the top of an outdoor enclosure.

      Comment


        Re: Remote pump control ideas.

        Originally posted by redwire View Post
        You can measure ACV between the backpan and some known earth-ground, such as the motor frame or tank etc.
        If it's a low ACV reading, then proceed to measure ohms to see if the panel is actually grounded or it's going to Neutral.
        I'm pretty sure it's a TN-C system, so there's no dedicated earth stake (PE=N). I can't get to the pump itself, since it's below ground under an access hatch...doesn't matter. There is an old rusty, nasty, disgusting utility panel next to the box I pictured and I can indeed see the three large fuses there, but haven't looked in depth to see if that blue N wire is also tied to a PE bar in there (provided it even exists in the first place). If it doesn't, I guess there IS no PE....unless the N is earthed at the transformer end....it gets tricky I guess I could also measure between one of the 3 phases and the back plane - if I get 230v, would that make the back plane earthed ??

        Originally posted by redwire View Post
        What is the antenna? Sometimes I have seen a grounding problem with the antenna bolted to equipment metal, so the antenna is grounded to the frame and thus the coax and GMS module and maybe everything get grounded that way.
        It's not good to have the module+antenna grounding everything. I've even seen melted PCB traces.
        The antenna looks like this one: magnet at the bottom, long wire terminated with the SMA connector which screws onto the GSM board. I guess I might as well show you a picture of the top box as well, though this is the only one I have ATM, back when it was still under construction, so it's a little empty in there. You can see the GSM board chilling on the bottom of the top box there. It would later be bolted below the brown perfboard, like the other two as described before. You can also see how the antenna lead goes out of the bottom-left of the box, through a piece of cable raceway (or whatever you call that white snap-on cable cover thing at the left), through a hole in the wall and the antenna itself is just slapped with its magnetic base onto the security grating covering the small window of this shack.....which brings me to this next part:

        Originally posted by redwire View Post
        The Meanwell PSU should have been bolted to the metal backpan so the case is grounded, not the top of the box so water can get in when it rains. Usually you have no holes on the top of an outdoor enclosure.
        Let's also set this part straight: this is all inside a small shack, definitely not out in the open. It DOES get extremely chilly there, but not sopping wet, ever.

        I connected the earth screw terminal of the supply to the metal chassis which in turn connects it to the fat green PE lead....(whatever that might be, as I'm not sure), so I don't think it should be necessarily touching the metal back as long as I have its earth terminal connected to the metal back, provided it IS earthed.

        Looking at the block diagram of this supply, it seems the GND (COM terminal or whatever) is not mains-earth referenced, because I see a capacitor there. In layman terms, if I put my meter across the PE screw and the COM screw there will be high impedance. I'm not sure if I should indeed tie COM to earth or if it would make it worse by making the whole backplane act like a huge antenna, coupling all that noise and crap straight into my board's GND...

        This contrasts to how I know most TVs with a PE terminal: the PE terminal of the IEC13 lead IS connected directly to chassis GND, (cold negative).
        Attached Files
        Wattevah...

        Comment


          Re: Remote pump control ideas.

          Ok, more things we tried today, to little success.

          I first measured the green PE conductor and it appears to be connected indeed - I get little resistance between it and the blue neutral wire and also get 240v between it and each of the 3 phases, so this makes the metal back and the chassis of the Meanwell PSU earthed. I measured the COM terminal of the Meanwell PSU and it's not main-earth referenced indeed, as the datasheet for the supply would indicate - it's capacitively coupled to earth, not a dead-short.

          I took the risk and attempted a snubber across the small relay's contacts as well. I used the setup in the picture (wrapped in heat-shrink of course): a 0.1uF cap in series with a 47ohm resistor, following the discussion on this topic I had with the shop owner of the electronics store I got these parts from - he's a tech himself and we're close buds and he suggested a slightly higher 47ohm resistor, as opposed to the 33ohm one suggested. Thankfully nothing popped, but I'm not sure it's beneficial either....either way, it can't do WORSE I reckon, can it ?

          None of these stopped the "client" from eventually going offline though. Not immediately, but about half an hour of being "OK"...

          Another thing currently on my mind - actually several: moving my "brains" as far away from the power box as possible, despite this shack being pretty small - less than 3 meters wall to wall, so that's my maximum. I'm not sure if I should use the current plastic box or invest in a metal one. If metal, should I earth it or GROUND it ? I'd say earth it...

          Also: using a second power supply JUST for the Nucleo board and the "LED" side of the optocouplers. I figured despite my best efforts, the GND wire running to the 12v relay, as well as to the various indicators I installed on the door of the power box, will always be in close proximity to high power stuff, possibly nullifying all other attempts at figuring out where the problem is, since I'm injecting noise into my GND wire...maybe. The idea actually came from my boss and I think it's not as crazy as it seems: if you think about it, an optocoupler doesn't have to use the same ground on both sides - they can come from different supplies. I figured I'd have one supply run the indicators and the 12v relay: I'd pass its GND through the 2n2222a transistors which are in turn driven by the transistor side of the optocouplers from the second voltage rail of my Meanwell PSU - 5v.

          The current setup in the picture uses a 220ohm resistor in series with the optocoupler's transistor to the 2n2222a's base and 3.3v from the Nucleo's own regulator. I'm not sure if the 2n2222a can handle 5v instead of 3.3v with this 220ohm base resistor or if it needs to be bumped up some more - haven't done the math yet.

          On the "MCU" side of things it's even easier, since I only have to worry about the 12v input to the Nucleo - the optocoupler's LED side is already working on 3.3v supplied from each digital pin of the MCU...

          In other words, I'd cut that GND trace where the emitter meets the LED in my little schematic there and have two separate GNDs: a "clean" one for the box (which would also get relocated) and a "dirty" one in my power box...hope this is remotely close to feasible
          Attached Files
          Wattevah...

          Comment


            Re: Remote pump control ideas.

            maybe you need a common-mode choke on the dc between the meanwell and nucleo - to kill any parasitic shit the wiring collects

            Comment


              Re: Remote pump control ideas.

              Originally posted by stj View Post
              maybe you need a common-mode choke on the dc between the meanwell and nucleo - to kill any parasitic shit the wiring collects
              Can I harvest this from some random sh!t I find around the shop ?
              Wattevah...

              Comment


                Re: Remote pump control ideas.

                yes, the thing like a 4pin transformer on any switching psu - like dvd players etc.
                near the mains input

                Comment


                  Re: Remote pump control ideas.

                  Originally posted by stj View Post
                  yes, the thing like a 4pin transformer on any switching psu - like dvd players etc.
                  near the mains input
                  I know what it looks like I was more curious if it should have a specific value/size...etc or if it's enough to be in the ballpark.
                  Wattevah...

                  Comment


                    Re: Remote pump control ideas.

                    we just experimenting
                    and the nucleo isnt going to be pulling several amps - so size isnt a thing.

                    Comment


                      Re: Remote pump control ideas.

                      A quick mod of the snippet I posted earlier: THIS is what I had in mind with those two separate supplies. The suffix _CON is for the "dirty, noisy, nasty" control side of things and _MCU is for the "clean" side where my Nucleo sits.

                      I realize now I probably made a mistake when choosing those 220ohm resistors for the opto's LED on the Nucleo's side: running the numbers again with the datasheet for the PC817 would make 220ohms more appropriate if the input were 5v instead of the 3.3v the Nucleo puts out on its pins. I can't remember if I dropped the value down to 100ohms in the final design and forgot to update the schematic, or I rolled with 220ohms indeed.

                      I THINK 100ohms would be more suitable for 3.3v input for a PC817. Correct me if I'm wrong:

                      (Vsup - VfMAX)/ If = R, so (3.3v-1.4v) / 0.02A = 95ohms....provided we take the MAXIMUM value of Vf in the datasheet.

                      On the transistor side, I again went with 220ohms, but I think this one can stay as it is even if I'm planning to have two separate supplies like this. If you compare the original snippet with this one, the collector was also connected to 3.3v there, which came from the Nucleo's own regulator. Since I'm planning to separate stuff, I don't have another 3.3v supply I can use on the "control" side, but I DO have the 5v output of the Meanwell. Once again, I ran the numbers like this and I think 220ohms is fine:

                      (Vsup - VbeMAX) / Rbase= Ib
                      Ib * hFeMin = Ic

                      So (5v-1.2v) / 220ohm = 0.018A
                      0.018A * 35 = 0.6A of collector current to drive lamps and my relay with.

                      This is taking the worst possible Vbe drop of 1.2v and the worst possible gain of 35, so in reality I'm expecting the collector current to be even better than this, as the gain will be closer to 100. The most power-hungry component I'd need to drive is the 12v relay, which sadly I can't remember the holding current of. The pull-in current is higher anyway, but shorter. The rest of the outputs are 12v LED indicators which draw like 60mA each. There's 4 of these, so 5 pairs of optos+transistors in this configuration.
                      Attached Files
                      Wattevah...

                      Comment


                        Re: Remote pump control ideas.

                        I tried my separate supply idea on the breadboard today and it seems to work - nothing went up in smoke and the thing runs fine.

                        I also realized I may not be doing the right thing when it comes to driving the piezo buzzer I threw on there when I originally designed that "interface" board: I just wired it up straight to one of the Nucleo's pins, which may not be a wise thing to do ! Most of the tutorials on driving a buzzer with the Arduino (I'm sure it applies to the STM too) show a resistor in series with it too !
                        What I tried today was using a 2n2222 transistor to drive the buzzer from 5v like this, except the 5v is straight off the Meanwell supply, not the regulator of the Nucleo: collector to one of the buzzer's legs, emitter to GND, 5v from the power supply to the other leg of the buzzer, base to the Nucleo's pin via 220ohm resistor. It beeps nice and loud and thankfully didn't kill the pin. I learned these buzzers have a "kickback" like relays and coils, so it's apparently not a good idea to drive them directly with a micro...
                        Last edited by Dannyx; 03-09-2021, 11:24 AM.
                        Wattevah...

                        Comment


                          Re: Remote pump control ideas.

                          Time for a optic sensor
                          9 PC LCD Monitor
                          6 LCD Flat Screen TV
                          30 Desk Top Switching Power Supply
                          10 Battery Charger Switching Power Supply for Power Tool
                          6 18v Lithium Battery Power Boards for Tool Battery Packs
                          1 XBox 360 Switching Power Supply and M Board
                          25 Servo Drives 220/460 3 Phase
                          6 De-soldering Station Switching Power Supply 1 Power Supply
                          1 Dell Mother Board
                          15 Computer Power Supply
                          1 HP Printer Supply & Control Board * lighting finished it *


                          These two repairs where found with a ESR meter...> Temp at 50*F then at 90*F the ESR reading more than 10%

                          1 Over Head Crane Current Sensing Board ( VFD Failure Five Years Later )
                          2 Hem Saw Computer Stack Board

                          All of these had CAPs POOF
                          All of the mosfet that are taken out by bad caps

                          Comment


                            Re: Remote pump control ideas.

                            Originally posted by sam_sam_sam View Post
                            Time for a optic sensor
                            Would that be for reading the tank level ?
                            Wattevah...

                            Comment


                              Re: Remote pump control ideas.

                              Originally posted by Dannyx View Post
                              Would that be for reading the tank level ?
                              I was talking about your buzzer
                              9 PC LCD Monitor
                              6 LCD Flat Screen TV
                              30 Desk Top Switching Power Supply
                              10 Battery Charger Switching Power Supply for Power Tool
                              6 18v Lithium Battery Power Boards for Tool Battery Packs
                              1 XBox 360 Switching Power Supply and M Board
                              25 Servo Drives 220/460 3 Phase
                              6 De-soldering Station Switching Power Supply 1 Power Supply
                              1 Dell Mother Board
                              15 Computer Power Supply
                              1 HP Printer Supply & Control Board * lighting finished it *


                              These two repairs where found with a ESR meter...> Temp at 50*F then at 90*F the ESR reading more than 10%

                              1 Over Head Crane Current Sensing Board ( VFD Failure Five Years Later )
                              2 Hem Saw Computer Stack Board

                              All of these had CAPs POOF
                              All of the mosfet that are taken out by bad caps

                              Comment


                                Re: Remote pump control ideas.

                                Originally posted by sam_sam_sam View Post
                                I was talking about your buzzer
                                I sense sarcasm

                                Wasn't that hard - just called the tone() function with every "poll" to indicate I'm still getting stuff from my "server".
                                Wattevah...

                                Comment


                                  Re: Remote pump control ideas.

                                  Originally posted by Dannyx View Post
                                  Would that be for reading the tank level ?
                                  You might be able even this depends on how the device is made you use a optic sensor for isolation purposes

                                  I just googled it and I found one of the adds that I have seen before

                                  https://www.youtube.com/watch?v=2DO2o8rG9Xw

                                  I do not know if would help you or not

                                  But answer your question I saw somewhere on the internet but I do remember if wasn’t some type of laser that was doing this function I saw this add but did not have time to read it that day I do not know if this add explains how it works or types of liquid it can or cannot sense
                                  Last edited by sam_sam_sam; 03-12-2021, 10:53 AM.
                                  9 PC LCD Monitor
                                  6 LCD Flat Screen TV
                                  30 Desk Top Switching Power Supply
                                  10 Battery Charger Switching Power Supply for Power Tool
                                  6 18v Lithium Battery Power Boards for Tool Battery Packs
                                  1 XBox 360 Switching Power Supply and M Board
                                  25 Servo Drives 220/460 3 Phase
                                  6 De-soldering Station Switching Power Supply 1 Power Supply
                                  1 Dell Mother Board
                                  15 Computer Power Supply
                                  1 HP Printer Supply & Control Board * lighting finished it *


                                  These two repairs where found with a ESR meter...> Temp at 50*F then at 90*F the ESR reading more than 10%

                                  1 Over Head Crane Current Sensing Board ( VFD Failure Five Years Later )
                                  2 Hem Saw Computer Stack Board

                                  All of these had CAPs POOF
                                  All of the mosfet that are taken out by bad caps

                                  Comment


                                    Re: Remote pump control ideas.

                                    My workmate and I started thinking of a different, more reliable yet just as simple way of determining the water level and we came up with this: two of these switches mounted on a long piece of tube of the right length, one at the top and one at the bottom, which we'd then lower into our tank. Although I'm sure these are nothing more than a simple reed switch with a permanent ferrite magnet on that pivot arm, I'm not confident to just fully submerge the bottom one without any insulation whatsoever, so to protect them as much as possible and keep water out from the back part where I presume the wires come out of, we thought we'd mount these in a water-tight enclosure made out of plastic pipe. We'd add 2 t-fittings at the right spots on our tube where the switches are meant to sit to properly register "full" (both closed) and "empty" (both open). We'd install the switches on end-caps onto each t-fitting. Seal everything nicely, with a silicone sealant or PVC cement if necessary, and now water can't get in to where the wires are inside the stem which runs to the top of the tank. Tweak the code a bit on the "server" and I think we'd be good

                                    Code has been running fine for the past 2 days on my bench BTW
                                    Attached Files
                                    Wattevah...

                                    Comment


                                      Re: Remote pump control ideas.

                                      you can use a pressure sensor on the tank outlet, water has weight.
                                      that's how washingmachines fill.
                                      or just fit a float-switch

                                      Comment


                                        Re: Remote pump control ideas.

                                        Originally posted by stj View Post
                                        you can use a pressure sensor on the tank outlet, water has weight.
                                        That outlet is WAY underground. We only have access to the top hatch, so we will most likely go with this

                                        Originally posted by stj View Post
                                        or just fit a float-switch
                                        Wattevah...

                                        Comment


                                          Re: Remote pump control ideas.

                                          Ok, I managed to jinx the whole thing: client froze again just now ....it may have something to do with the DHCP lease expiring and the part that handles it freezes the code somehow....it's beyond my programming scopes sadly
                                          Wattevah...

                                          Comment

                                          Working...
                                          X