Feasibility Project (RS232)

Good morning everyone,

New to the arduino forum, and have a question regarding a project I want to do.

It's quite a simple project, I need to send a RS232 data to a printer (so not TTL) and the data is selected by the button I press.

For example:

  • Button1 -> Send to RS232 the char "A"
  • Button2 -> Send to RS232 the char "B"

I found a RS232 shield there RS232 Shield V2 - DEV-13029 - SparkFun Electronics

And i want to use an Arduino One Rev3 board.

The question is rather simple, the hardware chosen is the right one (undersize, oversize)?
The RS232 shield is a good one or anyone know if there is a better solution?
And mainly I want to know if I can do the project like I want with this solution.

Thanks for the help and the time you gave to me :slight_smile:

Regards

Hi, welcome to the forum.

Arduino Uno R3 board is good.
That RS-232 shield is good.

Do you know the difference between the hardware Serial port and SoftwareSerial ?
If you want fast serial communication, you could use the Arduino Leonardo. It has a spare hardware serial port.
But I think it is not needed for a serial printer, and the Arduino Uno is also easier to use.

Did you find nice buttons ?

Peter_n:
Hi, welcome to the forum.

Thank you :slight_smile:

Peter_n:
Arduino Uno R3 board is good.
That RS-232 shield is good.

Do you know the difference between the hardware Serial port and SoftwareSerial ?

Yes, hardware serial is the RX - TX pin (As far I understood, and TTL signal) and the SoftwareSerial use a code assignated PIN for RX and TX (always as far I understood).

Peter_n:
If you want fast serial communication, you could use the Arduino Leonardo. It has a spare hardware serial port.
But I think it is not needed for a serial printer, and the Arduino Uno is also easier to use.

Did you find nice buttons ?

No the printer doesn't even reply back on the data sent, and the serial can be 2400bps. About buttons well we have some schneider electric buttons, I'll use this configuration http://pighixxx.com/PNG/121.png

Thank you for the tips and the help :slight_smile:

Regards

Why not wire the switches with the internal pullup? Wiring with the internal pullup also allows hardware switch debounce.

groundfungus:
Why not wire the switches with the internal pullup? Wiring with the internal pullup also allows hardware switch debounce.

Actually I am new about this world, just learning from scratch, and I'll take note and use as a treasure all information.

I'll take not of that.

Thanks

The example is certainly feasible, trivial even, to the extent that an Uno seems like overkill. However, how many buttons will there be and how much data does each cause to be sent to the printer?

wildbill:
The example is certainly feasible, trivial even, to the extent that an Uno seems like overkill. However, how many buttons will there be and how much data does each cause to be sent to the printer?

2 Button, each button send 300byte data (approx)

Looks good then. If you wanted to do more work or were making a lot of these systems, there are cheaper ways to do it, but this plan should get you going.

I agree, good to go.
Arduino Uno with SoftwareSerial and the Sparkfun Shield. Two buttons, either according to http://pighixxx.com/PNG/121.png or with internal pullups.

I prefer external 10k resistors over the internal pullups. The internal pullups are 50k and that high value could make it sensitive for electric noise. So an external resistor of 10k or 4k7 is better when there are wires between the buttons and the Arduino.

Two times 300 bytes of data ?
Do you know PROGMEM ? PROGMEM - Arduino Reference
With PROGMEM, a lot of data can be stored in the flash, and it doesn't use ram.
The PROGMEM data will be stored next to the code, and the ram is used for variables.
If you need any help with the code, just ask.

Lord_Deimos:
It's quite a simple project, I need to send a RS232 data to a printer (so not TTL) and the data is selected by the button I press.

For example:

  • Button1 -> Send to RS232 the char "A"
  • Button2 -> Send to RS232 the char "B"

You didn't identify the printer you are using. RS-232 is more than an electrical standard. Your printer may not accept your data until it is aware of your Arduino and it may also need to receive a complete line of data, including CR/LF, before it prints. Do you have documentation for the printer? You may need to jumper a pin or two on the printer to make it think it has a proper connection.

Paul

Yes, the printer is likely to require hardware flow control - the full RTS/CTS/DTR lines. That shield doesn't have them connected.

But you can do hardware flow control with that shield and a little bit of soldering. If you look at the schematic you will see that the MAX232 has a pair of un-used input and output lines. You can jumper them across to the appropriate pins on the DE9 connector and your choice of Arduino pins.

That's not quite enough for full flow control - you may find you need one more but you can hardwire it to +12v. This voltage is available on the V+ pin of the MAX232 (pin 2) which is also connected to C3, so you can pick that voltage off one side of C3.

Good Morning,

As for the printer, there's no problem about it, it's a label printer and just use the classical RX-TX-GND signal,no flow control. Quite simple.

About PROGMEM, I'll have to read and learn by myself, will ask for advice if I'll stuck somewhere.

Regards