Go Down

Topic: Precision check weigher (Read 6744 times) previous topic - next topic

rmartin

Dear friends
I'm an informatic ing. but completly new to the arduino platform.
I'm interested to realize a check weigher.
The target is to realize a machne that value the weight of a product and if it's in the right range push it in a direction, if its' outside the range push it in another direction.

inspired to the industrial check weigher
https://www.google.it/search?q=check+weigher&um=1&ie=UTF-8&hl=it&tbm=isch&source=og&sa=N&tab=wi&ei=EHYvUJbFBqbP4QTr4oH4Cw&biw=1024&bih=506&sei=E3YvULeQJ
but more more easy

my idea is a sensor that check the weight and send the value tu arduino, if the value is inside a range a small electric motor move the product outside the wheight platform.

my product are 10g / 20g the i think that te problem is the hight precision of the sensor (I need 0.1 - 0.5g)
I think that I need:
-Arduino
- Scale sensor
- Amplifier signal
- 2 Electric motor

Do you think that arduino can make this?
Can you suggest me how to begin?
thanks for all
Fabio 

terryking228

Start by Googling Arduino and scales..

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1231217442/0
http://ebookbrowse.com/electronic-scale-arduino-doc-d202119380

Regards, Terry King terry@yourduino.com  - Check great prices, devices and Arduino-related boards at http://YourDuino.com
HOW-TO: http://ArduinoInfo.Info

jroorda

There are certainly a lot of ways to make a scale, and if you have the time and ambition to try some go for it. I myself would probably try to find a cheap scale online that has some sort of com port that sends out data. Many scales have serial ports that I wouldn't think would be too hard to connect to. 

rmartin

My dear Friends
after Googling alot I have decided to buy a precision weigher with rs232 serial port.
Now the problem is how to receive by Arduino the right weight from the weigher?

If i'll connect the weigher to my pc with serial and send the EXADECIMAL command 01 73 I obtain like response a string with thw weight for example 0023.05g

I buy a RS232 shield with max 3232 I connect to the weigher, but nothing...
Can you help me?
How can I send to my weigher the HEX 01 73 string and listen the reply?
thanks a lot
Fabio

rmartin

Hi I give you more information, can you help me?
I use Arduino UNO, comnnected to a RS232 shield
http://dx.com/p/jy-r2t-v1-2-rs232-serial-port-converter-104325
you can see the connection in this photo
http://i49.tinypic.com/3038rqq.jpg

For the rs232 shield i connect the VCC to the +5v of the arduino and the ground to the Arduino Ground
For the trasmission I connect the 7 and 8 pin.

I try all examples found in internet by using serial and serial library, but never.

First question: in the code I need to open one or 2 serial port?
How i can to be sure that I can write and read on the serial?
When I connect the shield to the arduino my pc make a "pling" like i connect a new usb device, is this correct?

thanks for youe support Fabio

PeterH

The page you linked to for the JY-R2T V1.2 RS232 Serial Port Converter says "It is powered through a mini USB port", but you don't appear to be supplying power to the mini USB port.
I only provide help via the forum - please do not contact me for private consultancy.

rmartin

Hi Peter
thanks for your reply
I think that the mini usb is an alternative way to power the shield, I think that I can give 5V in 2 ways...
-in my situation the led on the shield power on, and when I try to send a command the tx led power on...bt I can to read (have one output) the serial message from the wigher
tanks
Fabio

PeterH


I think that the mini usb is an alternative way to power the shield, I think that I can give 5V in 2 ways...


Is there any documentation to support that? How much current does it draw from the 5V supply if powered like that? More importantly, what voltage does it drag the Arduino's 5V supply down to in practice?
I only provide help via the forum - please do not contact me for private consultancy.

rmartin

Hi Peter I found a solution
I try to connect my arduino and shield to a serial COM3 and with another serial converter COM4, I monitor the COM4 and I show that the arduino send correctly the string!!!



This code work!

Code: [Select]

#include <SoftwareSerial.h>

//New serial port for my shield
SoftwareSerial Mx3232Serial =  SoftwareSerial(7, 8);

//variabile
//char EchoChar = 'A';
char Str1[ ] = "s";

//String Str1 = " s";
//String Str1 = String(' s',HEX);


String Buffer; unsigned long T;

void setup()  {
//pin7(RX) Input
pinMode(7, INPUT);
//pin8(TX) Output
pinMode(8, OUTPUT);

Mx3232Serial.begin(9600);

Serial.begin(9600);
}

void loop() {
//leggo dalla seriale(pin7)
//EchoChar = PortaSeriale.read();
//invio il dato letto
Mx3232Serial.print(Str1);

//Serial.println(Mx3232Serial.read());

Buffer = "";
T = millis();

 while (millis() - T < 10)  {         // read all the chars on the serial
   while (Mx3232Serial.available() > 0) {
     Buffer += char(Mx3232Serial.read());
   }
 }
 
 if (Buffer.length() > 0) {           // transmit to Serial Monitor        
   Serial.print(Buffer);
 }

delay(1000);

Serial.print(Str1);

}


Now the problem is, how to send the HEX 01 73 string to my weigher and receive the weight?
If with my serial monitor I send this HEX string it work, with arduino NO!

I try to send this

Code: [Select]
Mx3232Serial.print(0x01,HEX);
Mx3232Serial.print(0x73,HEX);


but dosen't work! Now my question is how to dend in HEX this string?
thanks
Fabio

PaulS

Why are you using print() to send binary data? That is what write() is for. Your value, 0x73, is being converted to a string in HEX format, and that string is being sent to the scale, which, of course, doesn't recognize it.

rmartin

Hi Pauls
tryed also with

Code: [Select]
Mx3232Serial.write(0x01,HEX);
Mx3232Serial.write(0x73,HEX);


But doesn't work.
Is there a way for send all the 2 commands in one way, or it's correct in this way?
thanks
Fabio

PeterH


But doesn't work.


Of course it didn't work. Look at the documentation for Serial.write() - you are calling it incorrectly.
I only provide help via the forum - please do not contact me for private consultancy.

rmartin

OH yes, but unfurtunately it don't work  =( =( =( =(

Code: [Select]
Mx3232Serial.write(0x01);
Mx3232Serial.write(0x73);
Mx3232Serial.println(""); // carriage return


have you another idea? my weigher don't reply me, but if I try with a serial port monitor to send 01 73 HEX it reply me!

thanks
Fabio

PaulS

Quote
but if I try with a serial port monitor to send 01 73 HEX it reply me!

Which Serial Port Monitor? Post a screen shot of before the send and after the send (the reply).

It's possible that your understanding of what the scale expects could be all wrong. Perhaps it IS expecting "01" and "73", not 0x01 and 0x73.

rmartin


Quote
but if I try with a serial port monitor to send 01 73 HEX it reply me!

Which Serial Port Monitor? Post a screen shot of before the send and after the send (the reply).

It's possible that your understanding of what the scale expects could be all wrong. Perhaps it IS expecting "01" and "73", not 0x01 and 0x73.


I have tried wit more and with all work well. Now I use a demo version of Eltima software Serial port monitor 4.0, here you can see a screenshot where with the Serial Port Monitor software I send a string to the Arduino and you can see the string in the Arduino serial Monitor.

After this I think that Arduino and RS232 shield are right connected!

I think that it ll be a problem in the sending or in the reception of the string

thanks for your support
Fabio

Go Up