Originally posted by aldo
View Post
Announcement
Collapse
No announcement yet.
Arduino - Projects by topics
Collapse
X
-
HI Logbuilder, these are the ones
http://www.ebay.com/itm/ELENKER-5PCS...UAAOSw3h1ZTDHv
Thanks,
Aldo
Comment
-
I've not used a sensor like that. My 18B20 is on a board module.
This link talks about your type of sensor and it calls for a 4.7k resistor between data and vcc. Read it and see if it makes sense to you. That would be the first thing I would try.
https://create.arduino.cc/projecthub...arduino-9cc806
Comment
-
NodeMcu Scale
Some time back i posted a help request for assistance with this idea which has been on my to do list for about five years. At the time I think the request was very premature as the API for the nodemcu was not ready and hence I did not receive any replies.
However now that Greig has completed the API (thanks Greig) I have now been able to move this along, so I thought I'd share my progress so far.
The original requirement was to remotely weigh 2 large Gas bottles, similar to what would be used for BBQ's and Caravans but bigger. and report their respective weights back to HS, in order to gauge their capacity. Presently there is a auto change over mechanism which turns red when a bottle expires. this need to be sighted and a reorder call placed. Usually around once a month but easy to forget.
I used some 50kg load cells (4 per bridge) and a HX711 load cell amplifier in addition to the NodeMCU. All from AliExpress.
Connected like this
Original sketches were obtained from:
https://learn.sparkfun.com/tutorials...t-hookup-guide
Once the initial calibration had been done using the sketches above, thinning out the code for the API was quite easy.
My code below is more than required as I used 2 sets of HX711 amps, although 1 can handle 2 scales, the gain is different on each scale. Due to the HX711or the Library.
One scale ran fine without the Millis commands, (and I'm not sure I have done that right) but when the second was added there was some kind of timing problem and only scale B would update.
------------------------------------------------------------------------
//**************Declare your variables here*******************
#include "HX711.h"
//#define DOUT 4
//#define CLK 0
HX711 scaleA(4, 0);
HX711 scaleB(14, 12);
unsigned long interval=(5 * 60 * 1000); // Update every 5 minutes; // the time we need to wait
unsigned long previousMillis=0; // millis() returns an unsigned long.
//************************************************************ ****
void HSSetup() {
//************************
//Add YOUR SETUP HERE;
//************************
scaleA.set_scale(22600); //Adjust to this calibration factor
scaleA.set_offset(-224233);
scaleB.set_scale(23530); //Adjust to this calibration factor
scaleB.set_offset(389602);
}
void HSloop() {
unsigned long currentMillis = millis(); // grab current time
//************************
//Add YOUR CODE HERE;
//************************
/* To Send Data to Homeseer use SendToHS(Device,Value)
Eg.. SendToHS(1,200); where 1 is the API device in homeseer and 200 is the value to send
To Recieve data from Homeseer look up the FromHS array that is updated when the device value changes.
Eg.. FromHS[5] would be the data from API Output device 5
All code that is located just below this block will execute regardless of connection status!
You can include SendToHS() calls, however when there isn't an active connection, it will just return and continue.
If you only want code to execute when HomeSeer is connected, put it inside the if statement below.
*/
/*Execute regardless of connection status*/
if (IsConnected == true) { /*Execute ONLY when HomeSeer is connected*/
scaleA.get_units(10);
if ((unsigned long)(currentMillis - previousMillis) >= interval);{
SendToHS(1,(scaleA.get_units(1)));
SendToHS(2,(scaleB.get_units(1)));
previousMillis = millis();
}
}
}
-------------------------------------------------------------
Whilst I had a specific need for this project, it could be used for a variety of things, bathroom scale, BBQ gas bottle level, how long pooch spends in the basket, is the beer fridge running low etc.
Hope someone finds this useful.
B
Comment
Comment