We have built the board and everything seems to work ok except for the current measurement. It appears we are not getting anything from the current sensor. We are getting 2.3 mv on pin 2A which seems very low. The assumption is the sensor is not working but not sure. Has anyone had problems in this area.
Thanks. A check of the wiring has uncovered the ground and one of the sense wires are reversed. It didn't help that the person that wired it used the same colour wire throughout. It now has rainbow ribbon cable.
The next problem is the bluetooth module got shorted so now waiting for a replacement before I can test the current sensor
If you want to check the readings without the bluetooth module there are a couple of ways to do it. In the arduino code if you set DEBUG_MODE to 1 it will stop sending out the 'gibberish' it normally sends to the bluetooth out, so you can add serial prints in the code to send out readings. If you do: if(DEBUG_MODE) Serial.println(current); it will only do it when debug is enabled too. If you put that right after the 'current = readCurrent(); line in the main loop it will give you regular human readable current readings on the arduino serial monitor. To be fancy you could use the serial plotter in the arduino IDE to display it as a line graph.
oops! One of the main reasons we used the nano is that they're so cheap to replace.
Just make sure that whatever cooked it in the first place isn't still there when you plug the new one in. Plug everything into the car without the Arduino, put 24V on and check the voltage on each pin - none should exceed 5V.
Just following thread of current measurement - board built all working but current measurement shows zero when sensor unplugged but 62A when plugged in. The differential betwen Vref and Vo from the senor is 3mV, both are at 2.69V (although data sheet seem to indicate should be at 2.5V) but output of opamp is at 1.69V. The Cal.h file shows the default I constant value of 37.5 so the reported output of 62A is approximatley correct.
Checked all resistor values OK visually. I have yet to check the soldering as board is screwed in but will check tonight.
A 3mv differential input shouldn't be giving that output voltage, it sounds like there's an issue in your op amp circuit somewhere. If all the resistors are definitely correct it's possible there's a bad connection or the op amp itself is dead?
Hi ajh, great engineering approach here, very helpful for fault finding! As Rowan says above it feels very much like it could be an issue with the op amp circuit/resistors that are feeding it.
The MCP6002 is a fairly simple device so it's probably worth getting the multimeter on the device pins and measuring a few bits there. First up make sure the op amp is plugged in the correct way round (I won't tell you how many times I've had this issue!).
Pins 4 (GND) and 8 (5V) should have 5V across them.
Pin 2 and 3 are the inputs. The voltages from the output of the sensor are divided down before going in to the opamp so it's well worth checking that the voltages at 2 and 3 are also around the same voltage.
OK all sorted - a subtle dry joint on R22 - the girls had done a good job of soldering but this was rather 'round' looking solder 'blob' which when examined under looking glass was actually 'perched' on the pad. I guess the extra resistance had significantly increased the gain of the op amp. I was wondering about ESD damage but as I had used a grounding strap during the final assembly ( the girls just have had no time to complete prior to race day) I was reasonably certain the amp was good. Thanks for the responses