Debugging final sensor circuit

Discussion in 'The Projects Forum' started by svdsinner, Apr 3, 2012.

  1. svdsinner

    Thread Starter Member

    May 17, 2011
    39
    2
    I'm stumped and frustrated. I made a fairly simple circuit to sense water levels in a chicken waterer. The goal was that it would light Red LEDs when near empty, one Green LED when partially full, and three Green LEDs when full. Here is a simulation of the circuit I am using. (Requires Java and uses a free circuit simulator)
    Notes:

    • The transistors are 2N5551
    • The LEDs are from my parts bin, so I had to guess their values, but my multimeter shows the amperages are what my simulation predicts.
    • Two switches in the simulation simulate how the sensors behave when they sense water at various levels.
    • The power source is AC because the sensors pass current through liquid, and the contacts will corrode rapidly with DC and require frequent cleaning. I've read that using AC vs. DC make huge differences in cleaning intervals.
    • The circuit began with this design, and was heavily modified by me to suit my purposes.
      • Added the RED light
      • Changed voltage to suit my power source and my LEDs
      • Moved resitors for limiting current to LEDs to physically next to the LEDs, so I would quit burning up LEDs while testing.

    In Simulation, it works.

    On the solderless breadboard, it worked.

    Soldered together in final? The green LEDs all work as expected, but the Red LEDs stay lit continually.

    Debugging steps I've taken: (None of these produced results on identifying what the problem is)

    • All three transistors (2N5551s) work
    • All resistances are correct.
    • Confirmed source voltage
    • Checked Voltage across LEDs
      • Goes up/down appropriately for the green LEDs
      • Stays constant across the Red LEDs (roughly 8.5V, which is right for ON)
    • Increase the base current of the transistor by decreasing the resistor values to try to make the transistor "open wider"
    • Searched the PCB for any solder bridges, and hunted for shorts with a multi-meter, even de-soldered and re-soldered several component to look for issues.
    Any ideas on what could be happening here? Any tests I can do to locate the issue?
     
  2. CDRIVE

    Senior Member

    Jul 1, 2008
    2,223
    99
    I think you would have responses by now if your schematic was posted here.
     
  3. svdsinner

    Thread Starter Member

    May 17, 2011
    39
    2
    It is posted. If you click on the link I provided, the entire circuit opens in an on-line circuit simulator.

    In case you missed it, here is a copy of the link
     
  4. CDRIVE

    Senior Member

    Jul 1, 2008
    2,223
    99
    It needs Java enabled, which I won't do. I will not download, software, plug-ins, dll's or change my browser preferences to view a member's schematic. I suspect that others may not either. You can take a screen shot and attach it here in an image format.
     
  5. svdsinner

    Thread Starter Member

    May 17, 2011
    39
    2
    This is your prerogative. Since I'm the guy needing help, I'm happy to oblige. Screenshot of the schematic:
    [​IMG]
     
  6. wayneh

    Expert

    Sep 9, 2010
    12,145
    3,055
    What's that diode thingy connected to? Nothing?

    You put the current limiting resistors on the emitter side instead of the collector side as they were in the circuit you started with. Not a good idea. In fact that original design would probably work better with both the LED and the resistor on the collector side, so the emitter is directly connected to "ground"
     
  7. svdsinner

    Thread Starter Member

    May 17, 2011
    39
    2
    Nothing. It was a legacy bit from an earlier iteration. The two switches just simulate the water level sensors (Bottom switch open = water below lowest sensor, bottom closed, top open = water above low sensor, but below high sensor, both closed = water above high sensor)

    Interesting. I (out of irritation) moved the resistors physically next to the LEDs (Which are a few feet from the rest of the circuit) because I burned out several LEDs while debugging accidentally sending full power to the LEDS when a debugging probe would make a random short. . .

    I think I should be able to rearrange things to put the transistors on the ground side, but I thought that was primarily done to keep the switching voltages low when using really small transistors or microcontroller outputs. Could the higher CE voltage be causing the 2N5551 trouble? (I'm still learning how to spec transistors, so I don't know)
     
  8. CDRIVE

    Senior Member

    Jul 1, 2008
    2,223
    99
    Then consider using Triacs because you can't use AC with BJTs in that manner. BTW, that schematic hurts my eyes. We'll have to work on your layout skills. :eek:

    EDIT: And what are all those annoying dots that obscure everything. I can't tell if the upper transistor is an NPN, PNP or which node is the emitter and which is the collector.
     
    Last edited: Apr 9, 2012
  9. CDRIVE

    Senior Member

    Jul 1, 2008
    2,223
    99

    Why lights? Wouldn't full automation be preferable? Will a human always be present to monitor the lights?
     
  10. svdsinner

    Thread Starter Member

    May 17, 2011
    39
    2
    Why not? (honest question) Others have been successful doing it (which doesn't mean it isn't a hack) and worked fine on the solder-less bread-board. I was under the impression that the Diode function of the LEDs made using BJTs just fine, since they are then only switching half-wave DC, not full AC.
    I started with a prettier schematic, but as I iterated, I moved the three transistors to the general location where they are on the PCB to help be keep things straight. My older, prettier versions never got updated to the final specs.

    As I mentioned above, all the transistors are identical 2N5551 (NPN) transistors, and the collector is always on top, the emitter on bottom, and the base on the left.

    In the circuit simulator that I used, the dots move in the direction of the current in proportion to the amperage. They aren't useful in a static screenshot.

    This is for our hobby-farm chicken coop, not an industrial operation. The whole idea (beyond an excuse to play with the soldering iron) is to give my wife and I an easy double-check to confirm that when our kids claim to do their chores (including filling the chicken's water) that they actually did what they said they did. We can easily see the lights from inside the house. Humorously, when the kids know Mom and Dad can very, very easily confirm what they say, they tend to be a lot more honest.
     
    Last edited: Apr 9, 2012
  11. wayneh

    Expert

    Sep 9, 2010
    12,145
    3,055
    The exact argument for "trust, but verify".

    Get the kids involved in helping develop a truly automated system. A learning opportunity, one where they will have motivation to make it work.
     
  12. CDRIVE

    Senior Member

    Jul 1, 2008
    2,223
    99
    Are your water level sensors merely two open ended conductors submerged in water?
     
  13. CDRIVE

    Senior Member

    Jul 1, 2008
    2,223
    99
    First off, it's not a good idea to use LEDs as rectifiers. Admittedly, I've done it in the past with no failure but I may have just been lucky. Secondly, when you rectify the electrode current you've defeated your AC requirement to reduce electrode electrolysis.
     
  14. CDRIVE

    Senior Member

    Jul 1, 2008
    2,223
    99
    As you can see here LEDs make poor rectifiers.
     
  15. CDRIVE

    Senior Member

    Jul 1, 2008
    2,223
    99
    svdsinner, are you still with us? I worked something up for you but if you've left the room posting it would be rather pointless.
     
  16. svdsinner

    Thread Starter Member

    May 17, 2011
    39
    2
    I'm here. I'm interested.


    Just realized I missed answering your question: Yes, the sensors are just open ended conductors suspended in the tank that are either submerged (closes the switch) or not-submerged (opens the switch)
     
  17. CDRIVE

    Senior Member

    Jul 1, 2008
    2,223
    99
  18. svdsinner

    Thread Starter Member

    May 17, 2011
    39
    2
    I do have experience on what he is asking about. The part he is working on is not what I'm having trouble with. Is it bad form to help others with their problems until I solve every single problem I'm currently having?

    My issue is that after this circuit worked as expected both on the simulator and the solderless breadboad, it isn't working in final (soldered) form, and I've run out of debugging ideas to figure out what went wrong in the soldered version.

    I'm not really sure what you want me to respond about. I don't need to totally redesign the circuit, since as I mentioned, it worked fine on the solder-less breadboard. I'd be happy to improve it if you have suggestions, and I'm guessing I'm going to have to strip the final circuit down and start over anyway, since I've got no idea what else I can do to locate the fault in the final circuit.

    As fate would have it, this was supposed to be a quick-easy one day project, but due to assembly problems on the final soldered version, I've been stuck in debugging for weeks now.
     
  19. CDRIVE

    Senior Member

    Jul 1, 2008
    2,223
    99
    Sorry to say I could not retain your original circuit. I posted those plots to show you that maximum reverse voltage of the LEDs were being exceeded. I didn't even include the transistors in your circuit that would experience the same excessive reverse voltages.

    Instead I worked up a completely new circuit with the following guidlines...
    (1) The submerged sensor currents would be AC and be as symmetrical as possible.
    (2) The LEDs and Transistors would not see any AC at their terminals. Therefore, not exceed any reverse voltage parameters of the LEDs or transistors.

    The downside is it's more complex than your circuit, so I don't think you'd be interested. I simply don't see a simple mod for your circuit that provides for 1 & 2.
     
  20. svdsinner

    Thread Starter Member

    May 17, 2011
    39
    2
    Regardless of whether I use it or not, I'm always interested. Half the fun of this hobby is learning new stuff.

    And being slightly more complex isn't a disqualifier, especially if it might produce lower maintenance (by using true AC for the sensors). If I've got the parts in my bin, and it isn't ridiculously complex, I'll probably try it.
     
Loading...