Previous in Forum: New Form of Modulation?   Next in Forum: Embedded Chip Applications
Close
Close
Close
23 comments
Rate Comments: Nested
Associate

Join Date: Jul 2010
Location: Dallas Suburb
Posts: 31
Good Answers: 2

Isolating a Microcontroller

08/19/2025 12:05 AM

The situation:

I have a sensor, battery operated, that is placed 10-75 meters away, connected with a 5-wire cable, un-shielded. It periodically emits a pulse down one of the wires, voltage is on the order of 3-5 volts. A second wire carries a signal that indicates the battery state in the sensor: low/high. The other three wires are all ground. The sensor and the wires are all used outdoors.

On this end, I have a small microcontroller, probably a Raspberry Pico. I want to connect it to this end of the 5-wire so I can sense the intermittent pulses and the high/low state of the sensor battery.

Additionally, on this end also connected to the microcontroller is a 3-wire cable, short, only 2-3 meters and having a simple NO switch and an LED. The microcontroller also needs to see when the switch is pressed and when released, and to send current to the LED.

How should I hook the sensor and the switch to the microcontroller? I am worried about that much wire laying out on the ground and picking up stray signals, perhaps EM from lightning in the area, etc. I also think that I need to condition the incoming signal so that what the microcontroller 'sees' is a clean signal of predictable character.

I am not electronics-smart, need pointers to sources for learning, any help that can be offered.

Thanks.

Bill Lee

__________________
BillLee
Register to Reply
Interested in this topic? By joining CR4 you can "subscribe" to
this discussion and receive notification when new comments are added.

"Almost" Good Answers:

Check out these comments that don't yet have enough votes to be "official" good answers and, if you agree with them, vote them!
Guru
Hobbies - DIY Welding - Don't Know What Made The Old Title Attractive... Popular Science - Weaponology - New Member United States - US - Statue of Liberty - 60 Year Member

Join Date: Apr 2009
Location: Yellowstone Valley, in Big Sky Country
Posts: 7425
Good Answers: 295
#1

Re: Isolating a Microcontroller

08/19/2025 11:19 AM

I’m not really the best guy to start this discussion, but what the heck, eh?

This sensor… has an onboard power source (battery)? This seems unusual for a hardwire sensor, please confirm this is so.

You say cable is lying on the ground. Unless a very temporary situation, this also seems unusual, being subject to ice and snow, foot traffic, vandalism, rodents, lawnmower… can you expand on this. You may as well tell us why a hardwire is selected in lieu of wireless.

Unstated, are the controller and this function undefined button and LED also outside? Is there a power source at this station as well?

You have told us there are at least two undefined function controller inputs. Are the undefined outputs already satisfactorily configured?

Is a lightning storm a common enough event that it is a real concern? Can the system simply be repurposed as a lightning detector and call it finished?

You really haven’t given us very much to base useful suggestions upon. More and better information will almost certainly get you better suggestions.

__________________
Semper Ubi Sub Ubi
Register to Reply
Associate

Join Date: Jul 2010
Location: Dallas Suburb
Posts: 31
Good Answers: 2
#2
In reply to #1

Re: Isolating a Microcontroller

08/19/2025 12:00 PM

Hello; Thanks for the response.

The sensor has an onboard battery, a simple 9v alkaline.

The installation is a daily affair: deploy in the morning, use all day, pick up and go home in the evening.

On this end, the microcontroller and laptop that it is hooked to (USB, for data and power) are usually protected, but only like a person would be at an outdoor event.

The microcontroller will accept the incoming pulses and then send them on via USB to the laptop. Same for the voltage indication and the open/close actions of the switch. The LED output is requested from the laptop and is set on/off by the microcontroller.

Normal operational considerations dictate that you unhook cables anytime there is any indication of inclement weather, but, as is so typical, often ignored.

Regards,

Bill Lee

__________________
BillLee
Register to Reply
Guru
Hobbies - DIY Welding - Don't Know What Made The Old Title Attractive... Popular Science - Weaponology - New Member United States - US - Statue of Liberty - 60 Year Member

