Thermocouple Amp stops reading when Motor Driver is connected

Hello, I have been banging my head against a wall trying to solve this and dont seem to be getting anywhere. I am trying to power a Pololu A4988 and a AD594 Thermocouple Amp at the same time using an Arduino.

I have tried the two circuit designs below, but whenever the motor driver gets connected, either by plugging in the power supply on circuit 2 or connecting the logic voltage on circuit 1, analog pin 1 starts returning a 0. I feel like it has something to do with the analog pins no longer getting the correct voltage difference, but I am not sure how to go about solving that issue. If anyone has any ideas, that would be great.

Pololu A4988 - Pololu - A4988 Stepper Motor Driver Carrier
AD594 - http://www.analog.com/static/imported-files/data_sheets/AD594_595.pdf

Can you explain why there is nothing connected to the STEP & DIR pins ? I can't speak for anyone else but
I don't think we can help you unless you provide an actual accurate complete schematic and post your code. You can hand draw a schematic or block diagram and simply put the destination pin numbers next to each pin so you don't have line running everywhere.
ie:

Arduino A4988 AD595
D3 STEP
D4 DIR
A1 Vo
+12 VMOT
+5 VDD

The AD594/AD595 can be powered from a single ended supply
(including +5 V)

Why are you running the AD595 off 12V ?

Sorry, I left those off because they were just going to digital pins. The following should be a complete circuit, and I tried running it off 12V as an experiment since that pin can support 5V - 25V. My main thought process is that the voltage difference wasnt matching and was screwing with the reading. So I tried splitting off the chip onto my 12V power supply.

Below is my revised circuit using the 5V logic supply.

Do you have a common ground between the motor driver and the thermocouple circuit ? (is the Arduino GND connected to the motor driver GND connected to the AD595 GND ?)

A thermocouple amp is looking at voltages of a fraction of a mV - motor controllers put out
loads of noise.

You need to keep these two circuits well separated, using different GND pins on the arduino
so that the Arduino board's ground plane is the centre of a star-ground configuration. Never
share ground or power wiring between a motor driver and any sensor board.

Think of the motor driver as a bulldozer, and the thermocouple amp as a delicate glass
ornament, figuratively speaking!

raschemmel - Yes, I was using one ground pin onto a breadboard GND rail and then splitting off to the AD595 and A4988.

MarkT - So I switched my circuit to using GND pin 1 for the AD595, and GND pin 2 for the A4988. However it still shares the 5V breadboard rail, which I assume will still introduce noise?

I changed the circuit to the picture below by following MarkT's suggestion and also added a capacitor to see if that would help dampen any noise, but it didnt seem to help. In regards to the star grounding, I also tried the GND pin that is inline with the digital pins, thinking maybe it was a result of the wires sharing noise, but that didnt help either.

How would I prevent sharing of power wiring from the Arduino, as there is only one 5V pin?

Attachment below is the revised circuit.

Power the motor driver's 5V from a 7805 from the 12V? Once you only have signals and
ground in common with the Arduino and the ground is a star so no motor currents flow in
any wires connected to the amplifier, that's a start. You will need to physically separate the
sensitive circuit and cables from any motor or power supply wiring (you mustn't run wires
alongside each other for instance).

Decouple the amp, separately decouple the motor driver - you've drawn the capacitor
between them which can't be right in a star-grounded set-up.

I would not add an extra 7805. The motor driver's logic circuitry should run from the same 5v supply as the Arduino's logic circuits.

Extra capacitors on ALL the power supplies close to the chips will decouple the supply. Put a big beefy one on the 12v supply as well as a tiny 0.1uF one. The tiny one will intercept the high-frequency noise and the big one will take care of the low frequency noise.

Maybe, but its better to isolate the supplies fully - if it were a L293D for instance you'd
want to isolate the 5V supply from the Arduino as crow-barring the motor supply also crow-bars the logic supply to the L293D. Maybe its the same on the A4988?

Have we established that the motor supply is holding up under load and not dropping out,
incidentally?

Your thermocouple circuit is running off the motor supply. You are trying to send an analog signal that must be referenced to the thermocouple circuit ground to the arduino which you have just been told should not
be sharing a ground with the motor driver. The issue I see here is you have a Catch-22. You can't run the
thermocouple circuit from the motor supply and send a signal to the arduino unless the arduino is sharing
that same ground (the one you were told it shouldn't be sharing). Have you tried running the thermocouple circuit off the arduino 5V and ground and isolating it from the motor supply ?

Attempt 1: Right, so circuit 2 from above was my attempt to use the 12V power supply to power the thermocouple amp. Oddly enough the analog pin was capable of reading a value from the therocouple amp without a shared ground with the Arduino. However, I then connected the Arduino's 5V supply to the motor drivers logic supply pins. At this point is when it stops working.

Attempt 2: The circuit from my second post shows the thermocouple amp and motor driver sharing the Arduino 5V and separate GND pins works until you plug in the 12V supply.

As far as I understand, attempt 1 illustrates two isolated circuits, but the noise is introduced by plugging in the 5V logic supply and activating the power to the motor driver which makes the power supply noisy. Attempt 2 has a shared GND with the arduino plane and 5V pin, and works until the power supply is plugged which is when the driver gets activated and the noise is introduced.

I think I may have tried most of what you have suggested, but please let me know if I need to clarify or try anything. I dont have different sized capacitors for the decoupling right now, but I will pick some up tomorrow.

I don't believe your issue has anything to do with noise. There is nothing (yet) to prove that. What I don't understand is why you are not running the thermocouple amp and arduino on 5V and the motor power on 12V. If I understood you correctly you are saying that when you tried that it was ok until you connected the
arduino 5V to the A4988 logic power in. Right ?

Correct, regardless of which way the circuit is connected. Once the motor driver starts pulling power and the thermocouple stops working

Can you measure the 12V power supply voltage when that happens ?

It reads 12V.

Hi,

Can you please post a copy of your sketch, using code tags?
Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png or pdf?

The diagram you have supplied does not show us how you have wired the regulators or any bypassing.
Please a complete diagram showing ALL components including associated capacitors and voltage regulators, Arduino and GND circuitry.

A picture of your project would also be worth a thousand words.

I'm not sure what CAD program you are using but it should have the schematic of a 78XX regulator.

Tom..... :slight_smile:

void setup()
{
     Serial.begin(9600);
     pinMode(0, OUTPUT);
     pinMode(1, OUTPUT);
     digitalWrite(0, 0);
     digitalWrite(0, 0);
}
void loop()
{
    Serial.println(analogRead(A0));
    delay(1000);
}

My breadboard has a few other projects on it right now, but let me know if you still need a picture and I will clear it off. None of the other projects are in any way connected to the circuit posted.

Are you aware that Digital 1 is the serial print Tx pin and you are using serial prints ? You shouldn't use digital 1 if you are using serial.

What is this supposed to do ?

 digitalWrite(0, 0);
 digitalWrite(0, 0);

I wasn't, sorry I will change that. As for those two lines of code I was meaning to set pins 1 and 0 to 0, I mistyped. The code is a simple sketch that I created to just test the basics of reading from the thermocouple amp.

Hi, sorry picture of diagram does not have enough resolution to get much information.
When I mean a circuit diagram, I mean a diagram that shows your regulators, capactors, resistors an ICs and how they are connected together, power grounds and power rails.

Just wondering what level of technology you have, electronic, electrical, hardware and software experience?

Tom..... :slight_smile: