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?
Transmit voltages are ±5V; receive voltages are ±5V minimum, ±15V maximum
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.
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 ()
String Go = "go";
void loop ()
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
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.
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. ><
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.