Jump to content

Markel

Members
  • Content Count

    14
  • Joined

  • Last visited

  • Days Won

    1

Markel last won the day on March 3 2017

Markel had the most liked content!

About Markel

  • Rank
    Member

Contact Methods

  • Website URL
    https://markelthinkslearnscreates.wordpress.com/

Profile Information

  • Gender
    Male
  • Location
    Philippines
  • Interests
    electronics, wireless mcu
  • Github
    https://github.com/mtrobregado
  1. Hi Rei Vilo, I am using Windows 10. - Markel
  2. Hi, I am using Energia 1.8.7E21. I am interfacing a HX711 Weighing Scale kit to MSP430FR5969 Launchpad. I am using a Energia Code that worked at another weighing scale project more than a year ago. When I program it, it runs 1 time and I see the output at Serial Console. But when I program again there is no output. Out of 10 programming the first one only has output. The rest do not have output at Tera Term. To confirm that the program does not run I put a code to turn on the red led. But the red led did not turn on. #include "HX711.h" #define DOUT 5 #define CLK 6 // most launchpads have a red LED #define LED RED_LED HX711 scale(DOUT, CLK); float calibration_factor = -7050; //-7050 -130000 void setup() { // initialize the digital pin as an output. pinMode(LED, OUTPUT); digitalWrite(LED, HIGH); // turn the LED on (HIGH is the voltage level) Serial.begin(9600); Serial.println("HX711 calibration sketch"); Serial.println("Remove all weight from scale"); Serial.println("After readings begin, place known weight on scale"); Serial.println("Press + or a to increase calibration factor"); Serial.println("Press - or z to decrease calibration factor"); scale.set_scale(); scale.tare(); //Reset the scale to 0 long zero_factor = scale.read_average(); //Get a baseline reading Serial.print("Zero factor: "); //This can be used to remove the need to tare the scale. Useful in permanent scale projects. Serial.println(zero_factor); } void loop() { scale.set_scale(calibration_factor); //Adjust to this calibration factor Serial.print("Reading: "); Serial.print(scale.get_units(), 3); Serial.print(" lbs"); //Change this to kg and re-adjust the calibration factor if you follow SI units like a sane person Serial.print(" calibration_factor: "); Serial.print(calibration_factor); Serial.println(); //digitalWrite(LED, HIGH); // turn the LED on (HIGH is the voltage level) if(Serial.available()) { char temp = Serial.read(); if(temp == '+' || temp == 'a') calibration_factor += 10; else if(temp == '-' || temp == 'z') calibration_factor -= 10; else if(temp == 's') calibration_factor += 100; else if(temp == 'x') calibration_factor -= 100; else if(temp == 'd') calibration_factor += 1000; else if(temp == 'c') calibration_factor -= 1000; else if(temp == 'f') calibration_factor += 10000; else if(temp == 'v') calibration_factor -= 10000; else if(temp == 't') scale.tare(); //Reset the scale to zero } }
  3. Hi, At a previous project I turn on and off power to ST LIS3DH Accelerometer using a MOSFET Circuitry. This is so to make sure the I2C Sensor is not consuming current when not in use. A colleague of mine designed to power a ST LSM303AGR from one of the MCU IO Pins. The MCU IO voltage is enough to power the ST LSM303AGR, so, should work. But, powering I2C Sensor from MCU IO Pins is not the usual way and new to me. Do you think that powering the ST LSM303AGR from one of the MCU IO Pin is okay or is not recommended? Regards, Markel
  4. Hi Clavier, Thanks for your reply. You are correct. So, these below are the sequences that I will do when powering on and powering off the LIS3DH Accelerometer. Powering On: Set ACC_VCC to 0, to turn on power to LIS3DH Accelerometer. Call SensorI2C_open(). Enable ACC_INT1 Pin. Powering Off: Disable ACC_INT1 Pin. Call SensorI2C_close(). Set ACC_VCC to 1, to turn off power to LIS3DH Accelerometer. Best Regards, Markel
  5. Hi, I have this MOSFET Power Circuitry connected to LIS3DH Accelerometer. The LIS3DH Accelerometer is connected to TI BLE CC2640R2F. The expected behaviour is if ACC_VCC is 0, it will power on the LIS3DH Accelerometer, and if ACC_VCC is 1, it will turn off the LIS3DH Accelerometer. However, if I initialize the open the I2C pins at program initialization by calling SensorI2C_open();. This is the behavior below. By normal knowledge The I2C pins connected to the LIS3DH Accelerometer should not affect the MOSFET Power Circuitry. I suspect the MOSFET Power Circuitry is wrong. Can anyone here give me tips what could be wrong. 1. Set ACC_VCC to 1, to turn off accelerometer. 2. VACC is measured at 3.2 V, which should not be. 3. Set ACC_VCC to 0, to turn on accelerometer. 4. VACC is measured at 3.2V, which is correct. Attached is the Accelerometer Circuitry..
  6. Hi, Just an update. I tested this at a weighing scale setup. My load weigh is 1 litre of water = 2.2 lbs. I run the SparkFun_HX711_Calibration.ino and got the calibration factor. I set the calibration factor at SparkFun_HX711_Example.ino. I got the correct weight displayed which is 2.2 lbs. Best Regards, Markel Robregado
  7. Hi, I set the calibration value to -1.f and now I get value of 3200. So I guess that is more reasonable value. Next I will try the program at load cell or weighing scale setup. Here is my code below. #include <SPI.h> #include <OneMsTaskTimer.h> #include <LCD_SharpBoosterPack_SPI.h> #include "HX711.h" /* Example using the SparkFun HX711 breakout board with a scale By: Nathan Seidle SparkFun Electronics Date: November 19th, 2014 License: This code is public domain but you buy me a beer if you use this and we meet someday (Beerware license). This example demonstrates basic scale output. See the calibration sketch to get the calibration_factor for your specific load cell setup. This example code uses bogde's excellent library: https://github.com/bogde/HX711 bogde's library is released under a GNU GENERAL PUBLIC LICENSE The HX711 does one thing well: read load cells. The breakout board is compatible with any wheat-stone bridge based load cell which should allow a user to measure everything from a few grams to tens of tons. Arduino pin 2 -> HX711 CLK 3 -> DAT 5V -> VCC GND -> GND The HX711 board can be powered from 2.7V to 5V so the Arduino 5V power should be fine. */ #define calibration_factor - 1.f//-7050.0 //This value is obtained using the SparkFun_HX711_Calibration sketch //2280.f #define DOUT 18//3 #define CLK 19//2 HX711 scale(DOUT, CLK, 128); // Variables LCD_SharpBoosterPack_SPI myScreen; uint8_t myOrientation = 0; uint16_t myCount = 0; void setup() { Serial.begin(9600); myScreen.begin(); myScreen.clearBuffer(); Serial.println("HX711 scale demo"); scale.set_scale(calibration_factor); //This value is obtained by using the SparkFun_HX711_Calibration sketch scale.tare(); //Assuming there is no weight on the scale at start up, reset the scale to 0 Serial.println("Readings:"); } void loop() { Serial.print("Reading: "); Serial.print(scale.get_units(), 2); //scale.get_units() returns a float Serial.print(" grams"); //You can change this to kg but you'll need to refactor the calibration_factor myScreen.text(10, 10, String(scale.get_units(), 2)); myScreen.text(10, 25, "grams"); myScreen.flush(); Serial.println(); } Best Regards, Markel
  8. Hi energia, From my last post, I can say that it is working but I do not have the correct setup to try out the example program from Sparkfun link below. I should try the example programs using a weighing scale setup connected to the Sparkfun Load Cell Amplifier HX711 board. Also, I am not able to get a calibration value because I am using a voltage divider board that outputs 5 mV, 10 mV, 15 mV, and 20 mV https://github.com/sparkfun/HX711-Load-Cell-Amplifier The formula for getting the calibration value, is explained in this link below. https://github.com/aguegu/ardulibs/tree/master/hx711 I am not an expert with MSP430 Launchpad and Energia, so any helpful inputs would be great. Best Regards, Markel Robregado
  9. I modify the HX711 scale(DOUT, CLK); to HX711 scale(DOUT, CLK, 128 ); to set channel A, gain factor 128. I made changes base from HX711.cpp void HX711::begin(byte dout, byte pd_sck, byte gain) { PD_SCK = pd_sck; DOUT = dout; pinMode(PD_SCK, OUTPUT); pinMode(DOUT, INPUT); set_gain(gain); } I get output at Tera Term "Reading: 0.1 lbs", that is for 20 mV input to Sparkfun Load Cell Amplifier HX711. Best Regards, Markel Robregado
  10. Hi, I am evaluating the Sparkfun Load Cell Amplifier HX711 using the MSP430FR5969 Launchpad. I added HX711 library and modified the HX711.cpp and HX711.h according to this post below. https://learn.sparkfun.com/tutorials/load-cell-amplifier-hx711-breakout-hookup-guide http://forum.43oh.com/topic/10172-hx711-library-for-use-in-energia/ I opened the SparkFun_HX711_Example.ino. After build, I get this error at HX711.h. error: ISO C++ forbids in-class initialization of non-const static member 'OFFSET' I comment out the initialization value of OFFSET and SCALE and it build without errors. I load the program to MSP430FR5969 LP and I get this output, "Reading: 0.0 lbs" HX711.h class HX711 { private: byte PD_SCK; // Power Down and Serial Clock Input Pin byte DOUT; // Serial Data Output Pin byte GAIN; // amplification factor long OFFSET; // = 0; used for tare weight float SCALE; // = 1; used to return weight in grams, kg, ounces, whatever SparkFun_HX711_Example.ino This example demonstrates basic scale output. See the calibration sketch to get the calibration_factor for your specific load cell setup. This example code uses bogde's excellent library: https://github.com/bogde/HX711 bogde's library is released under a GNU GENERAL PUBLIC LICENSE The HX711 does one thing well: read load cells. The breakout board is compatible with any wheat-stone bridge based load cell which should allow a user to measure everything from a few grams to tens of tons. Arduino pin 2 -> HX711 CLK 3 -> DAT 5V -> VCC GND -> GND The HX711 board can be powered from 2.7V to 5V so the Arduino 5V power should be fine. */ #include "HX711.h" #define calibration_factor -7050.0 //This value is obtained using the SparkFun_HX711_Calibration sketch #define DOUT 18//3 #define CLK 19//2 HX711 scale(DOUT, CLK); void setup() { Serial.begin(9600); Serial.println("HX711 scale demo"); scale.set_scale(calibration_factor); //This value is obtained by using the SparkFun_HX711_Calibration sketch scale.tare(); //Assuming there is no weight on the scale at start up, reset the scale to 0 Serial.println("Readings:"); } void loop() { Serial.print("Reading: "); Serial.print(scale.get_units(), 1); //scale.get_units() returns a float Serial.print(" lbs"); //You can change this to kg but you'll need to refactor the calibration_factor Serial.println(); } After that I connect the Sparkfun Load Cell Amplifier HX711 to MSP430FR5969 Launchpad. Here is the connections pin outs below MSP430FR5969 LP VCC 3.3 V <---------> VDD, VCC (shorted) Sparkfun Load Cell Amplifier HX711 MSP430FR5969 LP VCC GND <---------> GND Sparkfun Load Cell Amplifier HX711 MSP430FR5969 LP P1.2 Pin 19 <---------> CLK Sparkfun Load Cell Amplifier HX711 MSP430FR5969 LP P3.0 Pin 18 <---------> DAT Sparkfun Load Cell Amplifier HX711 MSP430FR5969 LP VCC 3.3 V <---------> VCC 3.3V Voltage Divider BRD MSP430FR5969 LP VCC GND <---------> GND 3.3V Voltage Divider BRD Voltage Divider BRD 15 mV -output <---------> WHT/A- Sparkfun Load Cell Amplifier HX711 Voltage Divider BRD 15 mV +output<---------> GRN/A+ Sparkfun Load Cell Amplifier HX711 Attached HX711.jpg is my setup. The problem is when I run the code I get output at Tera Term "Reading: 0.0 lbs". What could be causing this? I am suspecting the cause of this is my pin assignment 19 and 18 are wrong. But, I followed the pin out guide below. Also, maybe I should initialize OFFSET to 0 and SCALE to 1. http://energia.nu/pin-maps/guide_msp430fr5969launchpad/ Best Regards, Markel Robregado
  11. Markel

    Hi from the Philippines

    One good way to learn registers is to know how the internals of C API's work like GPIOPinWrite(). - Markel
  12. Markel

    Hi from the Philippines

    @@luis. I also want to use Energia. I already have a Temboo account and currently downloading Energia. Many months ago there was still no support for Tiva Connected Launchpad so I was not eager to learn about Energia. But my set priority now is learning how to make Iphone apps for CC3200 Launchpad. I will learn more about Energia+Temboo afterwards. - Markel
  13. Hi All, I joined here to learn more about using Energia for my TI Launchpads. Currently I have Tiva Connected Launchpad and CC3200 Launchpad. I am also a member of TI E2E. - Markel
×