Thread Tools
Mar 23, 2014, 08:23 AM
Don L.
Quote:
Originally Posted by jackerbes
It has been some years since I messed with anything RS232. I vaguely remember some of the details of reading from and maybe even sending to or talking to GPS receivers from PC keyboard.

I am going to do most of this from an XP Pro machine.

"..I suggest you wire it up, upload the code and use the serial monitor to verify that it works. Then, you can add your display and keyboard, knowing that the scale portion is already functioning properly..."

Is there a serial monitor on an XP machine or is that an software I need to add? And if the latter, do you have a recommendation for the software?

Added note: And now it comes back to me! Hypernet! And it is still there on XP Pro but not on my W7 laptop.

Jack
Yes, HyperTerminal came with XP and you can get it for 7, but you don't need it.

The Arduino IDE has its own terminal. It's called "Serial Monitor" and it's under the "Tools" drop down in the newer versions of the IDE. See the attachment.

The simple scale program that you downloaded (seen in the background of the attachment) sets the baud rate to 9600, with "Serial.begin(9600);"). All you need to do is select the same baud rate, using the drop down in the lower right corner of the monitor window.

In the attachment, I plugged a telemetry receiver with a serial to USB adapter into my computer, opened the monitor, and set the baud rate to match the telemetry's. You can see the serial data streaming in.

-Don
Sign up now
to remove ads between posts
Mar 23, 2014, 01:24 PM
Jack
jackerbes's Avatar
Thread OP
OK, I've playing the hardware a little to get the HX711 connected and I realize that when I plug the shield into the UNO it plugs into the places where I need to connect the HX711. So I need to add a pin header to the shield to bring those connectors up where I can get at them with the shield mounted/

The image shows what I mean basically.

Also, thanks for the help on the monitor. Since that code is written to send the info to the serial port, does that mean that I won't see it on the LCD on the shield?

I'm off to Radio Shack to get some pin header material for now and will be messing with this just getting the hardware set up business for now.

Jack
Mar 23, 2014, 03:37 PM
Don L.
That's right. You'll use another library for the LCD and change a few lines. Here's the code. Remove the "//" before each command when you're ready to use the LCD.

// #include <LiquidCrystal.h>
// LiquidCrystal lcd(8, 9, 4, 5, 6, 7);

#include <Hx711.h>
Hx711 scale(A2, A3);

void setup() {
Serial.begin(9600);
// lcd.begin(16, 2);
}

void loop() {
// lcd.setCursor(0, 0);
// lcd.print(scale.getGram(), 1);
Serial.print(scale.getGram(), 1);
// lcd.print(" g");
// lcd.print(" ");
Serial.println(" g");
delay(200);
}

This is based on what I found on eBay about your LCD shield. If all the I/O pin numbers are correct, it should work. Reading the keys is a whole other issue. It appears that they are hooked up to a voltage divider connected to A0. So, the voltage on A0 will indicate which key is pressed.

-Don
Mar 23, 2014, 06:42 PM
Jack
jackerbes's Avatar
Thread OP
Wow! You're up to speed on this stuff!

I got the header pins soldered on the shield and the HX711 this afternoon and got the beam, HX711 module, and UNO board mounted on a piece of wood.

I have to make some jumpers to make the connections between the HX711 and the Freaduino board and I'll be about ready to test that code I think.

So when I remove the comment markers that will send to both the serial monitor and the LCD, right?

I picked up a "Getting Started with Arduino" book at Radio Shack and have been getting smarter with that too.

I hope to get some use out of the buttons eventually, use one to Tare out the display and maybe make some other use out of the keyboard.

I can see where, as your knowledge advances, it opens the door to brainstorming and adding bells and whistles to a project.

Jack
Last edited by jackerbes; Mar 24, 2014 at 06:49 AM.
Mar 23, 2014, 07:05 PM
Jack
jackerbes's Avatar
Thread OP
I did a search for hx711 on the Arduino forums and found an interesting thread there about using a module like this. It had a link to a library that is a step or two up from the one above. Already more inspiration...

https://github.com/bogde/HX711

Jack
Mar 23, 2014, 09:54 PM
Don L.
Quote:
Originally Posted by jackerbes
So when I remove the comment markers that will send to both the serial monitor and the LCD, right?

Jack
Yes.
Mar 24, 2014, 06:50 AM
Jack
jackerbes's Avatar
Thread OP
Man! It is so cold here today! It is 7F/-14C and I might not even make it down to my basement shop today.

I'll bet you are not doing a lot better down there...

Jack
Mar 24, 2014, 07:19 AM
Don L.
It's a little warmer here, 17F when I checked. We're near the ocean, so that helps.

I tapped into the warm air ducts that run through my basement workshop, so it's cozy down here when it's cold outside.

-Don
Mar 24, 2014, 04:24 PM
Jack
jackerbes's Avatar
Thread OP
I got a little further along with this today before my 52F basement drove me back upstairs.

I got the hardware all connected and copied and pasted your code in as a new sketch. When I tried to compile it I got the error in the image. That is that "Hx711 does not name a type".

I also tried copying the code from the dfrobot page and compiling that and I get the exact same error.

So now I'm off to a warmer place to research this naming a type thing...

Jack
Mar 25, 2014, 09:56 PM
Jack
jackerbes's Avatar
Thread OP
I finally got this working today. I used dleroi's code from up in post #18 and got that compiled and uploaded.

The serial port monitor was report a 0.0g weight and that changed when I put some pressure on the beam scale.

