What can i use to create an interrupt to wake a sleeping Arduino?
This using your Plant_Moisture_Sensor sketch.
y4CdW42Ol8
Posts
-
MySensor.h conflict with RF24.h? -
MySensor.h conflict with RF24.h?When using the GW library, is there a way to communicate from one node to another, without having to go thru a controller?
I have read some of the 1.5 API, but I cant really tell if this can be done.
What about the LowPower.h library. Does it put the Radio to sleep?
-
MySensor.h conflict with RF24.h?I forgot to mention I only use the gw libary to put the 3.3v Mini to sleep.
-
MySensor.h conflict with RF24.h?My goal is simply to Xmit the battery voltage and moisture sensor data from one Pro Mini (with RF24) to another Pro Mini (also with a RF24 radio), not using gw calls. My receiving Pro Mini will simply control a relay.
I'm trying to combine two example sketches:
- Plant_Moisture_Sensor_Low_Power
- Arduino RF24XmitExample
#include <SPI.h>
#include <MySensor.h>
#include "RF24.h"However, I'm getting compile errors. There seems to be a conflict between the MySensor gw library calls and the RF24 library calls.
The first of many compile errors I get are:
C:\Users\Dieter\AppData\Local\Temp\build3316808d9e952884aa2dded546ad6403.tmp\libraries\RF24\RF24.cpp.o: In function `SPIClass::setBitOrder(unsigned char)':C:\Users\Dieter\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.11\libraries\SPI\src/SPI.h:293: multiple definition of `RF24::csn(bool)'
In the end, I get: Exit status 1
Error compiling for board Arduino Pro or Pro Mini.Both examples individually compile OK.
Any thoughts?
Dieter -
3.3v Pro Mini, Radio, Moisture Sensor and StepUp regulator - AA battery powerWow, I could never come up this sketch! I get the gist of it, but it will take me some time to figure out exactly how it works. I'm still learning the code syntax.
I don't understand: MySensor gw; and your other gw library calls like:
MyMessage msg(CHILD_ID, etc..)
MyMessage voltage,etc... and
gw.present(CHILD_ID ...)
gw.send(msg.set...)Are these explained somewhere?
I was not going to use this library, but rather just another Pro Mini to "receive" the data from the sensor, using the RF24.h library. I have that working.
Can I use the gw library just using another Pro Mini? Do you have the "receive" sketch?
Thanks,
Dieter -
3.3v Pro Mini, Radio, Moisture Sensor and StepUp regulator - AA battery powerHow do you drop the frequency to 1Mhz? Change the crystal? Is there a software way to do that?
I have since removed the Pro Mini power LED and the current dropped to 102 micro amps (with the moisture sensor removed). With the moisture sensor board IN and its LED removed, the draw is 1.4 ma - not so good (regulator still in).
I found that I can read the analog voltage (A0) using only the moisture probe (and not the board). It varies from 1.11v (dry) to 1.66v (fully wet) - but then no interrupts. I will try a 12hr wake up timer (as mentioned)...
Thanks
-
3.3v Pro Mini, Radio, Moisture Sensor and StepUp regulator - AA battery powerI hesitate to remove the regulator. I rendered one Pro Mini useless trying to cut the trace to the Power LED.
I will try removing the StepUP. But not sure what will happen to the Pro Mini when the voltage dropes below 3.3v...
I was hoping that the Pro Mini will continue to run when the voltage to it drops below 2 volts.
-
3.3v Pro Mini, Radio, Moisture Sensor and StepUp regulator - AA battery powerI will try all your suggestions.
Thanks much. -
3.3v Pro Mini, Radio, Moisture Sensor and StepUp regulator - AA battery powerHello,
The current draw from 2 AA batteries (in series) when running this configuration is 2ma when in sleep mode. In my view is way to high. At 2200 mah, I calculate only getting about 45 days of battery life (2200mah / 2ma / 24 hrs/day).
Are my calculations correct?
While sleeping, removing the radio does not change the load on the batteries (it remains at 2ma).
Removing the Power LED on the PRO Mini will only reduce the current draw to about 1ma, giving 90 days of battery life.
I have tried the gw.sleep mode and my own sleep mode and get the same results.
Not sure how people are getting current draws below 1ma...
Dieter
-
Waking up 3.3v Pro MiniThanks.
I do have another question on what happens when an interrupt occurs. In the below example sketch, what code gets executed when the interrupt occurs: Is it at the interrupt handler "wakeUP()", or is it after the "detachInterrupt(1); ??
Typically when the interrupt happens, the interrupt handler code gets executed, and then it goes back to whatever code it was running when the interrupt happened.
Since, in this case, the interrupt handler does nothing, will it then execute the line after the "detachInterrupt(1);" ?
#include "LowPower.h";
void wakeUp(){
}
void setup() {
pinMode(3, INPUT_PULLUP);Serial.begin(115200);
delay(1000);
}void loop() {
Serial.println("Sleep Mode Entered");
delay(500);
attachInterrupt(1, wakeUp, CHANGE);
LowPower.powerDown(SLEEP_FOREVER, ADC_OFF, BOD_OFF);
detachInterrupt(1);Serial.println(F("woke up"));
delay(500);}
-
Waking up 3.3v Pro MiniHello,
Other than using an interrupt on a pin level change (ie: D2), what are the ways to wake up a 3.3v Pro Mini from "sleeping"?Or are using interrupts the only way?
I would like to put the Pro Mini to sleep for 12 hours, then wake it up to transmit data, and put it back to sleep...
Thanks.
-
Connecting NRF24L01+ to Arduino ProMiniThanks much, I got it working. Changed the sketch to use Pins 9 & 10...
It works without IRQ. I think this Pin can be used to wake up the Arduino... My project does not require that.
Onward to test the distance I'm getting between the radios.
Thanks again.
Dieter
-
Connecting NRF24L01+ to Arduino ProMiniHello,
The documentation of the NRF24L01+ calls for pins CE to be connected to Pin 9 of the Pro Mini, and SCK to Pin 13 of the Pro Mini, and IRQ to Pin 2.Yet the simple transmit/receive sketches in the RF24 library calls for CE to be connected to Pin 7 of the Pro Mini, and CSN to Pin 8 of the Pro Mini. IRQ is not used.
Also, IRQ in the sketch is NOT used, whereas IRQ is connected to Pin 2 of the Pro Mini in the NRF2L01+ documentation.
I trying to get the simple sketch working. Should I go with the documentation in the Sketch code?
Is the another sketch with uses the Pins as shown in the NRF24L01+ documentation?
Thanks.
-
FTDI moduleProblem Solved! When compiling, you must select Processor: ATmega 328 (3.3v, 8Mhz). Then the Serial Monitor will be fine at 9600 baud with the 3.3v Pro Mini.
-
FTDI moduleSpeed is set to 9600baud in the Sketch. I have hooked up everything per your original reply. Using 3.3v Pro Mini, and jumper is set to 3.3v on ftdi board. Power is being supplied from USB.
Still getting garbled data on the Arduino IDE Serial Monitor. If I change the SERIAL Monitor to 4800 baud, I CAN read everything!!
However, if I leave the Sketch to 9600 baud and change the Arduinio Pro Mini to a 5v unit, and just chang the FTDI to the 5v strapping, everything is readable with the Serial Monitor set to 9600 baud.
I don't get it.
-
FTDI moduleSo maybe this is why my sketch is probably not working on a 3.3v Pro Mini being powered from the FTDI.
I'm running the ReadAnalogVoltage sketch in the Arduino Basic Examples. It runs fine on a 5v Pro Mini being powered from the FTDI, outputting the read voltage to the Serial Monitor just fine.
However, on a 3.3v Pro Mini being powered from the FTDI, the sketch runs but the serial monitor displays gibberish...
Not enough power going back to the USB from the FTDI?
-
FTDI moduleHello,
I purchased an AliExpress FTDI FT232RL USB to TTL Serial Converter Adapter Module. It has a jumper for either 5v or 3.3v operantion. It has FTD1232 marked on the back side.
It will be hooked up to program a 3.3v Arduino Pro Mini.
In the 3.3v position, any thoughts on whether I can connect a USB port from my laptop? And will it power the Pro Mini in that position?
Or do you think I need to provide the 3.3v from the Pro Mini?
I'm thinking that power from Either the 3.3v Pro Mini or USB will work with the jumper in the 3.3v position.
Thanks.
-
Moisture Sensor example sketch@mfalkvidd
So in the build example, should the DO pin of the sensor be hooked to D2 of the Arduino? -
Moisture Sensor example sketchHas MySensors 2 been released? Where can I find it and its documentation?
-
Moisture Sensor example sketchAlso, since this sketch does not use the Interrputs() and noInterrupts() funtions, does the library take care of handling the interrupt while sleeping? I guess interrupt handling is a bit confusing to me.