Hi all,
My first go at arduino.
I am hooking up an old scale to my arduino and looking for it to output data to the serial monitor.
Later, I would like to convert units (push button) and display on a I2c 16*2 screen.
It seems to be simple but my sketches have not succesed yet.
Parts:
Arduino uno R3
Sparkfun Max3232 breakout
DB25 breakout
Scale with DB25 connection
Scale connection DB25 (old version)
So I can not use new cables/adapters as they are pinned differently
For instance, I tried a DB25 to DB9 (wrong pins) cable doesn't work
My current approach is:
Use DB25 breakout board with wire from Cat5 cable to correct pins (see below) (DB25 Slim Breakout Board with Screw Terminals - Winford Engineering)
Connection from scale to Max3232 board:
Connect pin11 (RxD) to R1in
Connect Pin 7 GRD Signal ground to GND
Connection from Max3232 board to Arduino:
T1IN to TX→1
R1OUT to RX→0
Scale is only sending data TX there is no RX function on it.
Problem is I can not get any information to output from Max 3232 board.
Signal is being send from Scale (Too fast to read but double checked with multimeter seen fluctuating voltages from -3 to +3V.)
I am afraid my sketch is not processing the data, Not even garble comes out.
I have tried several sketches to no success.
Please don't judge too much my coding skill is less than a kindergardener...
If I could get anything to show up in the serial monitor that would be amazing.
I have tried many different sketches starting with the simplest code:
#include <SoftwareSerial.h>
int incomingByte = 0;
void setup() {
Serial.begin(4800, SERIAL_8E1); // opens serial port, sets data rate to 4800 bps
}
void loop() {
if (Serial.available() > 0) {
incomingByte = Serial.read(); // read the incoming byte:
Serial.print(" I received:");
Serial.println(incomingByte);
}
}
To my best effort so far
#include <SoftwareSerial.h>
void setup() /****** SETUP: RUNS ONCE ******/
{
Serial.begin(4800,SERIAL_8E1);
Serial.println("Serial port initialized");
Serial.println("Starting read");
Serial.println("Serial port initialize");
Serial.println();
}
//--(end setup )---
void loop() /****** LOOP: RUNS CONSTANTLY ******/
{
Serial.readString();
Serial.print(1);
Serial.setTimeout(125);
Serial.println();
delay(250);
// END Serial Available
}
Nothing seems to get any info from Max3232 board
RS-232 C output relies on > +3V
and <-3V to send signal
Negative voltage at idle
Max data string/0.125 seconds
Read the spec sheet, it seems the Max3232 is capible of reading but I can not get any output to serial monitor.
I have read several arduino tutorials, including sparkfun on serial communications, while newer hardware runs on 9600 baud has a max of 4800. I have checked and double checked the continuity of the circuit seems correct.
Alittle help with this would be much appreciated.
Thanks,
Nate
More information:
Sparkfun Max3232 (SparkFun Transceiver Breakout - MAX3232 - BOB-11189 - SparkFun Electronics)
Max3232 Schematic: https://cdn.sparkfun.com/datasheets/BreakoutBoards/MAX3232_Breakout_v11.pdf
The scale label states it is a: RS232C (DCE) on the module
New DB25 Pinout (converted from old pinout):
Pin 13 Protective ground
Pin 11 RxD Transmit (+/- voltage)
Pin 9 CTS clear to send
Pin 8 DSR Data set Ready
Pin 7 GRD Signal ground
Pin 6 DCD Carrier detect
Pin 19 DTR Data Terminal Ready
Manual states RS232C EIA standard
Baud rates: 600, 800,1200,2400, 4800
Currently setup
Baud: 4800
Parity: enabled
Even parity
Send continuous
Floating ground
From the scale manual:
Transfer principle
-Bitserial
- asynchronous
- 1 start bit and 1 stop bit
- voltage controlled
- 7bits per character plus parity bit (ASCII)
-negative voltage in the idle position
Transmit lines:
Marking/ OFF (high) atleast -3v
Spacing/ ON (low) atleast +3v
load resistance:
3k ohm
Must be protected from 25v 0.5A
Max current: 0.5A
short circuit to ground or another line also 0.5A
Load resistance of max 7k ohm
Amount of voltage at scale not to exceed 15v
Receiver lines:
input resistance: 3-7k ohm
input idle voltage = <2v
receiver circuit must be setup for at least 25v
Max Capacitance of receiver & cable 2500pF.
-3V Marking/off (high).
+3V Spacing/on (low).
-3V to +3V not defined
cannot exceed 25V
Handshake:
DTR Data Terminal Ready line voltage ≥+3V
if ≤3V data output can not transmit.
If line not wired up data output behaves as ready.
Data Blocks transmit format:
3 blocks
Identification:
- ID block (2 chars)
- Space (1 char)
Data:
-
- or - symbol
- numbers (9 chars)
Unit:
- Space (1 char)
- Unit (1char)
After last character Carriage return (CR) and Line Feed (LF).
Transmits after each result every 0.125 seconds.
25 bits (HIGH) between two strings
There are also Special operating mode characters
Transmits:
S (space) when for stable.
SD when unstable
SI Overload/underload
TA then(CR+LF) Tare