Join Date: Apr 2009
Location: Yellowstone Valley, in Big Sky Country
Posts: 7425
Good Answers: 295
#3
In reply to #2

Re: Isolating a Microcontroller

08/19/2025 8:18 PM

The paragraph “The microcontroller will accept…” indicates you are prepared to make terminal connections.

You concern is that the cable may act as a pickup of spurious RF emissions of some type, that translating to a 3 VDC pulse in an open circuit. I believe this is very unlikely, but as I already said, there are other members who can crush this belief as if it were a bug.

An anticipated pulse frequency and duration will determine if a circuit is required, or if a relay can be used.

Restated, how many times per minute (or second, or hour, or…) is a pulse sent, and how many seconds (or milliseconds, or minutes, or…) does a single pulse last.

Why does the laptop care about the charge status of the sensor battery?

__________________
Semper Ubi Sub Ubi
Register to Reply Score 1 for Good Answer
Associate

Join Date: Jul 2010
Location: Dallas Suburb
Posts: 31
Good Answers: 2
#4
In reply to #3

Re: Isolating a Microcontroller

08/19/2025 11:26 PM

Hello;

The pulse from the sensor is irregular,varying from as frequently as once every second on down to .... minutes between. I am not sure the length of a pulse: oscilloscope in hand, I will be determining that soon.

The laptop cares because the person operating the system needs to take action if the battery voltage drops too low. The laptop is where the GUI for the system resides.

Regards,
Bill Lee

__________________
BillLee
Register to Reply
Guru
Popular Science - Cosmology - Let's keep knowledge expanding Engineering Fields - Retired Engineers / Mentors - Hobbies - HAM Radio - New Member

Join Date: Dec 2006
Location: North America, Earth
Posts: 4528
Good Answers: 106
#5

Re: Isolating a Microcontroller

08/19/2025 11:42 PM

I know very little about the Raspberry Pi, but definitely recommend a shielded cable. The shield should be connected to earth ground (a ground rod driven 6 feet into the earth) for EM and lightning protection. An even better system would have 2 shields. The outer shield connected to earth ground, and the inner shield connected to the common of your circuit (the 3 wires you called ground).

__________________
“I would rather have questions that can't be answered than answers that can't be questioned.” - Richard Feynman
Register to Reply
Guru

