How to connect a Arduino mega 2560 to a TCM-2 Magnetometer?

I am trying to connect my magnetometer to my Arduino mega 2560. The Magnetometer is Rs-232 and the Arduino is TTL, i am using a cd4069 hex inverter to invert the voltages coming from the Magnetometer.
My question is how do i interface to two safely without damaging my Microcontroller?

The Magnetometer
Transmit voltages are ±5V; receive voltages are ±5V minimum, ±15V maximum

Magnetometer i am usings users manual.

Link to my Microcontroller info.

Schematic

Welcome to the forum.

I think this is the legacy page of the manufacturer:
http://www.pnicorp.com/products/tcm-legacy

It transmits a signal of -5 to +5V but allow to receive up to -15 to +15V. That makes it compatible with the RS-232 standard as is used by old RS-232 COM-ports on a computer.
However the minimum voltage to receive something is -5 to +5V.
You can not use the CD4069 to generate that signal.

Normally a MAX232 or MAX3232 is used for that.
You can buy a module or build it yourself.
https://www.sparkfun.com/tutorials/104

Can you connect the magnetometer to a computer and communicate with it ?
Why do you want to use such an old magnetometer ?
A new costs less than 2 dollars:

Thank you Caltoa for the reply!

I have the two connected and the voltages are where they should be when i tested inputing 0 and 5 volts in the max i got out the correct voltages.

Now i am stuck, i need to send a string “go” to the magnetometer to start it in continuous sampling mode but am not sure how to do so. Using the uno here is my code

int led = 13;
int Interupt = 7;

void setup ()
{
   pinMode(Interupt,OUTPUT);
   pinMode(led,OUTPUT);
   digitalWrite(Interupt,HIGH);
   
   Serial.begin(9600);
   String Go = "go";
   while(!Serial)
   {
   ;
   }
   Serial.println(Go);
   
}


void loop ()
{

  digitalWrite(led,HIGH);
  delay(500);
  digitalWrite(led,LOW);
  delay(500);





}

Although i do not think i have to send a constant 5v to the magnetometer so i can probably get rid of the pin 7 high output.

When i upload this code it works with a serial interface, but it does not send to the magnetometer. The tx led does not light up when i connect it to my system.

The max232 Connections are as follow
T 1 Out connected to Magnetometer Pin 4 RxD
R 1 In connected to Magnetometer Pin 5 TxD
R1 out connected to the rx10 pin on the logomatic
T 1 in connected to the Arduino TX1 pin 19

Is that correct?

This has no meaning on a Arduino Mega 2560 board:

   while(!Serial)
   {
   ;
   }

You can remove that.

You could just send the text "go", like this:

Serial.println("go");

Do you want to use Serial1 ?
One of the extra serial ports ? at pin 19 and 18 ?
You have to use "Serial1", since "Serial" is the serial port to the computer via the usb.
About those connections, what is logomatic ?
I think the Arduino RX1 connects to MAX232 R1OUT, and Arduino TX1 connects to MAX232 T1IN. I think that is the same as you wrote.

...
   Serial1.begin(9600);
...
   Serial1.println("go");
...

Thank you Caltoa for the replys!

I got it working… sorta I can use Putty to send the word go to the Magnetometer, with my previous set up even sending Serial1.println(“go”); did not work( i had the Tx1 pin to the max232 then to the magnetometer RxD pin as of previous descriptions).

But as for the Data logger(logomatic v2) it can connect to the max232 and receive the data from the magnetometer. Only problem is i have to connect the magnetometers rxd pin to the txd pin on the db9 and then send go from my computer using some hyperterminal, I would much rather use the Micro controller more than just for a Constant high voltage(interrupt) on the Magnetometers wake from sleep pin. >< :stuck_out_tongue:

EDIT

The setup works besides Connecting the arduino serial TX pin to the Max232, I had the Arduinos Tx1 pin connected to the max232 T1 in pin Which would come out the T1OUT pin the max232 and to the RXD pin on the magnetometer… didnt seem to work.