Here is a very good page explaining the two methods of ultrasonic anemometers.
http://www.dl1glh.de/ultrasonic-anemometer.html
Posts made by Martin Tellblom
-
RE: Rebuild NETATMO Wind Sensor
-
RE: Rebuild NETATMO Wind Sensor
@gohan Where I live we can't have one with moving parts, There is often over 35m/s in the winter storms.
Thats why I bought the Netatmo in the first place. But It's maybe better to build an own, I have a lot of the parts -
RE: Rebuild NETATMO Wind Sensor
There is a good one here
https://soldernerd.com/category/arduino-ultrasonic-anemometer/
And another one for a selfbuild like the Netatmo uses with bouncing -
RE: Rebuild NETATMO Wind Sensor
the top above the transducers are plat and it says in the isntruction that you should avoid touching the area.
I have a broken outdoor sensor with temp, humid, Co2 and so on but there a very small ship on that one
-
RE: Rebuild NETATMO Wind Sensor
It measure it with four ultrasonic transducers that bounces their beam as you can see in this picture:
-
RE: Rebuild NETATMO Wind Sensor
Yes you are right, it is costly, but if I with a handheld anemometer and another with "spoons" at the same place can read a windspeed of 18m/s and Netatmo says 7 m/s (and there is nothing to configure regarding to Netatmos support) I would like to be able to do my own calibration.
What Ultrasonic sensor or what did you mean?
-
Rebuild NETATMO Wind Sensor
Hi,
Anyone rebuilt NETATMO wind sensor to work with mysensors? Or some other system.I have used Netatmo for about three years now and I am quite disappointed over what I can do with it.
So has anyone rebuild the windsensor to report to another system like mysensors or so.
What I'm after is to use the ultrasonicpart of the sensor and report to my inhouse mysensors gateway.
-
RE: Reflow Oven
@bjornhallberg Did you find a good oven to use in Sweden? I'm looking in to building one myself now
-
Sun / cloud sensor?
Has anyone build a cloud/ sun sensor?
I.e is it a sunny day or is it cloudy -
Single layer PCB
Hi,
I just recieved my small CNC mill (that will primarily be used for Laser engraving) and want to try milling some PCB. Anyone has a suggestion an a useful PCB that is single sided and can be used for something fun wihtin MySensors range (or not )
-
RE: How to mill a PCB at Home!
Hi all,
Just bought a little CNC + Laser engraver machine that I'm going to use for PCB milling and have some questians for the experienced users.@Frank-Herrmann will your Chillipeppr code work on all arduino/gcode based CNC routers?
Any other free software like BamCam for use will small projects?
What cutting bits are you using for PCB milling?
-
RE: Converting to 2.0 Slim Node as a Mini 2AA Battery PIR Motion Sensor code
Tried this setup and its not working very well for me, can be a busted PIR but I don't know.
It seems like it sometimes work, but if I leave the room and then enter it can take long time until the PIR triggers.If i put a LED and a resistor I do that between GND and signal or where do I place it?
-
RE: Anyone tried the $199 Monoprice 3D printer?
Simplify3D can slice for whatever printer. You just need to configure your printer in the software
-
RE: Battery powered sensor last 1 week
@Nicklas-Starkel
I did not with the Soil Moisture sensor. I choose the easy way to use the Xiaomi Mi plant sensor that I check with BlueTooth instead.But I did succeed with a DHT22 sensor that now have been running 32 days and sending every hour with battery level of 98% now so that one is a success.
-
RE: Add a structure level under My Project?
I was thinking if I created for example a Slim Node project, I should put it in that area.
Not only the creator of the PCB that the project is based on.Just to get it simpler to find project based on a specific PCB
Or as I said a pinned topic like this
Example:
Below is sensors based on My Slim 2AA Battery Slim Node found on openhardware.io
Slim Node as a Mini 2AA Battery PIR Motion Sensor
Slim Node Si7021 sensor example
-
Add a structure level under My Project?
Not so much a request as wishing.
Would it be possible to add a structure under My Project to collect all the SenseBender, Slim Node projects, Easy/Newbie PCB and so on so it would be simpler to find?
A structure like this for example:
My Project
Β Β SenseBender
Β Β Slim Node
Β Β Easy/Newbie PCBOr to pin a topic for containing links to all projects
This maybe already been up for discussion ?
-
RE: Anyone tried the $199 Monoprice 3D printer?
The negative as I see it:
Small buildarea 120x120x120mm
Quite slow 55mm/s as top speed (that means ~30mm/s in good printing mode)
Open to the air (If you open a windows while printing you can ruin your print)The positive:
The priceI think this could be a good printer as a first printer. You could proberbly hack it
-
Need help with arduino BlueTooth coding
Trying to build a Mysensors BlueTooth sensor, but I can't get it to work.
I have a HM-17 cypress adapter and when i using th SoftwareSerial library I can get the simplest things goingFor example I get the HW-Address when typing AT+ADDR?, the baudrate AT+BAUD? and so on.
When setting it in the mode for scanning, using AT+IMME1 and AT+ROLE1 and then start scanning using AT+DISC? I only get this answers:
OK OK+Set:1 OK+Set:1 OK+DISCS OK+DISCE
Between OK+DISCS and OK+DISKE there should be around 5 devices listed and after this everything just stops. No reaction to anymore commands.
The sketch I'm using is this:
#include <SoftwareSerial.h> int bluetoothTx = 3; // TX-O pin of bluetooth int bluetoothRx = 4; // RX-I pin of bluetooth SoftwareSerial bluetooth(bluetoothTx, bluetoothRx); void setup() { Serial.begin(9600); // Begin the serial monitor at 9600bps bluetooth.begin(9600); // The Bluetooth Mate defaults to 115200bps bluetooth.print("$"); // Print three times individually bluetooth.print("$"); bluetooth.print("$"); // Enter command mode delay(100); // bluetooth.println("U,9600,N"); // Temporarily Change the baudrate to 9600, no parity Serial.println("U,9600,N"); // 115200 can be too fast at times for NewSoftSerial to relay the data reliably bluetooth.begin(9600); // Start bluetooth serial at 9600 } void loop() { if(bluetooth.available()) // If the bluetooth sent any characters { // Send any characters the bluetooth prints to the serial monitor Serial.print((char)bluetooth.read()); } if(Serial.available()) // If stuff was typed in the serial monitor { // Send any characters the Serial monitor prints to the bluetooth bluetooth.print((char)Serial.read()); } // and loop forever and ever! }
Anyone here that is good at this and could get me a hint?
-
RE: ESP8266 and TTL-UART GPS
@mfalkvidd said:
e
Thanks v:) the instructions were great, now lets see if the child or the dog gets the first try
-
RE: ESP8266 and TTL-UART GPS
Thanks, since I'm not a electric engineer can you recommend a suitable level converter that would be suitable?
-
ESP8266 and TTL-UART GPS
Since I got so good answers a few hours ago with the ESP8266 questian I had, I try again.
Can I connect a TTL-UART (TTL-serial) gps module to a ESP8266?
I have three of these on my desk and like to use them for something fun with a ESP8266 (Like a small battery powered gps tracker for the kids/dog or so)
-
RE: ESP8266 need six analog input
Tnaks,
I saw that Adafruit had a library and code or this that should be ESP8266 certified ...I'll try. Thanks for quick support
-
RE: ESP8266 need six analog input
@mfalkvidd said:
onfigurable so you should be able to use up to 4, giving you a total of 16 inputs. Also, it is able to measure voltages up to Vcc which is mych easier than having to cope with the 1V limit of the esp analog input.
Looks promising, a few problems just
The delivery time (found a few similar on ebay but they all seem to be shipped from the other side of the world with at least 30 days of deliverytime.It's a lot easier to be able to read 3.3V input I agree and this seems like the best idea yet but I don't now how to physicly connect the 6 wires to the 4 inputs and then I need a code that I can adapt.
Or shall I use 2 of them (regarding to this Adafruit you can use 4 on the same I2C connection)
Is this the same?
http://www.ebay.co.uk/itm/16-Bit-I2C-4-CH-ADS1115-ADS1015-Module-ADC-Development-Board-for-Arduino-TE570-/282148404206?hash=item41b15afbee:g:zQkAAOSwZVlXveLA
and
http://www.ebay.co.uk/itm/16-Bit-I2C-Analogue-to-Digital-Convertor-Pro-Gain-Amp-ADS1115-4-Ch-Flux-Workshop-/122018838555?hash=item1c68e3b81b:g:hvkAAOSwepJXZE~N -
ESP8266 need six analog input
Has anyone experience with more than one analog input on the ESP8266?
I have seen this example but I don't know if it will work well (the op-amp he is using is not specified).
I have also googled that people uses MCP3004, MCP3008, MCP3021, MCP3421 for this, but I can't find anyone (beside the top example) that have a build tutorial for this expanded analog inputs.
So have anyone else used six (or more) analog inputs on teh ESP8266 and can share the solution?
-
RE: Azure IoT ?
@TheoL said:
ed a T
I have the code to do it on a arduino, but I need to MySensors it
Just wondered if anyone else already done this so I didn't had to do it -
RE: Best or any way to get battery before regulator
@AWI said:
e 5 volt is the refer
Once again. Big thank you @AWI . As you understand I'm new to this battery thing and it's kind of driving me crazy
-
RE: Best or any way to get battery before regulator
@AWI But that is always 5V until the end of the battery since I use a step-up or am I thinking completely wrong here
-
RE: Best or any way to get battery before regulator
@AWI So that should be enought? I'll try that
-
RE: Best or any way to get battery before regulator
@AWI How do I do that? This is my first battery node tryout
-
RE: Best or any way to get battery before regulator
If I use this code:
#if defined(__AVR_ATmega2560__) analogReference(INTERNAL1V1); #else analogReference(INTERNAL); #endif
And try to use the analog pins for this soil moisture sensor the values I get from the other analog pins goes all crazy with its values
-
Best or any way to get battery before regulator
As I understand after some failed attempt to do a soil moisture sensor with battery check included I can't use any analog pins when using this method described in Battery Powered sensors.
My sensor looks like this:
And this does it impossible to use the VCC library since I have a regulator.
Any other way to get the batterylevel in my setup?
-
RE: Front Door Lock With mysensore
I use Abloy EL582 and with that you can either set it to be open as long as 12V is applied, or closed as long as 12V is applied.
Simple as that.
I control my doors with a KNX switch.
If you go with a lock like this and have the door closed when no power is applied be ware that you need a key to open in from inside in case of fire. -
RE: Office plant monitoring
It seems like @sundberg84 nailed it
The battey metering I use with his PCB is this:#if defined(__AVR_ATmega2560__) analogReference(INTERNAL1V1); #else analogReference(INTERNAL); #endif
And that reflect on all analog channels and break the function..
After I removed the battery sensing code it work great -
RE: Case printer 3D - Mysensors Gateway
@pepson said:
roject for case printer 3D for MySensors Gateway on PCB OSHpark with arduino nano ? I need case for it...
As this:
https://forum.mysensors.org/topic/56/arduino-nano-gateway-for-vera-pcb-link/2If you have a own printer it's easy to do a case using Tinkercad and it's free to use
-
RE: Office plant monitoring
@mfalkvidd said:
should be) completely passive, so there is nothing that should be able to go wrong.
Could you post a photo of your connections?
Here is my setup. Using the Easy/Newbie board that @sundberg84 created with a 5V arduino mini pro 16Mhz. Using A4 and A5 to the sensor
Regarding the resistance when its out of the soil there is no connection at all. If I put it in the soil there a strange thing happening .
The resistance start around 10K and then slowly increase (no matter if I switch the direction) the longer I test the higher value.
If I switch the direction the resistance start from whre it just was and keep rising . If I let the senor pause for a while (5 minutes or so) it's back to around 10K.Maybe I test it to often? Don't let the moisture get back to the soil?
-
RE: Office plant monitoring
I at the office right now, measure them when I home
-
RE: Office plant monitoring
@mfalkvidd
Have tried both a 3.3V and a 5V both behave the same.
I check every 30 seconds now and after about 10 minutes the result is 0 on both directions.
I restart the arduino and then one direction shows a value and the other 0.
There is proberbly something with my forksDid I mention that I upgraded the sketch to 2.0? Could that be a problem?
-
RE: Plant moisture sensor - I give up...
I have seen it and it's nice. Live in Sweden where the sun turn of at around 18:00 (6pm) so we need batteries
Joke aside my are intended to be used for the two plants we have indoors. -
RE: Office plant monitoring
@mfalkvidd : Yes I did, and I have tried using A2&A3 and its the same
-
RE: Office plant monitoring
@mfalkvidd said:
me do you le
My "Fork" is stamped with YL-69. Looks exacly like the XD-28
It's your code from post 25 so I suppose 1000 (#define STABILIZATION_TIME 1000 ) -
RE: Office plant monitoring
After my other failed attempt I needed to try this.
I have a 5V Mini using A4 and A5 and a fork YL-69 and I get these result:Direction: 1
Moist: 171
Direction: 0
Moist: 23
Direction: 1
Moist: 172
Direction: 0
Moist: 0
Direction: 1
Moist: 164
Direction: 0
Moist: 0
Direction: 1
Moist: 156
Direction: 0
Moist: 0
Direction: 1
Moist: 144
Direction: 0
Moist: 0This is not the percentage value , its this value I print: moistureLevel = (1023 - analogRead(SENSOR_ANALOG_PINS[direction]));
Any Ideas?
-
RE: Plant moisture sensor - I give up...
@scalz said:
s not cost so much so..perh
Or maybe the plants would be lucky to get to survive
I'll test and see what I can do with a Bluetooth sensor, it's worth a try -
RE: Plant moisture sensor - I give up...
Hi
Thanks for the advise and your good points.But as you can see we have two living plants (in a 230m2 house ) so It's just so we don't need to buy new plants every other week.
It probably wood be enough to use the Xi Plant as it is with the mobile but I want to have the alarm that tells me "Hey give me some water"I can say that under the 3 weeks I tested to build my own sensor for this two plants died on my desk .
As you can imagine nor my wife or me are "plant people"
-
Plant moisture sensor - I give up...
I have now tried to build a plant moisture sensor that will have a battery life longer than 2 month and I have to confess, I can't do it.
I get either 1023 or something like 54 (always two static values and yes I'm using a analog moist sensor).
I have seen this and it looks like my thoughts
Since we only have two plants in our house It feels like it would be simpler to buy a already made sensor and then connect it to MySensors gateway.
Most of the ready made are using bluetooth to communicate so it would be possible to use a bluetooth arduino module to communicate (I you know how to read the sensor)
My ide was to buy something like this:
Plant Sensor on Aliexpress
Strange thing on Ebay that could be adapted
Parrot Flower Power - that actually is a lot cheaper in Sweden where you can buy it for like $30and either build a Bluetooth MySensor that can talk to the two bluetooth (i.e decompile the android app to get how the API works)
or attaching something to the soil sensor (with it own battery) after removing the summerHas anyone tried this? or done something similar?
There are several other plant sensors around and the above is just an example at Wife Friendly sensors that maybe could be adapted to MySensors. -
RE: Clean looking sensor node
@Nca78 said:
such a polished look
Actually it can have that look if you print with ABS and treat it with acetone vapor afterwards.
For example look at these picturesHave treated my prints that way many times and the result is very good.
-
RE: [Solved] MQTT gateway problem
Can you connect to the MQTT server using MQTT-SPY?
-
RE: What does !TSP:MSG:PVER mismatch mean?
You mean the gateway I suppose? The radio is a NFR24L01+ with PA and LNA. a cap (right now the UNO is power by a computer USB port)
-
RE: What does !TSP:MSG:PVER mismatch mean?
0;255;3;0;9;TSP:MSG:READ 101-101-101 s=101,c=5,t=101,pt=3,l=12,sg=1:25957 0;255;3;0;9;!TSP:MSG:PVER mismatch 0;255;3;0;9;TSP:MSG:READ 101-101-101 s=101,c=5,t=101,pt=3,l=12,sg=1:25957 0;255;3;0;9;!TSP:MSG:PVER mismatch
This started today again and if I read the values correctly its a sensor with ID 101?
What I can find I can decode this:
TSF:MSG:READ,sender-last-destination,s=%d,c=%d,t=%d,pt=%d,l=%d,sg=%d:%s
s=sensor ID
c=command
t=msg type
pt=payload type
l=length
sg=signing flagBut I can't find what the values mean.
The other problem is that I do not have a sensor with id 101! I think this is something else that is messing with my radio.
-
RE: Clean looking sensor node
Oh no not good.
Had to buy some new cases ....... darn
They are so Wife friendly...
-
RE: My final setup to get MySensors and OpenHab communicating via MQTT
@Meshx86 said:
s distribution, i can't get openhab to distribute Address to the nodes when connecting, the MQTT Gateway sketch of my sensors doesn't do that right ?
Any tips that would be great
Set a static node id using
#define MY_NODE_ID 20
20 in this case is the node id.
-
RE: MQTT topics from HA contains trailing slash
Have you tried to subscribe to the topic exactly as shows up in for example MQTT-SPY?
-
Nice power regulator for testing
I bought a couple of these to test and they are working great.
If supplied with 12V you will have 3.3V, 5V and 12VThey are limited to 800mA
http://www.ebay.co.uk/itm/322204325197?_trksid=p2057872.m2749.l2649&ssPageName=STRK%3AMEBIDX%3AIT
-
RE: π¬ Building a MQTT Gateway
@DIM said:
my ignorance but I would like to k
The gateway is a arduino with NRF24L01+ (or RFM69) and serial/network/RS485 component. The sensor is another arduino with NRF24L01+ (or RFM69) and the sensor that are attached. The gateway is then acting as a translator from the NRF24L01+ (or RFM69) radiosignal to the medium that can talk to your controller
-
RE: π¬ Building a MQTT Gateway
The old network gateway with mqtt seems to be removed and the client version is the one that id preferred. Is it possible to have both mqtt server and network gateway in that version?
-
RE: π¬ Building a MQTT Gateway
Is it possible to have the MQTT client also act as a network gateway?
-
send(msg(double)); gives an error
I have defiened a MyMessage as this:
MyMessage msgSpeed(WIND_CHILD_ID, V_WIND);
Present it like this:
present(WIND_CHILD_ID, S_WIND);
And I get an error for this row since windSpeed is a double.
send(msgSpeed.set(windSpeed));
Get the error message:
Wind:94: error: call of overloaded 'set(double&)' is ambiguousIs it so that I can't send anything other than an INT for windspeed?
-
RE: Battery powered sensor last 1 week
Alright, my sensor has used 5% battery in 124,5 hrs that means that 100% is almost 104 days. Don't know how low the battery works but let say 20% at that is 83 days.
I will start another test with D4 and see how that goes .....
-
RE: Guide: Setting up and testing MQTT Client Gateway
I use this gateway 2.0 and I'm very pleased with it, but...... I would like to be able to use it as a network gateway as well.
Is this possible? -
RE: Battery powered sensor last 1 week
I only have two kind of sensors that I need to be battery operated and that's the plants warning that they are out of water and soon gonna die and the dogs water bowl warning that they soon gonna die (KIDDING). The dogs bowl I like to measure the levels and have that to compare with the temperature, just for fun.
I hope I get this working aswell, It wont be pretty with a cable around the few plants we got -
RE: Battery powered sensor last 1 week
@sundberg84 Hmm What you are saying is that I need to buy a new and better Multimeter This is the reason I was waiting for ..... :9
-
RE: Battery powered sensor last 1 week
Or just simply take percentage and date/time and then a few days later see what has changed percentage wise ...
Its to simple I know but if 1% battery power equals 4 days the sensor probably last for about 9-10 month (the last percentage I suppose you don't get any communication with ) -
RE: Battery powered sensor last 1 week
I don't think my multimeter is good enough for this, It seems like it put in some power due if I
I will try this when I get home today and see if I need a new multimeter or not
-
RE: Battery powered sensor last 1 week
@sundberg84 said:
can measure how much uA it consumes in s
I thought I could do that with my multimeter but I get no value
-
RE: Battery powered sensor last 1 week
Stupid me, forgot defining it as output pinMode(SOIL_POWER_PIN, OUTPUT); in the setup
It's working now
-
RE: Battery powered sensor last 1 week
@sundberg84
OK,I have now changed to the below code and changed to a SOIL sensor with the LED still on
The LED is lit up even after digitalWrite(SOIL_POWER_PIN , LOW); so I don't think its working
void loop() { digitalWrite(SOIL_POWER_PIN , HIGH); wait(25); moisture = analogRead(SOIL_SENSE_PIN); wait(25); digitalWrite(SOIL_POWER_PIN , LOW); if (oldMoisture != moisture) { send(msgSoil.set(moisture, 0)); sendBatteryLevel(moisture); oldMoisture = moisture; } //Check Battery Level int sensorValue = analogRead(BATTERY_SENSE_PIN); int batteryPcnt = sensorValue / 10; if (oldBatteryPcnt != batteryPcnt) { // Power up radio after sleep sendBatteryLevel(batteryPcnt); oldBatteryPcnt = batteryPcnt; } digitalWrite(SOIL_POWER_PIN , LOW); digitalWrite(SOIL_POWER_PIN , LOW); sleep(SLEEP_TIME); }
-
RE: Battery powered sensor last 1 week
@sundberg84 said:
to HIGH to power the sensor and then LOW before you sleep the node.
If you have a multimeter
Alright so if I connect the Vcc sron the sensor to D2 (since I use D3 for measurement) and set that HIGH before I measure, should I have a sleep for it to power up aswell?
Something Like this?
digitalWrite(SOIL_POWER_PIN , HIGH); delayMicroseconds(25); moisture = analogRead(SOIL_SENSE_PIN); delayMicroseconds(25); digitalWrite(SOIL_POWER_PIN , LOW);
-
RE: Battery powered sensor last 1 week
@scalz said:
always powere
Alright, as you proberbly understand I'm not a electronics engineer so please explain that to me.
This is how its setup:Everything is build on @sundberg84 Easy/Newbie PCB (This is my LAB PCB that I try out on before soldering, easier to chane components to see if someone of the cheap once are broken)
Sensor Vcc connected to 3,3V, GND to GND and sensor to D3.
So what do I have to do to turn of the sensor when I put the arduino to sleep? -
Battery powered sensor last 1 week
I have made a sensor based an a Easy/Newbie PCB a pro Mini (3,3V 8Mhz with desolderd power LED and Regulator) attached a soil moisture sensor and checking every 2 hrs. The 2 AA batteries last just under a week.
What do I need to do more to get it to last a little bit longer that just under a week?
The sensor is the one here: https://www.mysensors.org/build/moisture
Her is the code I have adapted to check for battery aswell
/* The MySensors Arduino library handles the wireless radio link and protocol between your home built sensors/actuators and HA controller of choice. The sensors forms a self healing radio network with optional repeaters. Each repeater and gateway builds a routing tables in EEPROM which keeps track of the network topology allowing messages to be routed to nodes. Created by Henrik Ekblad <henrik.ekblad@mysensors.org> Copyright (C) 2013-2015 Sensnology AB Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors Documentation: http://www.mysensors.org Support Forum: http://forum.mysensors.org This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. ******************************* DESCRIPTION Arduino soil moisture based on gypsum sensor/resistive sensor to avoid electric catalyse in soil Required to interface the sensor: 2 * 4.7kOhm + 2 * 1N4148 Gypsum sensor and calibration: DIY: See http://vanderleevineyard.com/1/category/vinduino/1.html Built: Davis / Watermark 200SS http://www.cooking-hacks.com/watermark-soil-moisture-sensor?_bksrc=item2item&_bkloc=product http://www.irrometer.com/pdf/supportmaterial/sensors/voltage-WM-chart.pdf cb (centibar) http://www.irrometer.com/basics.html 0-10 Saturated Soil. Occurs for a day or two after irrigation 10-20 Soil is adequately wet (except coarse sands which are drying out at this range) 30-60 Usual range to irrigate or water (except heavy clay soils). 60-100 Usual range to irrigate heavy clay soils 100-200 Soil is becoming dangerously dry for maximum production. Proceed with caution. Connection: D6, D7: alternative powering to avoid sensor degradation A0, A1: alternative resistance mesuring Based on: "Vinduino" portable soil moisture sensor code V3.00 Date December 31, 2012 Reinier van der Lee and Theodore Kaskalis www.vanderleevineyard.com Contributor: epierre */ // Copyright (C) 2015, Reinier van der Lee // www.vanderleevineyard.com // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // Enable debug prints to serial monitor //#define MY_DEBUG // Enable and select radio type attached #define MY_RADIO_NRF24 //#define MY_RADIO_RFM69 #define MY_NODE_ID 30 int BATTERY_SENSE_PIN = A0; #include <math.h> // Conversion equation from resistance to % #include <MySensors.h> // Setting up format for reading 3 soil sensors #define NUM_READS 10 // Number of sensor reads for filtering #define CHILD_ID 0 MyMessage msg(CHILD_ID, V_LEVEL); unsigned long SLEEP_TIME = 7200000; // Every 2 hrs //Sleep time between reads (in milliseconds) long buffer[NUM_READS]; int index; int oldBatteryPcnt = 0; /// @brief Structure to be used in percentage and resistance values matrix to be filtered (have to be in pairs) typedef struct { int moisture; //!< Moisture long resistance; //!< Resistance } values; const long knownResistor = 4700; // Constant value of known resistor in Ohms int supplyVoltage; // Measured supply voltage int sensorVoltage; // Measured sensor voltage values valueOf[NUM_READS]; // Calculated moisture percentages and resistances to be sorted and filtered int i; // Simple index variable void setup() { #if defined(__AVR_ATmega2560__) analogReference(INTERNAL1V1); #else analogReference(INTERNAL); #endif } void presentation() { sendSketchInfo("Soil Moisture Sensor Reverse Polarity", "1.0"); present(CHILD_ID, S_HUM); } void loop() { measure(6, 7, 1); // Serial.print ("\t"); // Serial.println (average()); long read1 = average(); measure(7, 6, 0); //Serial.print ("\t"); //Serial.println (average()); long read2 = average(); long sensor1 = (read1 + read2) / 2; /*Serial.print ("resistance bias =" ); Serial.println (read1 - read2); Serial.print ("sensor bias compensated value = "); Serial.println (sensor1); Serial.println (); */ //send back the values send(msg.set((long int)ceil(sensor1))); // delay until next measurement (msec) int sensorValue = analogRead(BATTERY_SENSE_PIN); //Serial.println(sensorValue); int batteryPcnt = sensorValue / 10; /* // DEBUG Battery INFO float batteryV = sensorValue * 0.003363075; Serial.print("Battery Voltage: "); Serial.print(batteryV); Serial.println(" V"); Serial.print("Battery percent: "); Serial.print(batteryPcnt); Serial.println(" %"); // END DEBUG INFO */ if (oldBatteryPcnt != batteryPcnt) { // Power up radio after sleep sendBatteryLevel(batteryPcnt); oldBatteryPcnt = batteryPcnt; } sleep(SLEEP_TIME); } void measure (int phase_b, int phase_a, int analog_input) { // read sensor, filter, and calculate resistance value // Noise filter: median filter for (i = 0; i < NUM_READS; i++) { // Read 1 pair of voltage values digitalWrite(phase_a, HIGH); // set the voltage supply on delayMicroseconds(25); supplyVoltage = analogRead(analog_input); // read the supply voltage delayMicroseconds(25); digitalWrite(phase_a, LOW); // set the voltage supply off delay(1); digitalWrite(phase_b, HIGH); // set the voltage supply on delayMicroseconds(25); sensorVoltage = analogRead(analog_input); // read the sensor voltage delayMicroseconds(25); digitalWrite(phase_b, LOW); // set the voltage supply off // Calculate resistance // the 0.5 add-term is used to round to the nearest integer // Tip: no need to transform 0-1023 voltage value to 0-5 range, due to following fraction long resistance = (knownResistor * (supplyVoltage - sensorVoltage ) / sensorVoltage) ; delay(1); addReading(resistance); Serial.print (resistance); Serial.print ("\t"); } } // Averaging algorithm void addReading(long resistance) { buffer[index] = resistance; index++; if (index >= NUM_READS) index = 0; } long average() { long sum = 0; for (int i = 0; i < NUM_READS; i++) { sum += buffer[i]; } return (long)(sum / NUM_READS); }
-
RE: PowerSaving cutting
Thank you, I try that first.
I cut the red LED and let the blue one be (since it just blinks a couple of times when starting up) -
PowerSaving cutting
Starting with my first battery powered sensor and I got the Soil Moisture sensor running 8,5 hours and just used 10% of the battery
So probably I water the flower every 3rd day when i replaces the batteriesJoke aside I really need to save some powerand the first thing I like to do is remove the LED and power regulator from the board.
My boards that I have doesn't look like the once in the guide and I don't really know where to cut to disable the power regulator
The red cut is the LED but should I cut at the green or the yellow?
The yellow is connected to Vcc 3.3V pin and the green cut is Vcc from the FTDI.
I think I should cutthe green one but I'm not sureAnd the second thing If I use the sleep(very long number) is the Pro Mini going down in real sleep mode or do I have to do something else?
-
RE: Easy/Newbie PCB for MySensors
Recived my boards today and I love them, I ordered the white ones and they are looking really great
Thanks @sundberg84 !
-
RE: π¬ Soil Moisture Sensor
There is something in the sketch I do not understand
* Connection: * D6, D7: alternative powering to avoid sensor degradation * A0, A1: alternative resistance mesuring
void setup() { // initialize the digital pins as an output. // Pin 6,7 is for sensor 1 // initialize the digital pin as an output. // Pin 6 is sense resistor voltage supply 1 pinMode(6, OUTPUT); // initialize the digital pin as an output. // Pin 7 is sense resistor voltage supply 2 pinMode(7, OUTPUT); }
What is this for?
-
Forward GW error messages
Is there a way for me in my MQTT-Client-Gateway to catch lets say communication errors?
What I like to do is if I get a FAIL, ERR och so I would like to sent that message to a MQTT topic so for example Openhab can send me a mail with that error message.
Is it possible to read the log from within the sketch?
-
RE: What does !TSP:MSG:PVER mismatch mean?
I restarted the sensor and it now works like a charm, haven't done anything to it.
I have to wait another two weeks to see if it happens againThanks @hek for the link ( I was looking for that the other day)
-
What does !TSP:MSG:PVER mismatch mean?
I have a DHT11 running for about 2 weeks now and suddenly the GW says the following lines over and over again:
What does that mean?0;255;3;0;9;TSP:MSG:READ 101-101-101 s=101,c=5,t=101,pt=3,l=12,sg=1:25957 0;255;3;0;9;!TSP:MSG:PVER mismatch 0;255;3;0;9;TSP:MSG:READ 101-101-101 s=101,c=5,t=101,pt=3,l=12,sg=1:25957 0;255;3;0;9;!TSP:MSG:PVER mismatch 0;255;3;0;9;TSP:MSG:READ 101-101-101 s=101,c=5,t=101,pt=3,l=12,sg=1:25957 0;255;3;0;9;!TSP:MSG:PVER mismatch 0;255;3;0;9;TSP:MSG:READ 101-101-101 s=101,c=5,t=101,pt=3,l=12,sg=1:25957 0;255;3;0;9;!TSP:MSG:PVER mismatch 0;255;3;0;9;TSP:MSG:READ 101-101-101 s=101,c=5,t=101,pt=3,l=12,sg=1:25957 0;255;3;0;9;!TSP:MSG:PVER mismatch 0;255;3;0;9;TSP:MSG:READ 101-101-101 s=101,c=5,t=101,pt=3,l=12,sg=1:25957 0;255;3;0;9;!TSP:MSG:PVER mismatch
-
RE: Anyone tried compiler optimisations?
@Nca78
I can also combine with another MySensors Arduino mini for the rain metering.The problem I have is that the forcast is taking up alot of memory (and I don't know right now if I going to need that
-
RE: Anyone tried compiler optimisations?
The problem I saw when trying to use -O1 flag was that the size was less than the standard -Os (That should optimize according to space) , and thats strange.
-
Anyone tried compiler optimisations?
Im creating a wheatherstation based on a UNO with a lot of sensors on it and I have started to run out of memory on my UNO.
I found a page that described how to compileroptimize regarding to executiontime and space.
He is changing the -Os compiler flag to -O2
Has anyone tried this?
Is this possible with the MySensors library? -
RE: My final setup to get MySensors and OpenHab communicating via MQTT
Thats good that you found the problem.
-
RE: My final setup to get MySensors and OpenHab communicating via MQTT
@zuolan
Hi.That's correct, whats shown is the presentation and the last row the LightValue, MySensors/100/100/1/0/23
First of all I don't think there is any problem at all in your sensor sketch, the only thing I have changed in my is that I have changed is that I added this row:
#define MY_NODE_ID 100What I think the problem is that you are subscribing the wrong topic:
As I mentioned before my MQTT settings are:
// Set this nodes subscripe and publish topic prefix #define MY_MQTT_PUBLISH_TOPIC_PREFIX "MySensors" #define MY_MQTT_SUBSCRIBE_TOPIC_PREFIX "MySensors-out"
Observerve that the MQTT topics is case sensative ie MySensors is NOT the same as mysensors.
I use MQTT-SPY (java based listener) to look at the messages and here you can look at every message sent when subscribing to # (And there is a BIG differense if you publish to MySensors or /MySensors). I suggest that you use MQTT-SPY and subscribe to both /# and # and that should catch all messages that comes to your broker (exept system messages)
Here you can se the differense between using the correct upper and lowercase and not. The first picture subribes to MySensors/#
And this one subscribes to mysensors/#
-
RE: My final setup to get MySensors and OpenHab communicating via MQTT
@zuolan
This is how my Light sensor present itself and submitting data:MySensors/100/255/0/0/17 2.0.0 MySensors/100/255/3/0/6 0 MySensors/100/255/3/0/6 Light Sensor MySensors/100/255/3/0/12 1.0 MySensors/100/100/0/0/16 null MySensors/100/100/1/0/23 7 <--This is the actual light value
So in my case to monitor the light value in openhab I use this address: MySensors/100/100/1/0/23
-
RE: My final setup to get MySensors and OpenHab communicating via MQTT
@zuolan
Hi , mygateway1-out is used when sending commands to MySensors devices. In my setup I have renamed it like this:// Set this nodes subscripe and publish topic prefix #define MY_MQTT_PUBLISH_TOPIC_PREFIX "MySensors" //Changed from "MySensors-in" #define MY_MQTT_SUBSCRIBE_TOPIC_PREFIX "MySensors-out"
You should subscribe to the topic that the Gateway is Publishing (i.e MySensors-in)
-
RE: My final setup to get MySensors and OpenHab communicating via MQTT
@zuolan Good that you found the problem. Don't forget to comment out define MY_SOFTSPI again
-
RE: Replacing a DS2423 with a mysensors sensor, Possible?
Thank you , Ill try that. I missed that one
I think my giving about 100 pulses / litre. -
RE: Getting started
You need to build a Network Gateway. follow the guide and it will be easy.
I used a UNO with a network Shield (Thera are nice shells for that on thingiverse, like the one I built )
When that is build you use the GatewayW5100MQTTClient sketch. Just edit your mosquitto server in the sketch and upload it to the gateway. Thats it
-
Replacing a DS2423 with a mysensors sensor, Possible?
As simple as it sounds. It there a easy way to replace a 1 Wire DS2423 (counter) with a Mysensors sensor?
I have an old 1-wire flow control sensor that has been connected to a DS2423 counter. I would rather use this flow control sensor with a Mysensors sensor instead, since I can't get hold of a new DS2423 (out of production since 2012)
The flow control sensor has three connections Vcc, GND and DATA. It is now attached the same way as a DS18B20 sensor with a resistor (4,7KOhm) between DATA and Vcc and then the DATA cable connects to a INPUT on the DS2423. Would it be possible to connect the DATA cable to a arduino port instead and let the arduino do the counting?
Anyone converted a 1 wire counter sensor before?
-
RE: Getting started
@vizonyc
I think I have the setup you like to have.Running Openhab with mosquitto on a virtual server.The openhab uses KNX, 1Wire, sonos and MQTT bindings.
My Z-Wave devices is connected to a Raspberry with the Z-Wave board Razberry that uses MQTT to communicate with openhab.
Finally the connection to Mysensors is done with the GatewayW5100MQTTClient and is user for example like "Temp GΓ€ststugan" that shows the temperature in the guesthouse.
I do not have any relays in the mysensors network yet, but I have them in my Z-wave network and communicate thru MQTT to the Razberry
On top of that Im running Dashing Dashing
So we have dashing on a tablet inside the door that displays all info and we can interact with all systems(KNX, Z-Wave, 1-Wire, Mysensors) from one place. We have also added things like when the next bus is leaving and so on.
And it's working great. So if you have any questians please let me now so can we see if I can help you set it up
-
RE: Read LED full size works, smd does not
Found the problem myself
There was another resistor on the other side of the PCB. If I connect the cable there instead it works -
Read LED full size works, smd does not
Hi,
Need help with my electronic skills (I'm a programmer, so my electronics knowledge is not so high)This is my problem:
If I attach a potential free input around a LED and resistor a as in a picture below (green and yellow is the potential free input) it works (when the LED is on the binary input is closed, when the LED is OFF the binary input is open).When I tries to accomplish this on a PCB with smd LED on it does not work the only difference is that there are 3 LED in a row (ie GND - Resistor - LED - LED - LED - VCC) .
Its the same voltage (+5VDC) in both environments).Need help to understand why it's not working, and how I can get it to work.
-
RE: π¬ Easy/Newbie PCB for MySensors
Just ordered 10 white bords, they look so great
-
RE: Read color of a LED?
Many things to try now I have ordered a couple of different solutions and will get back when they have arrived and I tried them.