Where does this UltraSound disturbance come from?

Hi,

I connected a JSN SR-04T UltraSound distance sensor, an Arduino R3, and a Bluetooth card to measure the height of my bike.

Testing the system with batteries, walking around and measuring height to tarmac/bitumen, all looked normal. But today I put the system on the bike. I strapped the UltraSound sensor to the engine protection crash cage.



I only tested at standstill with the engine running. Suddenly the normal readings were interrupted by mostly single very high readings. Sometimes several seconds of normal readings but often bursts of "random" high readings.

Maybe I could filter away some but inaccurate, high readings will be very bad for the project.

How do I get rid of these high error values.

I forgot to turn off the engine today and check. I assume the disturbance then disappears.

I removed the sensor from the bike and pointed it outwards. But disturbance still continued.

Bike engines do not emit much ultrasound, says Google.

The red graph (cm) is the height measurements. The height of the probe (47 cm about) is subtracted and it ought to show 0 like when I keep the system off the bike.

The x-scaling is number of loops. When Bluetooth printouts are running like this, loop time is about 40 mS.

The constant barrage of small spikes in the readings/red curve is also new. Before the system was put on the bike, the readings were really stable.


The long cable included with the Ultrasound sensor is coaxial. But the protocol is simple I believe and it just goes high as long as no return echo has been received, or similar.

How is the measuring system powered when it is on the bike ?

From the battery it passes a fuse and a 1.40 m long DuPont cable with 7 wires. One is 12 V of course. Then it passes the buck you can see in the picture before reaching the UltraSound card.

Vehicle power systems are notorious for being noisy. That could be causing the problem

I have an "automotive protection filter board" ("LC filter board"). I kicked it out since there was no place by the battery. Maybe put it first in the rear "top box" with the Arduino and Ultrasound card?

Or really try to squeeze it in by the battery and put it first after the fuse?

Worth a try but why can't you run on a separate battery all the time ?

There is a lack of space. So that extra battery should be charged by the bike but disconnected except for the Ultrasound when the system is running?

But I could always test and put 8 AA batteries in the box. Just for testing.

If that works we know the disturbance comes via the feeding 12V and not "through the air". Thanks, good idea.

Looking at the wiring in your second photo it looks ideal for picking up electrical noise from the environment.

Noise coming in from the power is only one possible source of interference, I suggest you do your test with separate batteries and go from there.

The reason I said your wiring will pick up noise is because you have to be careful with layout if avoiding noise is important. Understand which 2 wires carry current to and from a device and ensure they are physically run close together, this applies to all the wires, whether noise susceptible or not. Keep wires with different functions away from each other as much as possible.

I can't say much more based on the photos because I can't clearly see what you have. A schematic would help too.

Thanks. Admittedly it is messy. Basically 12V from the bike battery reaches the box with Arduino and the buck. The buck serves 5V for the HC-06 and JSN SR-04T.

I will report results from testing with separate batteries.

I came to the conclusion that DuPont wires would suffice for the amperage. But 1.40 m of those for supply is maybe like antennas? 12V and ground run together.

To be clear it's not just about appearance, being tidy and working well are closely linked.

And the other parts of the circuit?

Maybe. If they are closely coupled physically and if all the current going down one wire returns up a wire or wires in the same cable that will minimise the noise pick up.

Those are good pointers I will remember. I don't ground anywhere else so the current that goes to Arduino, HC-06 and JSN SR-04T is grounded back the same 1.40 meter.

But between the three boards in the rear "top box" of the bike I have not yet taken that into consideration.

The Ultrasound probe is connected via a 2 m coax cable (they are sold like that) that passes the bike engine.

...

And the manufacturers may have other priorities? Vcc and Gnd are not put together.

IF that is really a coaxial cable, then the shield is really a conductor, not a shield. If you can manage it, add an external shield over the cable and ground one end to the bike frame.

It was a good idea to run on external batteries, but the disturbance is intermittent.

Now I tested in the garage, (polished concrete). Constant very small disturbance (fluorescent light?).

When bike started there was no disturbance, to my surprise. But when I tested with an external battery pack by the bike battery, the disturbance reappeared.

But disabling the 1.40m feed lines and putting the battery pack in the electronic box, there was no disturbance.

But reassembling the original system, the disturbance did not reappear.

So it is tricky since the disturbance is not continuous.

I must probably put external batteries in the electronic box and run longer time (can not do that in garage) to see if this solves the problem.

From only a few tries, we know

  • disturbance (d) was very strong outside
  • d only occurs with engine running
  • d has not occurred with external battery close to electronics
  • the probe has a wide angle of detection
  • d is very short and can be both positive and negative





My advice remains the same, it's not tidy.

I suspect that you don't really understand what I mean, here are some extreme examples of how wiring should look:

That's a little outside my capability.
This is just a hobby of mine and I hope I can get advice here that fits my present level as a beginner, like I got before here. Rewiring all according to best principles would sure help, but is outside my competence and would take too much time. I will definitely try to wire as neatly as I can. But I am new to this and the project even shifts goals during its development.

So the advice I got about external battery pack was very useful. I will try to implement it. Any simple advice and experience how a disturbance like this can appear and be cured, is appreciated.

I understand your point. I'm not expecting that you achieve that level of art (I think done like some of those photos cabling becomes an art form). I install network cabling but, while I aim to do a job like in those photos, I fall well short of anything in those photos. My point was to give you something to aim for if not emulate. I'm typing on a tablet at the moment and about to go to work. I'll try to give you some more specific advice this evening.

Hi, @wheelie

Lets do some tests.

If you have your project next to but not on the running bike, what do you get?
If you move your project to the bike while it is running, what do you get.
If you keep the project on the running bike and move the ultrasound unit with its 1.4m cable away from the bike, in particular away from the bike out the rear, what do you get?

Thanks... Tom.... :smiley: :+1: :coffee: :australia:

Thanks. Several good ideas. Move different parts away from the running bike. I must first organize a firm battery pack inside the "electronic box" and loosen the wiring of the probe.

Will definitely come into the work scheme in due course.

... already ...

Not taking away the cause of the problem (which is the best solution), you might consider filtering your measurements (if possible).

Simplest way is to compare the measurement with the last one and if the delta is above a certain threshold, redo the measurement.

An elaborated version of this is my runningMedian library, which ignores outliers. The library provides 4 strategies, some may fit better than others. Most important parameter is the amount of samples (window) the runningMedian holds to be robust against a burst of outliers.
Drawback can be that the measurements are not real time and that might not fit your projects needs.

Hello @wheelie ,

Take a look at this:

I'll find you some more later.

Some things I think are important and should be addressed:

  • Your electronics is loose in the box, it should be attached to a box then wired.
  • Use an aluminium box and ground the box.
  • You have lots of long wires bound up to make them seem shorter, they need to be the length they need to be, not much longer.
  • Keep wiring for different functions apart from each other.

While the suggested tests are useful you are going to struggle until the layout and wiring are neat.