@sundberg84 - Ah, I see. Thank you for this information. I'll check the consumption of the node itself then with BME280 attached to find out which component is the highest power consumer.
ZsoltZombori
@ZsoltZombori
Best posts made by ZsoltZombori
-
RE: 💬 Easy/Newbie PCB (RFM69 HW/W edition) for MySensors
Latest posts made by ZsoltZombori
-
RE: MLX90614 contactless temperature sensor
Hi guys,
I made a battery powered sensor with MLX90614 to check my furnace's temp. It needs Adafruit's MLX90614 library. I'm using RFM69 radios, so please make sure you chose the right one.
/** * 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. * ******************************* * * REVISION HISTORY * Version 1.0 - Henrik Ekblad * * DESCRIPTION * Pressure sensor example using BMP085 module * http://www.mysensors.org/build/pressure * */ // Enable debug prints to serial monitor #define MY_DEBUG // Enable and select radio type attached //#define MY_RADIO_NRF24 #define MY_RADIO_RFM69 #include <SPI.h> #include <MySensors.h> #include <Wire.h> //MLX90614 library from Adafruit #include <Adafruit_MLX90614.h> Adafruit_MLX90614 mlx = Adafruit_MLX90614(); #define MY_PARENT_NODE_ID 0 #define TEMP_CHILD 0 #define TEMP2_CHILD 1 #define BAT_CHILD 2 int BATTERY_SENSE_PIN = A0; // select the input pin for the battery sense point int oldBatteryPcnt = 0; // Sleep time between reads (in ms). Do not change this value as the forecast algorithm needs a sample every minute. const unsigned long SLEEP_TIME = 60000; float lastTemp=-1; float lastTemp2=-1; float lastBat=-1; boolean metric; MyMessage tempMsg(TEMP_CHILD, V_TEMP); MyMessage temp2Msg(TEMP2_CHILD, V_TEMP); MyMessage batMsg(BAT_CHILD, V_VOLTAGE); void setup() { // metric = getConfig().isMetric; mlx.begin(); // use the 1.1 V internal reference // pinMode(5, OUTPUT); #if defined(__AVR_ATmega2560__) analogReference(INTERNAL1V1); #else analogReference(INTERNAL); #endif } void presentation() { // Send the sketch version information to the gateway and Controller sendSketchInfo("MLX90614", "1.0"); // Register sensors to gw (they will be created as child devices) present(TEMP_CHILD, S_TEMP); present(TEMP2_CHILD, S_TEMP); present(BAT_CHILD, S_MULTIMETER); } // Loop void loop() { Serial.print("Ambient = "); Serial.print(mlx.readAmbientTempC()); Serial.print("*C\tObject = "); Serial.print(mlx.readObjectTempC()); Serial.println("*C"); int sensorValue = analogRead(BATTERY_SENSE_PIN); int batteryPcnt = sensorValue / 10.23; float batteryV = sensorValue * 0.003363075; #ifdef MY_DEBUG Serial.print("Battery Voltage: "); Serial.print(batteryV); Serial.println(" V"); Serial.print("Battery percent: "); Serial.print(batteryPcnt); Serial.println(" %"); #endif if (oldBatteryPcnt != batteryPcnt) { // Power up radio after sleep sendBatteryLevel(batteryPcnt); oldBatteryPcnt = batteryPcnt; } send(tempMsg.set(mlx.readAmbientTempC(), 2)); lastTemp = mlx.readAmbientTempC(); send(temp2Msg.set(mlx.readObjectTempC(), 2)); lastTemp2 = mlx.readObjectTempC(); send(batMsg.set(batteryV, 2)); lastBat = batteryV; sleep(SLEEP_TIME); }
-
RE: 💬 Easy/Newbie PCB (RFM69 HW/W edition) for MySensors
@sundberg84 - Very good tip, I read the datasheet of bme280 sensor and it need time to initialize. I added 10 ms wait to program,
@gohan - I made a very beginner mistake as you said. The wire.begin was added to setup, I wrote it to loop, but it is not working.. -
RE: 💬 Easy/Newbie PCB (RFM69 HW/W edition) for MySensors
@sundberg84 - I attached the BME280 to D5 to switch on/off (to achieve less power consumption) but if I upload the program the module powers up, and connecting, send a measurement with temp, hum, bat and goes to sleep than wake up, and does nothing. If I attach the sensor to normally VCC + GND, it works fine. How can it be? What could be the problem?
-
RE: 💬 Easy/Newbie PCB (RFM69 HW/W edition) for MySensors
@sundberg84 - Ah, I see. Thank you for this information. I'll check the consumption of the node itself then with BME280 attached to find out which component is the highest power consumer.
-
RE: 💬 Easy/Newbie PCB (RFM69 HW/W edition) for MySensors
@sundberg84 - Thank you for the tips, I'll write a battery sketch as you suggested and check the voltages. I'll reply with the results.
- And let me ask one more question; with switched off or lower BOD is it possible to reach longer battery life?
-
RE: 💬 Easy/Newbie PCB (RFM69 HW/W edition) for MySensors
@sundberg84 Dear sundberg,
-
I desoldered the voltage regulator and the power led from all my pro minis to prevent unnecessary consumption.
-
Yes, I'm using a booster like this
My multimeter is not sensitive enough to measure as small ampers. I will write in the sketch to power the sensor from a digital pin and try out this.
Thank you for the tips
-
-
RE: 💬 Easy/Newbie PCB (RFM69 HW/W edition) for MySensors
Hi there,
I have a little problem that you could probably answer. I built 3 temperature/humidity sensor nodes with this pcb mainboard. The sensors are BME280. The nodes are powered the following way:
- Phone charger 5V->3.3V (works good)
- 18650 battery (one piece), working good, but just for 2-3 weeks.
- AAA batteries (2 pcs), working good, but just for 1-2 days and the batteries are dead.
The power consumpntion is very high and i don't know why. Is it the BME sensor? What if I use DHT22?
ps: the sleeping time is 90 seconds and the nodes only sending status if something changes, otherwise not. Tha regulator and led desoldered from the pro mini.
Thank you for helping me out, I was very unlucky with nrf radios and this is the reason i try with rfm, but I almost give up (read all the forums to find out what is the problem and i cannot find it) :(:(
-
RE: 💬 Connecting the Radio
@palande.vaibhav I double checked everything and the PCB is perfect. Still waiting for a failure, but it's working now. I'm wondering what was the problem for weeks with the NRFs. The RFMs are working like a charm. Anyway, thank you for the ideas
Edit: there were two fails in ~21hrs, I attach the debug code:Starting sensor (RNNNA-, 2.0.0) TSM:INIT TSM:RADIO:OK TSP:ASSIGNID:OK (ID=3) TSM:FPAR TSP:MSG:SEND 3-3-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc: TSP:MSG:READ 0-0-3 s=255,c=3,t=8,pt=1,l=1,sg=0:0 TSP:MSG:FPAR RES (ID=0, dist=0) TSP:MSG:PAR OK (ID=0, dist=1) TSM:FPAR:OK TSM:ID TSM:CHKID:OK (ID=3) TSM:UPL TSP:PING:SEND (dest=0) TSP:MSG:SEND 3-3-0-0 s=255,c=3,t=24,pt=1,l=1,sg=0,ft=0,st=ok:1 TSP:MSG:READ 0-0-3 s=255,c=3,t=25,pt=1,l=1,sg=0:1 TSP:MSG:PONG RECV (hops=1) TSP:CHKUPL:OK TSM:UPL:OK TSM:READY TSP:MSG:SEND 3-3-0-0 s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=ok:0100 TSP:MSG:SEND 3-3-0-0 s=255,c=0,t=17,pt=0,l=5,sg=0,ft=0,st=ok:2.0.0 TSP:MSG:SEND 3-3-0-0 s=255,c=3,t=6,pt=1,l=1,sg=0,ft=0,st=ok:0 TSP:MSG:READ 0-0-3 s=255,c=3,t=15,pt=6,l=2,sg=0:0100 TSP:MSG:READ 0-0-3 s=255,c=3,t=6,pt=0,l=1,sg=0:M TSP:MSG:SEND 3-3-0-0 s=255,c=3,t=11,pt=0,l=18,sg=0,ft=0,st=ok:Temperature Sensor TSP:MSG:SEND 3-3-0-0 s=255,c=3,t=12,pt=0,l=3,sg=0,ft=0,st=ok:1.1 TSP:MSG:SEND 3-3-0-0 s=0,c=0,t=6,pt=0,l=0,sg=0,ft=0,st=ok: Request registration... TSP:MSG:SEND 3-3-0-0 s=255,c=3,t=26,pt=1,l=1,sg=0,ft=0,st=ok:2 TSP:MSG:READ 0-0-3 s=255,c=3,t=27,pt=1,l=1,sg=0:1 Node registration=1 Init complete, id=3, parent=0, distance=1, registration=1 TSP:MSG:SEND 3-3-0-0 s=0,c=1,t=0,pt=7,l=5,sg=0,ft=0,st=ok:22.6 TSP:MSG:SEND 3-3-0-0 s=0,c=1,t=0,pt=7,l=5,sg=0,ft=0,st=ok:22.6 TSP:MSG:SEND 3-3-0-0 s=0,c=1,t=0,pt=7,l=5,sg=0,ft=0,st=ok:22.6 [...] TSP:MSG:SEND 3-3-0-0 s=0,c=1,t=0,pt=7,l=5,sg=0,ft=0,st=ok:22.6 !TSP:MSG:SEND 3-3-0-0 s=0,c=1,t=0,pt=7,l=5,sg=0,ft=0,st=fail:22.6 TSP:MSG:SEND 3-3-0-0 s=0,c=1,t=0,pt=7,l=5,sg=0,ft=1,st=ok:22.6 TSP:MSG:SEND 3-3-0-0 s=0,c=1,t=0,pt=7,l=5,sg=0,ft=0,st=ok:22.6 [...] TSP:MSG:SEND 3-3-0-0 s=0,c=1,t=0,pt=7,l=5,sg=0,ft=0,st=ok:22.5 !TSP:MSG:SEND 3-3-0-0 s=0,c=1,t=0,pt=7,l=5,sg=0,ft=0,st=fail:22.5 TSP:MSG:SEND 3-3-0-0 s=0,c=1,t=0,pt=7,l=5,sg=0,ft=1,st=ok:22.5 TSP:MSG:SEND 3-3-0-0 s=0,c=1,t=0,pt=7,l=5,sg=0,ft=0,st=ok:22.4 TSP:MSG:SEND 3-3-0-0 s=0,c=1,t=0,pt=7,l=5,sg=0,ft=0,st=ok:22.4 TSP:MSG:SEND 3-3-0-0 s=0,c=1,t=0,pt=7,l=5,sg=0,ft=0,st=ok:22.4 [...] TSP:MSG:SEND 3-3-0-0 s=0,c=1,t=0,pt=7,l=5,sg=0,ft=0,st=ok:22.5 TSP:MSG:SEND 3-3-0-0 s=0,c=1,t=0,pt=7,l=5,sg=0,ft=0,st=ok:22.5 TSP:MSG:SEND 3-3-0-0 s=0,c=1,t=0,pt=7,l=5,sg=0,ft=0,st=ok:22.5 TSP:MSG:SEND 3-3-0-0 s=0,c=1,t=0,pt=7,l=5,sg=0,ft=0,st=ok:22.4 TSP:MSG:SEND 3-3-0-0 s=0,c=1,t=0,pt=7,l=5,sg=0,ft=0,st=ok:22.4 TSP:MSG:SEND 3-3-0-0 s=0,c=1,t=0,pt=7,l=5,sg=0,ft=0,st=ok:22.4
-
RE: 💬 Connecting the Radio
@mfalkvidd I put the node on serial for the night and everything works fine now. No errors occured, I'm still waiting.
@palande-vaibhav The GNDs are always connected in my circuits to prevent GND problems. Thanks for the tip. -
RE: 💬 Connecting the Radio
Hi guys!
I'd like to ask you about a problem. When I use RFM69 radios on my nodes, they are working fine, but when I try to use the NRFs everything is falling apart and that's driving me crazy. I can't find the solution to use NRFs (I've got 20 of them). I tried everything, read the forum a hundred times, but can't find the solution. Poer sources are perfect, every NRF has it's own 3.3v source and after a few hours or a few days perfect working, the nodes disappear (not all and not in the same time). I'm using Domoticz as controller on a RPI 2. I saw the node's L13 led's blinking is much lighter after the node disappears. When it's working okay, the led is blinking on full.
Thank you for the suggestions, and have a nice day