Analog signal in noisy environment

Discussion in 'General Electronics Chat' started by ebeowulf17, Jan 16, 2016.

  1. ebeowulf17

    Thread Starter Active Member

    Aug 12, 2014
    678
    79
    I'm brainstorming right now, working on ideas for adding an analog input signal on an espresso machine. Assume the setup is nearly worst case scenario - 60Hz mains hum vulnerability, inductive noise spikes from motors and solenoids starting and stopping, reasonable, but still imperfect grounding schemes, etc. The only bright spot is that wire runs are not terribly long, probably 8-10' on the longest runs. There are 240VAC lines running and switching all over the place, and the sensors are running on a 5VDC supply.

    In this scenario, if you had a 5VDC sensor board that needed to send a signal to the main control board MCU, which system would you use, and why?

    1) Simple analog 0-5VDC
    a) what sorts of input/output impedances?
    2) Current loop 4-20mA
    3) Frequency (V-F and F-V converters)
    4) PWM
    5) Digital I2C, SPI, or RS485, including ADC in sensor board
    6) Other options I've not considered.
     
  2. #12

    Expert

    Nov 30, 2010
    16,345
    6,831
    Keep your impedances low. In a rather quiet place, 1 ma minimum for each circuit is good. Nasty noisy? Maybe 10 ma. Oh look! A 4ma to 20 ma option. That seems good.

    Then again, I'm strictly an analog person.:(
     
  3. ebeowulf17

    Thread Starter Active Member

    Aug 12, 2014
    678
    79
    Oh, I should mention that response needs to be reasonably smooth, but not necessarily super-fast. If an analog voltage or current is the answer, it could certainly be low-pass filtered to a point where response is within up to maybe 100ms (10Hz passes cleanly.) The analog sensor is responding to a human-user interface and I don't think any user will notice lag of less than 100ms in this case. A little faster might be nice, but somewhere in that ballpark should be a reasonable target.
     
  4. ebeowulf17

    Thread Starter Active Member

    Aug 12, 2014
    678
    79
    Nothing wrong with that. As much as I enjoy the ease and flexibility of MCUs and ICs, I'm constantly wishing I had a better understanding of core, fundamental analog concepts.
     
  5. AnalogKid

    Distinguished Member

    Aug 1, 2013
    4,546
    1,252
    What is the sensor board?
    What is the sensor device?
    What is being sensed?
    Why?

    !!!

    ak
     
  6. ebeowulf17

    Thread Starter Active Member

    Aug 12, 2014
    678
    79
    The only thing that's certain is that the sensor is detecting position of a rotating actuator/handle that travels through a range of ~45-60°.

    I'm currently thinking magnet in the actuator shaft and hall effect sensor detecting angle. The idea is to be able to use a totally sealed, non-contact, non-wearing system so that neither moisture, nor heat, nor friction in repetitive use impact long-term reliability (comparable competing systems use rheostats which don't last very long in this environment.)

    Regardless of sensor type, my plan would be to build whatever circuit necessary to condition/convert the signal before sending it out to main board with MCU. The sensor/board assembly would have 5VDC available to work with.

    So back to the original question, assuming all options are open, with 5VDC in a noisy environment, what's the best way to send the analog (or digitized) signal?

    Oh, I guess the other relevant detail is required precision/accuracy of the signal. I don't think it needs to be super-precise. The equivalent of 8-bit resolution should be more than adequate.
     
  7. sailorjoe

    Member

    Jun 4, 2013
    361
    63
    So here's a thought. Use some type of A/D converter near the sensor, and send an SPI signal to the MCU. Runs the SPI lines through a shielded cable, and you shouldn't see much noise on the SPI lines. If you do, some small capacitors should reduce the noise to an inconsequential level. Here's a page of A/D converters from one manufacturer to give you an idea of what's available.
    https://www.maximintegrated.com/en/pl_list.cfm?filter=ac
    Here's a low cost chip that will do it. http://ww1.microchip.com/downloads/en/DeviceDoc/21290D.pdf
    And another one. http://datasheet.octopart.com/MCP3001-I/P-Microchip-datasheet-6884.pdf

    Here's a chip that uses a 4-20ma current loop, which is also a good solution if your MCU can handle it.
    http://www.analog.com/media/en/technical-documentation/data-sheets/AD693.pdf

    On the other hand the last time I had to deal with this kind of problem, we took the low risk option and interconnected all the signals with fiber optics. Absolutely zero noise pickup in the cables, which were much longer than ten feet.
     
  8. AnalogKid

    Distinguished Member

    Aug 1, 2013
    4,546
    1,252
    This is a two part problem, and the two parts are almost completely ndependent. For example:

    Part 1
    IF you are fluent with a microcontroller (for example, the PIC line)
    THEN an 8-pin PIC has digital inputs, an A/D, and a serial port built in. It can interface just about anything to a low speed, high reliability digital output. I love discrete analog hardware (that's my license plate), and a low impedance analog output almost certainly would deliver 8-bit signal integrity at the receiver. But if you're worried, and the firmware won't set you back a few months, go low-speed digital.

    It sounds like you would be sending a few bytes per second, an exteremely low data rate that doesn't need the complexity and distance issues of I2C or SPI. That's it for the transmitter. Since you have 5V and GND, only 1 more wire gets you connectivity. The totem pole output of a PIC is a low enough impedance to control all but the most intense radiated noise. If you still need more, have a relatively low value terminating resistor (a PIC can source/sink over 20 mA; a 2K resistor should swamp the interference.) If a crappy connection causes GND loop issues, put an optocoupler at the receiver input.

    Part 2 is the sensor, the real problem to solve...
     
  9. ebeowulf17

    Thread Starter Active Member

    Aug 12, 2014
    678
    79
    If I'm reading these snippets right, it sounds like both of you would feel comfortable sending either a low-impedance 0-5V signal or a 4-20mA signal from the sensor circuit location to the MCU location.

    My initial fears are based on experience with low voltage signals and high impedance inputs. I don't have any experience yet with low impedance circuits. If I'm understanding the significance of this correctly, it's because induced noise is able to create large signal voltages, but with very little current. So with a low impedance input, the noise voltage is greatly reduced as it translates into small current changes. I'm sure I've phrased that poorly, but if I've got the basic idea right, then I'd feel pretty good about going this route.

    Now I just need to do a little research to figure out the best approaches for sending and receiving low impedance signals. I figure on the sensor end it'd be easy to use an op amp to buffer the sensor output and provide output drive. It's less obvious to me what to do on the receiving end, but I'll do a little reading and see what I can learn.

    Thanks for the help so far!
     
  10. WBahn

    Moderator

    Mar 31, 2012
    17,777
    4,805
    Since this is headed toward an MCU anyway and what you are trying to determine is knob rotation, why not use a rotary shaft encoder directly?
     
  11. ebeowulf17

    Thread Starter Active Member

    Aug 12, 2014
    678
    79
    Interesting thought. I was previously only aware of relative/incremental encoders, which wouldn't help. But I just googled rotary encoders, and an absolute encoder might. I'll take a look at available options and how they would physically interface with our mechanical setup.
     
  12. AnalogKid

    Distinguished Member

    Aug 1, 2013
    4,546
    1,252
    If you can find one with environmental seals that can withstand your environment, either absolute or incremental will work.

    ak
     
  13. ebeowulf17

    Thread Starter Active Member

    Aug 12, 2014
    678
    79
    I'm a little skeptical about encoders in the harsh environment too, especially since there's also potential for flexing on the shaft which would translate mechanical stress to an encoder.

    As for incremental, I don't think it would work because shaft position is only known relative to starting position at power up. If the shaft starts in anything but the full-off position at power up, an incremental encoder wouldn't know it, right? In our application we definitely cannot guarantee that the shaft always starts in a known position at power up.
     
  14. ronv

    AAC Fanatic!

    Nov 12, 2008
    3,292
    1,255
    You might consider differential. Similar to this.
    http://www.ti.com.cn/cn/lit/ds/symlink/ina152.pdf
     
Loading...