0
\$\begingroup\$

I am working on an Arduino project where I have a few inputs both analog and digital into the Arduino from remote buttons and sensors.

I have installed a prototype in our building, but when other loads, external to my project, in the building like air-conditioning and extraction fans get turned ON and OFF, the readings on the inputs are affected on the Arduino. For example, when an extraction fan is turned off, the Arduino reads a change in state on the digital inputs, and the readings on the analogue inputs are affected.

How would I go about dealing with this in my circuit design? I'm assuming some kind of power smoothing or filtering on my power input? But I'm just not sure where to start, and I couldn't find much on the topic.

Any help/advice would be appreciated.

Cheers

EDIT: For a bit of additional context, the project is an access control system, specifically the inputs affected are push to exit buttons and door sensors. When the aforementioned loads in the building get switched on and off, my Arduino seems to think the PTE button is being pressed and the door sensors are changing states.

\$\endgroup\$
3
  • \$\begingroup\$ I think that you would need to design the PCB with separete planes for digital ground and analog ground, but I am not completely sure \$\endgroup\$ Feb 19, 2020 at 4:52
  • 2
    \$\begingroup\$ @ChecheRomo You do not, but you do need to be cognisant about where digital and analog currents are flowing in your plane due to component placement. You don't want digital currents flowing in the same regions that analog return currents are flowing. In other words, group like with like and keep analog components away from digital components, with digital components closest to the supply. \$\endgroup\$
    – DKNguyen
    Feb 19, 2020 at 6:12
  • \$\begingroup\$ Just to clarify, the load that is causing the issue is not directly connected to my project at all. All the inputs on the Arduino are being affected by the load which is outside the control of my project. My project is an access control system, the only things connected are the strike plate, wiegand reader, push to exit buttons (digital inputs) and some sensors (analog inputs). The loads like fans and air conditioning are installed in other places in the building. They seem to be creating some sort of noise on the power supply in the building, which is used to feed my project as well. \$\endgroup\$
    – Zac
    Feb 19, 2020 at 6:17

3 Answers 3

1
\$\begingroup\$

I will take a SWAG with the data provided. From what I think you are saying you have pins from the Arduino connected to the outside world, this is a NO-NO. What you seeing is exactly what I would expect to happen. There is a lot of information available online on how to do this interface. My systems were 24VDC and in an industrial environment. I would use a 20K for R1 to be sure I had at least 1 mA through the contact to keep it clean (old school). This circuit will filter out a lot of garbage and survive large voltage transients. It is slow, about 120ms. You could try 12V and change R1 to 10K. For the analog signals I suggest you digitize them before sending to the arduino. More information such as line length, sensors, etc along with links to technical information to them would help a lot in giving you a better answer.

enter image description here

\$\endgroup\$
0
\$\begingroup\$

Since the turning ON/OFF is a pulse response (it has short pulse width, thus high frequency). you can use a low-pass capacitor whose cut-off frequency lies in above your usage frequency. This low pass filter will help you to reduce the high-frequency components from the signal. A low-pass filter can be easily formed using an LC. Reference link https://www.electronics-notes.com/articles/radio/rf-filters/high-low-pass-lc-filter.php

\$\endgroup\$
4
  • \$\begingroup\$ Thanks for your answer Mohit. Where abouts in the circuit would I look at implementing the low-pass filter? On each I/O pin or at the main power input to the board? \$\endgroup\$
    – Zac
    Feb 19, 2020 at 6:14
  • \$\begingroup\$ The sensors input which is effecting the other pins. \$\endgroup\$ Feb 19, 2020 at 6:16
  • \$\begingroup\$ I've just added another comment on my original post which mostly answers this as well. In short, the loads causing the issue are outside of my project, and seem to be creating noise on the power in the building, that is also used to power my project. \$\endgroup\$
    – Zac
    Feb 19, 2020 at 6:19
  • \$\begingroup\$ It will be good to keep a large decoupling capacitor between the power supply and ground, as you circuit is affected by the other load not connected to your project. I will suggest putting multiple capacitors for better filtering. \$\endgroup\$ Feb 19, 2020 at 6:41
0
\$\begingroup\$

You could try (mains) EMI filters on the power supply of your Arduino, or even better filters on the appliances disturbing the mains. Another solution, perhaps better, could be a heavy software filter in your code: for digital inputs, validate only state changes lasting, say, 10/100th of a second. For analog inputs, if any, take a reading 10 times a second, and move (update) your internal value just 1/10 of the difference you find.

The problem can be twofold: noise can enter your system from power supply, but probably noise enters the system also from I/O connections, especially if long wires are attached, working like an antenna. The software solution can solve both, but if these noises are so strong they modify the reading of a digital input, then this is an electrical problem that can lead to worse things, even components burning.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.