Arduino RS232 Serial Communication to Laser Control Board

0.5V is a suspicious number - I suspect that it's actually five, but some combination of how the 'scope is set or how you're interpreting it is leading you to believe that it's 0.5. Maybe put a meter on it instead to verify.

Try to avoid shorting 5V to GND, unless you want to let the magic smoke out :wink:

Did you try the latest J-M-L code?

Well it was not really 0.5V, it was around 0.7V.

Now it is giving me 5V :sweat_smile:
I setted up the osciloscope to autofit the wave, i guess I could be doing something wrong

Try to avoid shorting 5V to GND, unless you want to let the magic smoke out :wink:

ahahahaha thank you, good advice :rofl:

I have tried it yes. It was not working if I remember. I will try it again now

Some probes have a x10 button directly builtin, double check that the button position and the oscilloscope settings match

Yes, I think that was the issue. Now it is on 1x and I got the 5V

so do you see some data flowing if you use my simple sketch ?
you should even see the garbage bytes at the beginning when the laser turns on

Yes I see data flowing from the rs232
I am not using the laser right now, i am testing with the terminal emulation program, it should be the same right? since serial data is flowing through the MAX232 to the arduino

it's a good sign but only an emulation :wink:

Well it proves that your MAX232 is working anyway. You may find though that it will be necessary to swap RX and TX on the laser, if there is a different cable involved.

I measured the Arduino TX and RX output signals and they are fine.

I measured the MAX232 output pins and I am getting a Voltage of almost 10V in pin2 (DB9-Male). The signal is binary, but does not correspond to ASCII. Am I correct to assume this is because the MAX232 already made the conversion of the signal?

later this afternoon I will test this with the laser.

Do you have a manual for the laser? I know you posted a link earlier, but IIRC, it was the manual for a similar model, not the actual one you're using. Is it possible that the serial comms are subtly different on yours?

This manual is the exact manual of the laser:

Laser YLR-200-AC_User manual.pdf (709.0 KB)

All the MAX232 does is change TTL voltage levels to those required for true RS232. It's not translating the data transmitted, so it will still be the same ASCII characters on the wire.

OK, I will re-check that

Also, as anticipated, that null modem cable you're using reverses RX/TX for you, hence the problems encountered when you did so too - they cancelled out.

So when I connect to the laser I should switch the RX TX pins?

Maybe. What did you use to connect the MAX232 to the terminal emulator?

depends if your cable is crossing the wires for you or not

A usb to rs232 cable
@wildbill