Remote pump control ideas.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Dannyx
    CertifiedAxhole
    • Aug 2016
    • 3912
    • Romania

    #141
    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...
    Wattevah...

    Comment

    • Dannyx
      CertifiedAxhole
      • Aug 2016
      • 3912
      • Romania

      #142
      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.
      Wattevah...

      Comment

      • stj
        Great Sage 齊天大聖
        • Dec 2009
        • 30951
        • Albion

        #143
        Re: Remote pump control ideas.

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

        Comment

        • Dannyx
          CertifiedAxhole
          • Aug 2016
          • 3912
          • Romania

          #144
          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...
          Wattevah...

          Comment

          • stj
            Great Sage 齊天大聖
            • Dec 2009
            • 30951
            • Albion

            #145
            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

            Comment

            • Dannyx
              CertifiedAxhole
              • Aug 2016
              • 3912
              • Romania

              #146
              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.
              Wattevah...

              Comment

              • stj
                Great Sage 齊天大聖
                • Dec 2009
                • 30951
                • Albion

                #147
                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!

                Comment

                • Dannyx
                  CertifiedAxhole
                  • Aug 2016
                  • 3912
                  • Romania

                  #148
                  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 ?
                  Wattevah...

                  Comment

                  • redwire
                    Badcaps Legend
                    • Dec 2010
                    • 3900
                    • Canada

                    #149
                    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

                    Comment

                    • Dannyx
                      CertifiedAxhole
                      • Aug 2016
                      • 3912
                      • Romania

                      #150
                      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.
                      Wattevah...

                      Comment

                      • redwire
                        Badcaps Legend
                        • Dec 2010
                        • 3900
                        • Canada

                        #151
                        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.

                        Comment

                        • Dannyx
                          CertifiedAxhole
                          • Aug 2016
                          • 3912
                          • Romania

                          #152
                          Re: Remote pump control ideas.

                          Great pointers as usual. Cheers !
                          Originally posted by redwire
                          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.
                          I see now. What is the math behind this ?


                          Originally posted by redwire
                          That circuit - the LED lamp sees ~7V when the switch is open, and 12V when closed, so the old/bright dim thing.
                          Yes - I axed that idea anyway.

                          Originally posted by redwire
                          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.
                          Yes, it was getting too complicated indeed, so up on the hill, which is battery powered, and there are no lamps to drive at the same time as a MCU pin, I'll be using the 3.3v output for the tank toggle switch. I bench-tested the setup shown in the schematic and it works: I used a single 100ohm resistor in series with the anode of the optocoupler. It might be too sensitive though, as you described, so it could false-trigger (though I do have a pretty long countdown delay time in code before the MCU actually acts and does anything with that input). I talk about battery power and energy conservation here, though probably even 12v across 1.5k resistors in series with the opto's anode would not draw THAT much extra power compared to my 3.3v idea, so it may not be that much more efficient...

                          For the pump panel which is utility-powered and there are 12v lamps to power as well, I HAVE to use 12v with the 1.5k resistors in series, otherwise I'd run into that issue of not being able to properly turn off the lamps, so I'll do it like in your first schematic.
                          Attached Files
                          Wattevah...

                          Comment

                          • Dannyx
                            CertifiedAxhole
                            • Aug 2016
                            • 3912
                            • Romania

                            #153
                            Re: Remote pump control ideas.

                            Turning back to the "dead" Nucleo: I'm tempted to get a chip off Ali to fix it....I doubt it's a drop-in replacement though since it's essentially a computer and requires some programming to work the way it did out of the box. Trouble is I have no idea how to do that, what I need or IF it can be done AT ALL with no external tools and pieces of software...the more astute in this field could probably provide an answer....
                            Wattevah...

                            Comment

                            • stj
                              Great Sage 齊天大聖
                              • Dec 2009
                              • 30951
                              • Albion

                              #154
                              Re: Remote pump control ideas.

                              there is no programming for the main chip, only the stlink mcu has code on it.
                              (and i have that! )

                              Comment

                              • Dannyx
                                CertifiedAxhole
                                • Aug 2016
                                • 3912
                                • Romania

                                #155
                                Re: Remote pump control ideas.

                                Originally posted by stj
                                there is no programming for the main chip, only the stlink mcu has code on it.
                                (and i have that! )
                                So I can just drop a new chip in, provided the STlink is good ? The board's still detected and even goes as far as to upload sketches to it, but doesn't run anything after that, the NRST pin being asserted low all the time...
                                Wattevah...

                                Comment

                                • stj
                                  Great Sage 齊天大聖
                                  • Dec 2009
                                  • 30951
                                  • Albion

                                  #156
                                  Re: Remote pump control ideas.

                                  well if you are sure it's the chip holding it's own reset line down.

                                  btw, a bit of a bodge, but try adding a pullup resistor to 3v3

                                  Comment

                                  • Dannyx
                                    CertifiedAxhole
                                    • Aug 2016
                                    • 3912
                                    • Romania

                                    #157
                                    Re: Remote pump control ideas.

                                    Originally posted by stj
                                    well if you are sure it's the chip holding it's own reset line down.

                                    btw, a bit of a bodge, but try adding a pullup resistor to 3v3
                                    I thought of that too, but given the resistance to GND on the RST pin is around 192ohms on the "dead" board and around 7Meg-ohms on the good one, I think something went pop inside the chip.

                                    I removed two 0-ohm resistors which connect together the RST lines of the ethernet chip and the STLink to try and narrow down where the low resistance is and unfortunately it seems to be facing the MCU. There's no solder bridge I can further remove to isolate the RST pin of the MCU entirely, so I doubt there's anything left on that line that can cause this...the only way to find out would be to pop off the chip and see if the reset pin restores to 3.3v...
                                    Wattevah...

                                    Comment

                                    • stj
                                      Great Sage 齊天大聖
                                      • Dec 2009
                                      • 30951
                                      • Albion

                                      #158
                                      Re: Remote pump control ideas.

                                      hardwire it to 3v3 at the regulator (for max current) and see if you can blow out the shorted gate.
                                      nothing to lose trying!

                                      Comment

                                      • Dannyx
                                        CertifiedAxhole
                                        • Aug 2016
                                        • 3912
                                        • Romania

                                        #159
                                        Re: Remote pump control ideas.

                                        I don't think the regulator can provide the necessary current to do that, plus I risk damaging it more...tempting, but I don't think I'd do it after all
                                        Wattevah...

                                        Comment

                                        • Dannyx
                                          CertifiedAxhole
                                          • Aug 2016
                                          • 3912
                                          • Romania

                                          #160
                                          Re: Remote pump control ideas.

                                          Back to protecting my sh!t: can I also use optocouplers the other way around to protect "output" pins too, like so ? I saw this setup somewhere on the web, I tested it for around half and hour and it seems to work reliably enough, at least on the bench under normal temperature conditions. It's for powering the 12v relay which in turn provides 230v to the main contactor, since that's its rating...I originally had the MCU pin straight on the base of that 2n2222 but I thought the MCU may not like the arcing that goes on in the 12v relay close to the wire which leads back to the 2n2222. Don't worry about not having a flyback diode across the relay in the schematic - I have a 1n4007 there in reality.
                                          Attached Files
                                          Wattevah...

                                          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...