Now that you know your calibration factor, you can use your load cell to weight objects. Weighting Objects (Arduino with Load Cell) I used grams, but you can use pounds, kilograms, or even pieces of cat food ( as in this Andreas Spiess video). Yours will be different than ours.īecause the output of the sensor is proportional to the force applied to the load cell, you can calibrate your scale using whatever unit makes sense for you. Save your calibration factor because you’ll need it later. The known weight is 107g, so our calibration factor will be: -49171/107 = -459.542. Then, place an object with a known weight on the scale and wait until you get a value.ĥ) Calculate your calibration factor using the formula: calibration factor = (reading)/(known weight) calibration factor will be the (reading)/(known weight)ģ) After uploading, open the Serial Monitor at a baud rate of 57600 and then press the Arduino on-board RESET button.Ĥ) Follow the instructions on the Serial Monitor: remove any weights from the scale (it will tare automatically). Serial.print("Place a known weight on the scale.") Scale.begin(LOADCELL_DOUT_PIN, LOADCELL_SCK_PIN) The above copyright notice and this permission notice shall be included in allĬopies or substantial portions of the Software. Of this software and associated documentation files. Permission is hereby granted, free of charge, to any person obtaining a copy We wrote the following code taking into account the instructions to calibrate the load cell provided by the library documentation. I used my kitchen scale and weighed a glass with water (107g).Ģ) Upload the following code to your Arduino board. Your calibration factor will be different than mine, so you shouldn’t skip this section.ġ) Prepare an object with a known weight. You should also have your scale set up (two plates wired on opposite ends on the load cell), and have installed the HX711 library.īefore getting the weight of objects, you need to calibrate your load cell first by getting the calibration factor. Of course lock bits will ruin your day, and it may just be better for character to code it again.Calibrating the Scale (Arduino with Load Cell)Īt this time, we assume you have wired the load cell to the HX711 amplifier and the amplifier to the Arduino board. It is much easier without a bootloader, as booting should jump to main and main can start at 0 other than after the vectors. You can do this well enough for Blink, and recognise stack pointer initialization. You will also need the Atmel/Microchip *def.inc files for the MPU component enumerations so that you know your DDRB from you DDRC a good disasembler should know. OK for 10 instructions, but harder for 16K of them. It might be easier to "walk through" the assembly and perform a translation of the perceived behaviour. At least the hex file is human readable, but little endian. This is harder than is looks, whilst most Arduino code is very simple, the libraries can be be wild and woolly. Then iteratively compile and compare fragments. Use pattern analysis to recognise source patterns as compiled. You may want to dump the fuses as well, for redirected vectors and such. Use avr-objdump (or similar) to disassemble the instructions.Īgain, PROGMEM data is going to be interpreted as opcodes, and may not be valid opcodes.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |