I have an Arduino Mega 2560 along with a Trinamic stepper motor (TOS-100), Osepp 16x2 LCD display, 2 LM35's, and an MAE4 absolute magnetic encoder.
The LCD, LM35, and encoder components all output analog signals.
Here's how I have these boards stacked (bottom to top):
- Mega - powered by 12V through the jack
- Trinamic - powered by 12V through the jack
- Custom board - containing ground and power lines for sensors and encoder
- LCD display - powered by the Mega reference 5V
**A couple of points to preface:
- I have read in multiple forums and other websites that the GND traces for the LM35's need to be isolated from any other component.
- I do not have a mastered understanding of the Mega bus structure
The bus containing the following pins (I'll call it Bus1 from here on out) - IOREF, RESET, 3.3V, 5V, GND, GND, Vin - has the LM35 grounds connected to it (each sensor gets it's own ground.)
I clipped those two GND pins on the LCD connector to keep the sensors isolated.
Based on the 10 deg. C per mV output for the LM35, my readings (as displayed on the LCD) were right on the money.
ORIGINALLY, when I set up everything, I never clipped the LCD GND pins, and still had the sensors grounded to those pins.
This threw my readings off by +1 degree.
- Why do the grounds need to be isolated for the LM35? Is it related to analog vs. digital input?
- If all of the grounds connected on the board eventually return to the source ground, why would this be a problem at all? Where in the Mega's bus structure does the logical separation of each ground pin occur? Meaning, concerning the Mega itself, the ground pins on Bus1 and Bus2 (which is the 10pin connector - which my LCD is currently grounded to) have to be somewhat isolated before all coming together at the barrel jack, correct?
I've been trying to wrap my head around this for a while. I've only just been lucky with my results, but in terms of documentation, I can't come up with a defined solution to the problem.