Offline
Newbie
Karma: 0
Posts: 24
|
 |
« on: August 18, 2012, 06:08:46 am » |
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=E3YvULeQJbut 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
|
|
|
|
|
Logged
|
|
|
|
|
Topsham, Vermont USA
Offline
Edison Member
Karma: 11
Posts: 1353
... in The Woods In Vermont
|
 |
« Reply #1 on: August 18, 2012, 08:49:56 am » |
|
|
|
|
|
Logged
|
|
|
|
|
USA
Offline
Full Member
Karma: 3
Posts: 100
Yes, I remember
|
 |
« Reply #2 on: August 19, 2012, 04:09:58 pm » |
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.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 24
|
 |
« Reply #3 on: December 12, 2012, 05:10:59 pm » |
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
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 24
|
 |
« Reply #4 on: January 03, 2013, 01:54:34 pm » |
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-104325you can see the connection in this photo http://i49.tinypic.com/3038rqq.jpgFor 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
|
|
|
|
|
Logged
|
|
|
|
|
UK
Offline
Tesla Member
Karma: 89
Posts: 6339
-
|
 |
« Reply #5 on: January 03, 2013, 02:03:14 pm » |
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.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 24
|
 |
« Reply #6 on: January 03, 2013, 06:06:31 pm » |
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
|
|
|
|
|
Logged
|
|
|
|
|
UK
Offline
Tesla Member
Karma: 89
Posts: 6339
-
|
 |
« Reply #7 on: January 03, 2013, 08:11:03 pm » |
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?
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 24
|
 |
« Reply #8 on: January 04, 2013, 11:51:33 am » |
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! #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 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
|
|
|
|
|
Logged
|
|
|
|
|
Seattle, WA USA
Online
Brattain Member
Karma: 311
Posts: 35476
Seattle, WA USA
|
 |
« Reply #9 on: January 04, 2013, 12:34:45 pm » |
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.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 24
|
 |
« Reply #10 on: January 05, 2013, 08:05:10 am » |
Hi Pauls tryed also with 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
|
|
|
|
|
Logged
|
|
|
|
|
UK
Offline
Tesla Member
Karma: 89
Posts: 6339
-
|
 |
« Reply #11 on: January 05, 2013, 09:52:20 am » |
But doesn't work.
Of course it didn't work. Look at the documentation for Serial.write() - you are calling it incorrectly.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 24
|
 |
« Reply #12 on: January 05, 2013, 11:15:24 am » |
OH yes, but unfurtunately it don't work  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
|
|
|
|
|
Logged
|
|
|
|
|
Seattle, WA USA
Online
Brattain Member
Karma: 311
Posts: 35476
Seattle, WA USA
|
 |
« Reply #13 on: January 05, 2013, 11:21:56 am » |
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.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 24
|
 |
« Reply #14 on: January 05, 2013, 02:22:41 pm » |
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
|
|
|
|
|
Logged
|
|
|
|
|
|