0

This is the system:

enter image description here

I need a simple way to pass a signal from the upper controller to the lower controller.

The whole purpose is to read an analog voltage, sample it, make statistics, and transfer to the second microcontroller an indication if the threshold has been passed or not.

  • I can't use some Bluetooth/RF signals because of some medical issues.
  • The upper microcontroller could be changed (I need something that knows to read the analog signal and do some measurement and statistics.)
  • Please note that the distance is 5M and I can't increase the amount of wires because of mechanical considerations of the system (it's inside a closed arm this cable that should go through.)
  • I thought of just taking out a GPIO but I'm afraid that the signal will be accompanied by noise and the other side will think it's a logical 1.

Considering the small amount of cables, what are recommended ways to do that?

Edit: need to use in this system only some cable, all the system contains evaluation boards, we havw no time to design custom board

jonathanjo
  • 12,049
  • 3
  • 27
  • 60
Knowledge
  • 329
  • 1
  • 8
  • 1
    Why not have the top MCU control the relay? If there's a good reason why this can't be done then you should add that reason to your question. More details of the other signalling, communication and power cables (and their layout) are needed realistically. – Andy aka Sep 15 '22 at 15:48
  • What's the "too much" amount of wires? Would you consider extending the setup in the future? The CAN bus looks good (signaling is differential, so minimum EMI and it's noise resistant), but is it too bad to have 3 wires? – Vlad Sep 15 '22 at 16:03
  • @Andyaka the bottom mcu control the relay and received analog signal and control it . – Knowledge Sep 15 '22 at 16:19
  • @vlad I need to use in the given system , if I will add CAN I need more components and modules. All the system contains EVB – Knowledge Sep 15 '22 at 16:21
  • 1
    Voting to close because this question needs to have additional knowledge, pun intended. – StainlessSteelRat Sep 15 '22 at 16:56
  • EVB stands for? Embedded Visual Basic. You have not helped your question. You can't design custom board, you ask for best, but do not tell us what we have to work with. *need to use in this system only some cable*. As in, best what? Assume we know nothing (which clearly, at least me, myself and I do). – StainlessSteelRat Sep 15 '22 at 17:45
  • How many wires you have available? What you can and can't add, if adding a CAN PHY is too much? RS-485 PHY, RS-232 PHY, optocoupler? Because we don't know what's the best way for you. – Justme Sep 15 '22 at 18:09
  • Just use GPIO. and check if there is actually noise. If you are worried about noise, put a load resistor at the receiving end so that a reasonable current is required to produce the on voltage. – user253751 Sep 15 '22 at 18:44

3 Answers3

4

Consider RS-485 between the two. It's easy to do, cheap, and can be made extremely reliable. One of the advantages of RS-485 over CANbus and similar is how easy it is to get RS-485 in and out of your laptop for testing and development. Although RS-485 with two stations is essentially RS-422, if you use RS-485 "bus thinking", you can have additional transmitters which is extremely helpful during development.

A previous answer of mine elaborates on the idea https://electronics.stackexchange.com/a/476265/173919

If there's no other purpose to the bottom CPU, consider driving the bottom relay with the RS-485 signal directly.

jonathanjo
  • 12,049
  • 3
  • 27
  • 60
  • But how can I do it without adding TTL to RS422/RS232 ? I cant design custom board and all the boards are EVB shelf product . – Knowledge Sep 15 '22 at 16:26
  • 2
    ROFL If you have restrictions, you need to add them to your question or we are just spinning our wheels. You ask for best and then complain about the best provided. – StainlessSteelRat Sep 15 '22 at 16:54
  • @StainlessSteelRat I had edited the question sorry – Knowledge Sep 15 '22 at 17:08
  • is RS-232 not enough to implement that 5 m communication? How much better is RS-485 compared to RS-232 in that? – Amit M Sep 21 '22 at 14:15
  • 1
    @AmitM if you're sending small packets at slow speeds over 5m, certainly you can do that with RS-232 if you have it. But an RS-232 driver (eg MAX232) is usually more complex to add than an RS-422/RS-485 driver (75176-pinout) which can use lots of different voltages and can go *much* faster if desired. In any case I believe this question is really about a single *BIT*, per https://electronics.stackexchange.com/a/635307/173919, and I'd still use RS-485 driver because easy+cheap=good! – jonathanjo Sep 21 '22 at 14:33
1

If you only need one single logic signal, consider a GPIO with appropriate buffering. An opto-isolator would be one way that allows to you galvanically isolate the two circuits, and less possible issues than a relay (which will suffer from contact bounce and also require a bit more current most likely). This should also give you decent noise immunity unless you are in an unusually hostile environment.

danmcb
  • 6,009
  • 14
  • 29
1

Opening the GPIO ports to outside world, regardless of their direction, is not a good idea. So either use some buffers or, as I'd go for, use constant current: Design a constant current source (like a BJT, an LED or Zener, a few resistors) having high enough to be noise-proof and low enough to be generated and driven easily (5mA should be good), and drive the cable with this. There must be a resistor at the target end. This current will drop a voltage across that resistor. Trigger a transistor with this voltage and viola.

Rohat Kılıç
  • 26,954
  • 3
  • 25
  • 67