Join Date: May 2006
Location: Placerville, CA (38° 45N, 120° 47'W)
Posts: 6215
Good Answers: 248
#6

Re: Isolating a Microcontroller

08/20/2025 12:33 AM

Hi Bill.

Is this system related to your model airplane hobby? I'm suspecting that your sensor is detecting an airplane flying overhead...

If so, the width of the pulse could easily be several milliseconds, which is long enough that you could have a small capacitor between the pulse-carrying wire and ground at the receiving end. The capacitor would act as a short circuit for rapid pulses that might be generated by nearby lightning or other spurious sources, but would have time to charge and convey the pulse from the sensor to the receiving device. It will require a bit of experimenting to determine the optimum value of capacitance. I think something like 0.001-0.01µF would be a good starting point.

A considerably larger value capacitor, perhaps 0.1µF, could be connected between the battery-voltage wire and ground, again at the receiving end.

It's now been quite a few years since I last worked connecting sensors to a computer, so I won't attempt to help on that part...

__________________
Teaching is a great experience, but there is no better teacher than experience.
Register to Reply
Associate

Join Date: Jul 2010
Location: Dallas Suburb
Posts: 31
Good Answers: 2
#8
In reply to #6

Re: Isolating a Microcontroller

08/20/2025 10:06 PM

Hello, Dick;

Ah, you remember! Yes, having go do with measuring lap time of Control Line models to determine their speed. The sensor and cable are a pre-determined part of the problem. There is an established base of users "out there" with them, and any alteration in those areas is just not possible.

The sensor is designed so that its field of view is quite small. The duration of the signal is only a few milliseconds: models running anywhere from 100 to 200 mph. I am investigating the magnitude and duration tomorrow when an experienced EE is coming by to try and help me with the oscilloscope and the sensor.

I'm not sure I really need to isolate the cable from the microprocessor. The current system I am wanting to replace simply runs the cable to the parallel port on an old DOS laptop. That's the way we've done it for the 25 years we've used the system. But now, we need to use a modern OS and laptop and that is why I am looking at the interface.

Good to hear from you again.

Regards,

Bill

__________________
BillLee
Register to Reply Score 1 for Good Answer
Guru
Hobbies - DIY Welding - Don't Know What Made The Old Title Attractive... Popular Science - Weaponology - New Member United States - US - Statue of Liberty - 60 Year Member

Join Date: Apr 2009
Location: Yellowstone Valley, in Big Sky Country
Posts: 7425
Good Answers: 295
#13
In reply to #8

Re: Isolating a Microcontroller

08/21/2025 12:41 PM

If the duration of a pulse is anything like 1ms then a my simple relay idea will not work reliably, if it would work at all is questionable.

Do you have some hope that your EE acquaintance may have some useful observations or suggestions?

__________________
Semper Ubi Sub Ubi
Register to Reply
Guru

Join Date: Jul 2016
Posts: 1367
Good Answers: 105
#7

Re: Isolating a Microcontroller

08/20/2025 6:45 PM

I don’t think you need to worry about external signals interfering, especially if you carry 3 grounds nearby. You may want a pull up or pull down resistor on your inputs to keep the input resistance down when no signal.

This will deplete your 9 volt battery a little, so maybe 10k resistor will balance noise immunity and power consumption.

A shielded wire should be overkill, by and far.

Register to Reply
Power-User

Join Date: Jul 2014
Posts: 113
Good Answers: 4
#9

Re: Isolating a Microcontroller

08/20/2025 10:39 PM

The solution with all these types of problems is to reduce the impedance of the sensor/detector.
This makes it harder for any outside interference to produce a detectable pulse on the line.
I would need to know the name and type of detector/sensor to make any further comments.
Colin Mitchell
TalkingElectronics.com

Register to Reply
Guru

Join Date: May 2018
Location: Under the spreading Bunya Trees, South Burnett, Queensland, Australia
Posts: 807
Good Answers: 65
#10

Re: Isolating a Microcontroller

08/21/2025 1:06 AM

Unless your cable is shielded it will act as an AM receiver which can be a problem unless you want your micro to listen to music all day long and forget its task.

I have had a problem using unshielded wire in the past with spurious signals causing problems. Spurious signals come from electric fences, motor mower ignitions, vehicle ignitions, don't know it the Scalextric cars produce interference but electric haul trucks sure do.

Have you thought of using a garage door FM TX/RX to transfer the signal between the two devices?

__________________
Hare today, goon tomorrow!
Register to Reply
Guru
Popular Science - Cosmology - Let's keep knowledge expanding Engineering Fields - Retired Engineers / Mentors - Hobbies - HAM Radio - New Member

Join Date: Dec 2006
Location: North America, Earth
Posts: 4528
Good Answers: 106
#12
In reply to #10

Re: Isolating a Microcontroller

08/21/2025 11:18 AM

GA for your rational insight and experience on shielded cable. The 3 "ground" wires will do nothing to shield the cables.

__________________
“I would rather have questions that can't be answered than answers that can't be questioned.” - Richard Feynman
Register to Reply
Guru

Join Date: Jul 2016
Posts: 1367
Good Answers: 105
#11

Re: Isolating a Microcontroller

08/21/2025 1:07 AM

Maybe a USB I/o module might work for you, like here, just over $130. It plugs directly into your laptop.

Here’s a cat number: USB-4751L-AE4-Channel TTL Digital I/O USB Data Acquisition Module

Fir some reason, I can’t post the link to a possible solution, not sure just what kind of link can be posted with the editing tool?

Register to Reply Score 1 for Good Answer
Guru
Philippines - Member - New Member Engineering Fields - Instrumentation Engineering - New Member Engineering Fields - Control Engineering - Who am I?

Join Date: Oct 2006
Location: Northern Mindanao, Philippines
Posts: 2147
Good Answers: 53
#14

Re: Isolating a Microcontroller

08/21/2025 10:20 PM

I come from an factory instrumentation background and always shield my signal wires. We once had an instrument where the instruction manual specifically said, not to connect the shield. Several times a year, we'd suffer unexplained events that cost the company millions. About two years before I retired, we decided to connect the shield, even if just to see if the system would behave. Since then and until I left, we didn't have any more spurious events. Recently, I spoke with one of my former co-worker. He said there haven't been any unexplained events since I left. It's been ten years.

Always shield your sensor wires.

regards,

Vulcan

__________________
Miscommunication: when what people heard you say differs from what you said. Make yourself understood.
Register to Reply
Guru

Join Date: Jul 2016
Posts: 1367
Good Answers: 105
#15
In reply to #14

Re: Isolating a Microcontroller

08/21/2025 10:34 PM

I have the same background, but you are not considering the environment. This is on an outdoor model airplane field, not in an inverter infested PWM nightmare of a manufacturing plant. Even just twisting your conductors provides significantly more common mode protection than a tape foil shield with a drain wire can.

Shielding this circuit is just plain unnecessary, complicating something they have been doing successfully already for years, with their TTL parallel input port.

Register to Reply Score 1 for Good Answer
Guru
Philippines - Member - New Member Engineering Fields - Instrumentation Engineering - New Member Engineering Fields - Control Engineering - Who am I?

Join Date: Oct 2006
Location: Northern Mindanao, Philippines
Posts: 2147
Good Answers: 53
#21
In reply to #15

Re: Isolating a Microcontroller

08/25/2025 1:59 AM

Without more information on the environment (all I know is it's outside in an RC airplane flying meet) it's just due diligence to suggest shielding the wires. I don't know if there are vehicles with noisy electricals or electronics around but, I'm sure there are radio controllers but, I don't know if they can induce noise in unshielded wires. Twisting wires may offer protection, but not in all instances. For short distances of, say 20 feet, I might consider no shielding.

regards,

Vulcan

__________________
Miscommunication: when what people heard you say differs from what you said. Make yourself understood.
Register to Reply
Guru

Join Date: Jul 2016
Posts: 1367
Good Answers: 105
#22
In reply to #21

Re: Isolating a Microcontroller

08/25/2025 10:53 AM

The source of any significant EMI RFI has to be close to couple, so length of circuit itself is not critical in that respect. And twisting wires at the correct pitch reduces common mode interference up to about 65%, without benefit of metallic shield. The shield finishes the job. I would have thought just the opposite.

Register to Reply
Guru

Join Date: Oct 2006
Location: 44.56024"N 15.307971E
Posts: 8277
Good Answers: 270
#20
In reply to #14

Re: Isolating a Microcontroller

08/24/2025 7:54 AM

I have encountered some applications where the shield was driven, on external cables that were very low current to prevent leakage. It is now also called a guard shield on some circuits. This was on a mag-flow meter by Taylor/Sybron back in the '70's.

__________________
"A man never stands so tall as when he stoops to help a child." "Never argue with a stupid person.They will drag you down to their level and beat you with experience" "To create an apple pie from scratch, first you must create a universe"
Register to Reply
Guru

Join Date: Jul 2008
Posts: 1688
Good Answers: 145
#16

Re: Isolating a Microcontroller

08/23/2025 6:44 AM

I'm giving this a rather quick read and a "drive by" answer, so please read with caution.

This sounds like you should consider opto-isolators. An opto-isolator is an "optical isolator" where a small IC has a LED, an isolation region that passes light but blocks electricity and a phototransistor that will conduct when illuminated and not conduct when dark. This is inside the IC's black plastic package so the only light hitting the sensor is from the internal LED.

I haven't done much design in years so this might not be a good solution for you, but I'd look into it. You might need a buffer or driver chip to drive the signal, but it would be simple. The "magic" of this optical isolation idea is that you will probably have around 1500V of isolation between the two ends but still pass signals that generate enough DIFFERENTIAL VOLTAGE to illuminate the internal LED.

Other ideas would be to convert the signals to RS-232, RS-485, LVDS, POF (plastic fiber optic) or some other "format". Since your signals are digital, all you really need is drive characteristics that will go the distance and provide some immunity to common mode noise. Various "driver", "buffer", "extender" and "converter" products might provide the drive. You will not want to do anything "protocol" or "message set", you just want to take a signal that is somewhat "fragile" and make it a bit more "macho".

__________________
Few things limit our potential as much as knowing answers and setting aside questions.
Register to Reply
Associate

Join Date: Jul 2010
Location: Dallas Suburb
Posts: 31
Good Answers: 2
#17
In reply to #16

Re: Isolating a Microcontroller

08/23/2025 9:24 AM

I had a suggestion similar to what you just said, Bruce. It consisted of using a GDT at the front and an opto-isolator at the end.

Simple. Sure! For someone who knows what they are doing! I can google these things and I think I can get a basic diagram, but it's all the other associated resistors and diodes and capacitors and ... that I don't know what to do. Not sure if I actually need a GDT, and some here (coupled with "how we've always done it") think the isolation isn't even necessary.

Regards,
Bill Lee

__________________
BillLee
Register to Reply
Guru

Join Date: Jul 2008
Posts: 1688
Good Answers: 145
#18
In reply to #17

Re: Isolating a Microcontroller

08/23/2025 9:34 AM

The nice things about hobby projects is that it doesn't matter if you violate published specs and it only matters a little if you fail from time to time.

There is a lot to be said for "the way we always did it".

If you are going to hang a bunch of wire off a Raspberry Pi then a little bit of protection for the Raspberry Pi would be good to consider. Diodes to power supply and ground would be helpful. If the voltage on the long wire every tries to go more than a diode drop below ground or above supply then the diode would conduct and shunt the excess voltage. Surge suppression would also be a good idea.

__________________
Few things limit our potential as much as knowing answers and setting aside questions.
Register to Reply
Guru
Hobbies - DIY Welding - Don't Know What Made The Old Title Attractive... Popular Science - Weaponology - New Member United States - US - Statue of Liberty - 60 Year Member

Join Date: Apr 2009
Location: Yellowstone Valley, in Big Sky Country
Posts: 7425
Good Answers: 295
#19
In reply to #17

Re: Isolating a Microcontroller

08/23/2025 11:48 AM

Shirley there are members of the string plane club that are also RC guys, may even be some serious HAM radio guys, electronics hobbyist… Can one of them be called upon to assist you in circuit assembly? Someone (who is right there, and has an interest in the success of this enterprise) may even be able to help with your quest here.

I understand completely that creating something cleaner than my usual ugly bug projects is an intimidating task.

__________________
Semper Ubi Sub Ubi
Register to Reply
Associate

Join Date: Jul 2010
Location: Dallas Suburb
Posts: 31
Good Answers: 2
#23

Re: Isolating a Microcontroller

09/04/2025 10:08 AM

After a lot of YouTube videos and a long couple of ChatGPT conversations, Using KiCad, this is what I came up with:

I have created the PCB and now need to figure out how to get one made for testing.

__________________
BillLee
Register to Reply
Register to Reply 23 comments

"Almost" Good Answers:

Check out these comments that don't yet have enough votes to be "official" good answers and, if you agree with them, vote them!
Copy to Clipboard

Users who posted comments:

BillLee (5); BruceFlorida (2); colin55 (1); dkwarner (1); Doorman (4); HiTekRedNek (1); rwilliams (4); StandardsGuy (2); Stef (1); Vulcan (2)

Previous in Forum: New Form of Modulation?   Next in Forum: Embedded Chip Applications

Advertisement