I took the remarks out and uploaded it again and was getting the same results on both the serial monitor and the LCD.

The weights were a little erratic and not right. I have a couple of 10g scale calibration weight and it was not reporting those right. But I expect it will need some calibrations as this proceeds and that will get things on track.

Whoopee!

I have been having some problem with getting intermittent USB "connect" tones from my PC and finally realized it related to the mini-USB connector on the Freadino UNO board. I tried several different USB cables and they all did the same thing so the problem is in the connector on the board.

After a while the scale quit working and I then could not even get the board to upload it again or even respond correctly in the basic "blink" test. It would often not finish uploads on programs and do other erratic things. So I think the board is wonky...

I emailed the folks I bought the board from and they are sending me another one and I'll return this one. Pretty decent and trusting of them. The guy mentioned that the mini-USB connector on these boards has been "pretty tangible" (??) so maybe this board is not a good idea right now...

Ironically, I looked for a Arduino UNO board locally and couldn't fine one in stock. And when I shopped it around I found I could get both the Freadino and the LCD keyboard shield from NY Platform for less than Radio Shack want for just the Ardino UNO alone.

All of this stuff comes from China and the prices varies along with the quality too I guess....

So we're on hold again.

Gonna get a 12-16 hour blizzard in the morning. So it looks like March is going to go out like a lion this year.

Jack
Mar 25, 2014, 09:59 PM
Jack
jackerbes's Avatar
Thread OP
delete duplicated post
Apr 04, 2014, 08:07 AM
Jack
jackerbes's Avatar
Thread OP
OK, this thread is not dead, but it has taken some time. I had a bad Freaduino board and it took a few days to get it replaced. The second board acted wonky and would not successfully complete the basic test of running the "Blink" sketch as outlined on the Arduino Getting started page:

http://arduino.cc/en/Guide/Windows

I gave up on Freaduino and ordered another board called the "UNO R3" board on eBay. That board fired up working, I loaded and re-loaded "Blink" and that worked, I ran a couple of the other sketches (DigitalReadSerial and ReadAnalogVoltage) and could see the board and the serial port connection to the PC working normally. So I'm finally ready to move on with getting the load sensor working.

This thread is now going to include a learning curve on using Arduino, it just has to be that way I think. And I'll appreciate any help in that area as it goes along...

Jack
Apr 04, 2014, 09:37 AM
Jack
jackerbes's Avatar
Thread OP
Testing setup :

I have the Arduno board mounted on a wooden board

The 16x2 (16 characters, 2 rows) keyboard/LCD shield mounts on the UNO R3 board and DIP pins along the edges of the LCD shield bring all the connection points from the UNO R3 board up to the shield.

When i power up the setup, the I get the display 0.0 g , when I watch that on the serial monitor the weight value refreshes every about 4 seconds and varies from 0.0 g to -0.0 g occasionally.

When I put a 10g test weight on the beam arm the value changes to 2.0 g and that continues to refresh at that same every four seconds rate.

Note: Load sensor mounting seen in image was changed on 04 April - it is swapped end for end and the arrow points down now.

The code I am running is:

/*
* description:
* Code from dleroi post
* connections:
Hx711.DOUT - pin #A2
Hx711.SCK - pin #A3
HX711 A- - blue wire
HX711 A+ - white wire
load sensor load arrow points up

#include <LiquidCrystal.h>
LiquidCrystal lcd(8, 9, 4, 5, 6, 7);

#include <Hx711.h>
Hx711 scale(A2, A3);

void setup() {
Serial.begin(9600);
lcd.begin(16, 2);
}

void loop() {
lcd.setCursor(0, 0);
lcd.print(scale.getGram(), 1);
Serial.print(scale.getGram(), 1);
lcd.print(" g");
lcd.print(" ");
Serial.println(" g");
delay(200);
}

Now I'm off to figure out how to calibrate the scale.

Also, I don't need 1/10th of a gram precision so I want to just display rounded off to the nearest gram values.

Jack
Last edited by jackerbes; Apr 05, 2014 at 07:05 AM.
Apr 04, 2014, 02:40 PM
Registered User
benedict's Avatar
This is a great project! I'm so glad this thread isn't dead, and that you're making progress.

Since you're driving this from an Arduino, and since generating servo pulses is pretty standard fare for an Arduino, and since adding sensors for measuring voltage,current draw, and temperature is also pretty straightforward, do you have any plans to make a completely automated test bench?

Seems like it wouldn't be a stretch to wire all that up and write a program so that you can install an ESC/Motor/Prop combination, press Go, and step back as it ramps the ESC from 0-100% throttle in small steps, recording the voltage, current, and thrust, or measuring a temperature profile at WOT as the motor and ESC heat up over time.

Sorry for suggesting massive feature creep in your project, but reading this just got my geek on.

Tom
Apr 04, 2014, 04:14 PM
Jack
jackerbes's Avatar
Thread OP
Wow! I had exactly the same thoughts as I was messing with this today. In my floundering around with google and, because of the German link that OlliW posted back in post #3 here, I found some things that said I would be able to that.

I am getting most of my from the eLogger now and it would be nice to have the thrust data being captured too.

I had not considered automating the tests as you describe but that is certainly not out of the question.

I think I may have found the answer as to how to calibrate the weight reads a while ago. It is a statement in one of the files (Hx711.c) in the library that is read as an Arduino program is compiled and loaded into the board.

I will play with that later, after dinner probably, and see if I can get the weights reading right.

We'll be crawling here before long, then we'll try to get on our feet!

Jack


Quick Reply
Message:

Thread Tools