Photo transistor into digital input

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • Alexc
    Automated Home Sr Member
    • Apr 2013
    • 82

    Photo transistor into digital input

    This is a bit of a mixture of threads, but a specific issue and I would appreciate some advice.

    Based on the thread about electricity meters and using the flashing output of the meter, I have some BPW85C photo transistors. As Karam wrote, I have the long lead connected to 0v on an input on a QRH module and the shorter lead into one of the inputs. If I shine a torch directly into the sensor, the input changes state.

    My problem is that I have a neon indicator (now part of hot water controls) and I put the photo transistor up to the neon. I expected it to change state when the neon came on. What actually happened is that the QRH sent a stream of data to Cortex, so much that it crashed the software! It then gave me odd fault reports about my PCU.

    I reset and started again, but the same thing happens. Is it picking something up from the neon - perhaps an induced current? I've disconnected it now.

    So - a few questions...

    1 - is it likely that the transistor is too close to the neon?

    2 - from the thread about electricity meters, is there a better, more sensitive sensor that I should try, perhaps that can be mounted a cm or so from the neon? It is in an enclosed box, so would not receive other light apart from when the neon is on.

    3 - I can't remember whether the bottom LED on my PCU-001 should be permanently on or not?

    Thanks.
  • chris_j_hunter
    Automated Home Legend
    • Dec 2007
    • 1713

    #2
    If it's a neon, won't it be going on & off fifty times a second ?
    Our self-build - going further with HA...

    Comment

    • Alexc
      Automated Home Sr Member
      • Apr 2013
      • 82

      #3
      Ah! That would explain it!

      Is there a way I can measure over time? Should I try changing the device to a meter pulsing input?

      Comment

      • chris_j_hunter
        Automated Home Legend
        • Dec 2007
        • 1713

        #4
        Some sort of filter is needed - onboard the module, before going out on the network ... Not something we've done yet, but imagine there's something there ... The data sheet might be first port of call
        Our self-build - going further with HA...

        Comment

        • Alexc
          Automated Home Sr Member
          • Apr 2013
          • 82

          #5
          Thanks Chris. I guess otherwise the traffic would be too great. What about a capacitor in series with the photo transistor? My electronics isn't good enough to know if this is practical, or what size/type.

          Or should I swap the neon for LED?
          Last edited by Alexc; 11 August 2015, 12:20 AM.

          Comment

          • chris_j_hunter
            Automated Home Legend
            • Dec 2007
            • 1713

            #6
            if you can swap, sounds best - but the voltages driving them will not be the same, so not easy to arrange ...

            wonder if there might be other things that could be used - eg: what's switched on & off ...
            Our self-build - going further with HA...

            Comment

            • Karam
              Automated Home Legend
              • Mar 2005
              • 863

              #7
              There is some internal filtering on the inputs but not so aggressive since they have to be able to pulse count at a fair rate. You can try putting a capacitor across the digital input channel, perhaps something like a 47uF. If (as is likely) polarised then ensure the -ve terminal goes to the 0V terminal. You may have to experiment with the capacitor size as its a tradeoff which depends on the effective resistance of the transistor when it is illuminated and for how long (i.e how much it can discharge the capacitor each cycle).

              Comment

              • Alexc
                Automated Home Sr Member
                • Apr 2013
                • 82

                #8
                I added a 47uF (25v) capacitor to the digital input channel, and it cured the problem, without even needing to experiment! Thanks for the advice.
                All working now - when Cortex is calling for hot water, if the temperature has been reached and therefore the cylinder thermostat has kicked in, the 3-port valve energizes the grey wire, the neon comes on, and the digital input reads this as true.

                The other two ways I can think of achieving the same outcome would be either to add another cylinder thermostat to the cylinder and connect that to a digital input, or add a temperature sensor to the tank. As I don't have an analogue module yet, I think this was probably the best way to get to this point. It only costs a couple of pounds too! I'll probably also know if the 3-port valve develops a fault, as Cortex will tell me what's going on.

                Comment

                • chris_j_hunter
                  Automated Home Legend
                  • Dec 2007
                  • 1713

                  #9
                  well done, good to know, too - we have a few things in the pipeline that might find us doing something similar !
                  Our self-build - going further with HA...

                  Comment

                  Working...
                  X