logo elektroda
logo elektroda
X
logo elektroda

Motion sensor with OC output under Grenton digital inputs?

lukaszinsky 747 7
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 20933839
    lukaszinsky
    Level 10  

    Hello,

    I am planning to control the lighting on the staircase. The control is to be automatic when motion is detected on the first or last step.
    Automation in the house will be fixed on a grenton.
    I am looking for some motion/distance sensor in an area up to 1m. Reflective sensors are out of the question.
    I found such a sensor https://www.firmaled.pl/czujka-optyczna-sharp#
    First idea is to connect it to the digital input module, but I see that here is an OC type output - open collector so the state of the line will be indefinite or ground.
    Can OC be connected to digital inputs? Maybe you know better solutions for this kind of sensors?

    Greetings
  • ADVERTISEMENT
  • #2 20933868
    sanfran
    Network and Internet specialist
    I have this hooked up to an Arduino at home under the analogue input. Generally the closer the detector is to the obstacle, the higher the voltage/readings on the port.
    You have to set the threshold of operation by testing.
    One detector started to go crazy for me, giving false readings, I tried to mask this with software but eventually replaced it with a PIR. The other one is SHARP all the time.
    You are interested, I will send a sketch. It works, but it's not beautifully written.
    Sensor mounted on a wooden surface.

    Generally, I'd recommend the PIRs more, they're about 10mm in diameter, you can shield them with a tube to catch movement from a small area. And they are digital.
  • ADVERTISEMENT
  • #3 20933880
    lukaszinsky
    Level 10  

    Quote:
    One detector started to go crazy, giving me false readings, I tried to mask it with software but finally replaced it with a PIR

    Maybe it's a result of not having the adapter the manufacturer writes about? Well, unless you have it in there somewhere.

    The thing is, I don't want to write too much logic to operate the device and certainly operate it via Arduino. Saying that the voltage increases the closer the object is to the sensor seems quite strange because since this has an OC output it is a binary signal I guess meaning ground or no ground. The PIR detector is out of the question as it will have too long a range and opposite the sensor behind the stairs - no wall - I have a living room where I could get misleading signals.

    I am still considering a PIR curtain at the top of the staircase but it will be difficult to set this up to catch the first and last foot - U-shaped staircase.
  • ADVERTISEMENT
  • #4 20933895
    sanfran
    Network and Internet specialist
    When you screw down the PIR sensitivity then you can get readings below 1m.
    I did not buy any adapter.
    In the archives I found what I bought at the time: Sharp GP2Y0A02YK0F
  • ADVERTISEMENT
  • Helpful post
    #5 20934060
    karwo
    Level 31  
    lukaszinsky wrote:
    Can the OC be connected to the digital inputs?
    Of course you can - between the OC output and the +power of the logic you give a resistor 1-2kohm (or less depends on the supply voltage and the possibility of collecting interference - such a pull-up), then the active state is ground.
  • #6 20934083
    lukaszinsky
    Level 10  
    karwo wrote:
    lukaszinsky wrote:
    Can OC be connected to digital inputs?

    Of course you can - between the OC output and the +power supply of the logic you give a resistor 1-2kohm (or less depends on the supply voltage and the possibility of collecting interference - such a pull-up), then the active state is ground.


    Thanks, I've read up on this solution here https://forbot.pl/blog/leksykon/rezystor-podciagajacy-rezystor-pull-up and it seems clear, but I'm bothered by one more thing.
    Does the detector and the digital input module need to be powered from the same power supply? I wonder if powering them from different sources will cause the problem that there is no common ground? E.g. detector powered by 12V and module powered by 24V from 2 power supplies. Could I then encounter any problems? On the other hand, I guess that's what OC is all about, so that devices running on different voltages can be easily integrated via a common ground, well, but how does that relate to 2 different power supplies?
  • Helpful post
    #7 20934091
    Anonymous
    Level 1  
  • Helpful post
    #8 20934340
    karwo
    Level 31  
    lukaszinsky wrote:
    Do the detector and the digital input module need to be powered from the same power supply? I wonder if powering them from different sources will cause the problem that there is no common ground? E.g. detector powered by 12V and module 24V from 2 power supplies.

    Pull-up is supposed to be from input circuit supply voltage, common ground. Check that the sensor OC output accepts 24V. If not there is another option - between the sensor supply and the output you give a relay coil (with a protection diode) and from the contacts of this relay you control the input of another module.

Topic summary

The discussion revolves around integrating a motion sensor with an open collector (OC) output into a Grenton digital input module for automatic staircase lighting control. The user seeks a sensor that operates effectively within a 1m range, dismissing reflective sensors. Recommendations include using a PIR sensor, although concerns about its range and potential false readings in the living room are noted. The feasibility of connecting the OC output to digital inputs is confirmed, with suggestions to use a pull-up resistor for proper operation. The user also inquires about powering the sensor and module from different voltage sources and the implications for common ground. Additional solutions involve using a relay to manage different power supplies.
Summary generated by the language model.
ADVERTISEMENT