Hi dear friends,
I've added a mag sensor (i2c) and a GPS (USART) to an Arduino. The output of the mag is OK till the GPS module is not connected to the Arduino. But when I connect the GPS module to the Arduino the data of mag become very noisy. my mag sensor and GPS using 3.3v. I do appreciate any help or suggestion to solve this problem.
I've tested this project on Arduino Uno, Esp32 and Teensy4.1, hence it is not related to the microprocessor or my code as I am happy with my code.
Hi, please read the forum guide in the sticky post at the top of any forum section.
Hi, please add the link. thanks.
Hi, @hashemshah
Welcome to the forum.
Please read the post at the start of any forum , entitled "How to use this Forum".
This will help with advice on how to present your code and problems.
Your code and a schematic would be great.
Tom....
Hi, Thank you so much for the link. I will edit my post step by step based on your recommendations.
Show us (schematic) the power distribution and filtering - you did include filtering didn't you?
Making sure I got this correctly.
Wired to a Uno is a mag sensor. When the Uno is powered on with the mag sensor the thing works. Now still powered on a GPS is connected to the Uno and then things go wonky?
Hi, that is correct. I am happy with the mag data but after connecting the GPS module (mag+gps) to the Uno the data of the mag becomes very noisy and useless.
Hi, I've connected the wire:
sensor ---------------------------Microcontroller (Uno, Esp32, Teensy 4.1)
SDA -----------------------------------------------SDA
SCL-------------------------------------------------SCL
Vcc -------------------------------------------------Vcc
GRD----------------------------------------------GRD
GPS----------------------------- Microcontroller (Uno, Esp32, Teensy 4.1)
Vcc -----------------------------------------Vcc
GRD---------------------------------------GRD
Tx ------------------------------------------ Rx
I did not use any filter circuit.
Connecting a device while the rest of the system is under power will cause issues.
Oh, when I connect both of them to the Uno and then turn on the Uno the problem is not gone. Indeed I just turn on and turn off the GPS just to see how it affects the mag data. Anyway, fortunately, I haven't had a problem till now.
I would strongly suggest some filtering. Supply the sensor through a low voltage resistor, say 10R (I don't know the current drain, I suspect it is low so 10R will not give much volt drop). Follow this with decoupling caps, say 10uF and 100nF.
The supplies are common to all you items. Some will add noise (due to their internal switching) onto the power supplies. This is likely to get through to you mag sensor and adversely affect its behaviour.
Good luck
Thank you @stevemj, I'll try it.
Post an image or 2 or three of your project alle wired up and powered.
If it helps, and I think like this. Consider performing a mechanical measurement with your hands holding the items and the measurement device. Now add 'noise', you have to do the precise measurement while standing on a shaking or vibrating plate. I think it would be hard to do as your hands could not hold the items and measurment device very well. Standing on a thick, matress would reduce the movement at your hands. I.e it would filter the mechanical noise.
Does this help to visualise the noise problem ?
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.