I've had a custom PCB made with a bunch of functions for a project that I'm working on, and all works fantastically apart from one input. I don't understand why so I'm looking for some inspiration...!
The specific input wiring from my Eagle project is shown below in the picture, and is very simple. The purpose is to read a ~14V input from my Teensy 3.2 analogue channel A0. By my calculations, the 71k R1 and 6k8 R2 resistor should divide the signal down to just over 1 volt, perfectly within range of Teensy's input capability.
For some reason though, I'm seeing absolutely nothing when I run the following test code:
int AnalogPin = A0;
void setup() {
Serial.begin(9600);
}
void loop() {
int Test = analogRead(AnalogPin);
Serial.println(Test);
}
I've cracked out the multimeter and I don't see anything on the input pin either, which suggests that it's a wiring problem. Does the circuit look right? I had 2 boards made and both seem to have the same fault, so that points to a design error rather than an assembly issue. I have other 5v voltage dividers in the circuit using the same methodology and these all work without any problem. It's just this one. Any help as to how to identify the issue would be very much appreciated!
Of course - the board is rather busy so I tried to avoid adding it so as not to confuse the issue. I've attached it to this post (board design and schematic).
Yes my bench power supply is powering the whole board and the 14v input I'm trying to read so do have common grounds.
I'm seeing absolutely nothing when I run the following test code:
That doesn't make sense, do you mean there is no data being sent to the serial monitor, do you mean something is being sent but not what you expected, or do you mean something else I've not thought of?
I've cracked out the multimeter and I don't see anything on the input pin either
Similar question, there must be something on the input pin, what did the meter display when you tested? Between which 2 points on the circuit did you measure?
Measure the voltage at each point, that's both ends of both resistors at the resistor ends and at the other ends of the track and the input pin. Measure the resistance at all points and see if it is what you expect.
Measure the resistance of the tracks between all points and confirm its is 0 Ohms.
There might be a possibility the negative used to expose the PCB had a hair/scratch on one trace and when etched, the trace was separated at that point.
This would explain why both boards act the same.
Ohm out the traces involved using your DVM.
Also check for shorts between the 3 components to adjacent pads and traces.
Thanks was looking at the two resistor and testing their continuity and realised something odd. On the two resistors (R56 and R57), both of them have continuity to ground. This seems a bit odd to me.
I then checked the board design and it lists the net class to the Arduino input pin as GND; my ground class. Again this seems strange. So I then checked the schematic and in the schematic the net was listed as GND class. I I tried deleting the whole net from the divider to the Arduino pin and re-making it under the next assigned net ID (124), and then looking back to my board design it now shows two air wires that need to be connected between one of the resistors, the arduino pin and the capacitor.
Does this mean that somehow my Eagle design made the wrong connection due to the net class being wrong? No design errors flagged up and I saw nothing when designing the board but having that pin connected to ground seems wrong to me completely. In which case perhaps all I need to do is re-draft the board with the new air wires and it should work, but that still doesn't explain how it was able to happen in the first place? I'm very confused!
@450nick Not very familliar with Eagle, KiCad user myself. But this probably also applies to Eagle. If it was shown as GND net and then you will not get an error if you route it to GND. It can only show design errors if you design a board that does not match the schematic. Aka, you somehow made a mistake in the schematic and connected it to GND.
Ok sounds like that is the error then! That is annoying but all good, I'll probably do one more revision of the board anyway so will update the schematic and board design and get another one at some point. For now I can live without that function I think. Thanks all for your help!
My concern with what you have found out is that the little bit of circuit you posted looks OK, so how has it gone from that to having ground where you don't want it?
I also use KiCad so not familiar with Eagle, is there an option to view the finished board and magnify it so you can look closely for problems?
450nick:
Does this mean that somehow my Eagle design made the wrong connection due to the net class being wrong?
Maybe. I think that when one thing is wrong, then it can also lead to other things being or becoming wrong too. Not necessarily 'wrong' ----- as the system is just programmed to do what is was supposed to do.