logo elektroda
logo elektroda
X
logo elektroda

What plug should I choose for the light sensor and will a 4-pin JACK be good?

ziajek444 1542 7
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 16949324
    ziajek444
    Level 9  
    I am building a light sensor. The main components of my sensor are: Atmega8 (takes measurements and communicates over rs232), photoresistor (light sensitive element). With this sensor, the controller must communicate via rs232 but I want to power the sensor itself from the controller. In the skin, I want to transmit MASS, Rx, Tx, POWER over the cable connecting the controller and the sensor. Which connector should I choose? The expected length of the cable is between 2-30 metres. Because of the wide variation in length, this could be two different plug proposals (e.g. 2-5m and 5-30m). However, it would be more convenient to have one type of plug.

    I am currently considering a JAck 4 field plug and a standard width like the headphone input for a desktop computer.
  • ADVERTISEMENT
  • #2 16949338
    stonefree
    Level 27  
    If RS232, why not a DB-9 connector? And why two different plugs for two different cable lengths?
  • ADVERTISEMENT
  • Helpful post
    #3 16949359
    czareqpl
    Level 33  
    What about if someone puts in a 3 pole jack? Does he short the power to TX/RX or does he short the ground to TX/RX?

    I would recommend EDG connectors in a 3.5mm or similar raster. They go in tightly, hold firmly. You can also easily change the pin order.

    You can also use the softer connectors from the WS/HS family or the slightly larger connectors from the 402/403 family (molexes like in computer fans).

    How about using RJ11 connectors?
  • ADVERTISEMENT
  • #4 16949391
    ziajek444
    Level 9  
    stonefree wrote:
    If RS232 then why not a DB-9 connector?
    .
    Because it's inconvenient to fit and it's expensive with sockets. Well, and I only need 4 wires so I feel it would be a bit of overkill to choose a plug with so many pins.

    stonefree wrote:
    And why two different plugs for two different cable lengths?
    .
    I don't know, it seemed to me that not every type of plug is suitable for every distance. My thinking was a consequence of reading about symmetrical cables.
  • ADVERTISEMENT
  • #5 16949763
    CYRUS2
    Level 43  
    ziajek444 wrote:
    I am building a light sensor. The main components of my sensor are: Atmega8 (takes measurements and communicates over rs232).
    .
    What is the purpose of the microprocessor there - what is the microprocessor supposed to do ?
  • #6 16949950
    ziajek444
    Level 9  
    CYRUS2 wrote:
    What is the purpose of the microprocessor there - what is the microprocessor supposed to do ?
    .

    Buddy @CYRUS2 , The microprocessor analyses the analogue signal created by the current flowing through a voltage divider made of a photoresistor and a resistor. It converts such an analysed signal into a human-understandable value expressed in Lux.

    Anticipating further questions. When the sensor is queried for a value, it must provide this immediately so that the controller can react accordingly. The sensor is powered by a wire from the controller. Communication takes place via rs232.
  • #7 16951092
    CYRUS2
    Level 43  
    ziajek444 wrote:
    Kolego @CYRUS2 , The microprocessor analyses the analogue signal resulting from the current flowing through a voltage divider built from a photoresistor and a resistor. Such an analysed signal is converted into a human-understandable value expressed in Lux.
    This does not need to be explained to me.
    ziajek444 wrote:
    Preventing further questions. When the sensor is asked for a value, it has to give it immediately so that the controller can respond accordingly.
    The photoresistor is a rather slow sensor. It has its drawbacks.
    My advice is - have the colleague first check how the photoresistor - resistor measures the illumination,
    Whether the sensor circuit itself meets the colleague's measurement expectations.
  • #8 17018493
    ziajek444
    Level 9  
    Does it meet my expectations without any problems? In which plane would the problems manifest themselves?

Topic summary

A light sensor system using an Atmega8 microcontroller communicates via RS232 and is powered from the controller through a single cable carrying MASS (ground), Rx, Tx, and POWER lines. The user seeks advice on an appropriate connector type for cable lengths ranging from 2 to 30 meters, preferably a single plug type. Suggestions include using a DB-9 connector, commonly associated with RS232, or a 4-pin jack similar to headphone connectors. Concerns were raised about potential misconnection risks with 3-pole jacks shorting power or signal lines. Alternative connector recommendations include EDG connectors with 3.5mm pitch, WS/HS family connectors, Molex 402/403 series (used in computer fans), and RJ11 connectors. The user prefers a compact, cost-effective connector with only four wires, avoiding overkill from multi-pin connectors. The microcontroller processes analog signals from a photoresistor voltage divider to output lux values on demand. The photoresistor's slow response and measurement accuracy were noted as potential issues to verify before finalizing the sensor design.
Summary generated by the language model.
ADVERTISEMENT