[Logo] Anarduino and HopeRF Community Forum
  [Search] Search   [Recent Topics] Recent Topics   [Hottest Topics] Hottest Topics     [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Messages posted by: svorres
Forum Index » Profile for svorres » Messages posted by svorres
Author Message
Hi d00m,

1. Yes the Anarduino, the CPU and the radio should both be kept below 3.5Volts Max. So either us a regulator or don't use a LiPo battery.

2. The Sleep state is what the Arduino normally runs in until it gets an Interrupt, then it wakes runs a routine and goes back to Low Power Sleep.


3. To measure current Insert a 10 ohm resistor in series with your Anarduino. Supply it with a 3.5 V supply.

Measure the voltage drop across the resistor with a good quality meter. So 10mV drop = 1 mA, a 100uV drop = 10uA, and a 10uV drop = 1uA,

Don't worry much about less than 10uA drains, as your batteries i.e Lithium AA L91 will last a long time.
If you take a look at the MiniWireless published schematic you will find the the only free pin on the Digital Side are Pins 6, 7, 8

Pin 9 is the LED

all others are occupied by other services ( MISO, Interrupts etc ) and not recommended for beginners to mulit task.

The Analog PIns are only Labeled as Analog, they are indeed usable as Input or Output pins, I believe A0-A7 are free for you to use as Digital In or Output

I get 16 ua reliably after I bypass the regulator and run this setup code

*/


#include <SPI.h>
#include <EEPROM.h>
#include <RHDatagram.h>
#include <RH_RF95.h>
#include <Time.h>
#include <MCP7940RTC.h>
#include <LowPower.h> //get library from: https://github.com/lowpowerlab/lowpower
//writeup here: http://www.rocketscream.com/blog/2011/07/04/lightweight-low-power-arduino-library/
#include <Wire.h>

//Radio settings
#define POWER_LEVEL 22 // can vary from 5 to 23, 5 is the lowest.
#define FREQUENCY 913 // Default Transmission frequency, can be changed by EEPROM value
#define TIMEOUT 3000 // transmit timeout until ack is received
#define RETRANSMIT_DELAY 60 // Will retransmit an alarm after this number of seconds.
#define RETRANSMIT_TIMES 1 // How many times to retransmit
#define RETRIES 4 // how many initial retries are used
#define ATTEMPTS_TO_TRY 10 //This times radio setting of timeouts gives number of attempts before giving up

#define EI_NOTEXTERNAL
#define EI_ARDUINO_INTERRUPTED_PIN
#include <EnableInterrupt.h>

volatile uint8_t externalInterruptFlag=0;
volatile uint8_t pinChangeInterruptFlag=0;
volatile uint8_t pinState=0;

#ifdef ARDUINO_328
#define PINCOUNT(x) pin ##x ##Count

void interruptFunction () {
pinChangeInterruptFlag=arduinoInterruptedPin;
pinState=arduinoPinState;
}

void interruptExFunction () {
externalInterruptFlag=arduinoInterruptedPin;
pinState=arduinoPinState;
}

#define disablePCInterrupt(x) \
disableInterrupt( x | PINCHANGEINTERRUPT)

#define setupPCInterrupt(x) \
EI_printPSTR("Add PinChange pin: "); \
EI_printPSTR(#x); \
EI_printPSTR("\r\n"); \
pinMode( x, INPUT_PULLUP); \
enableInterrupt( x | PINCHANGEINTERRUPT, interruptFunction, CHANGE)

#define setupInterrupt(x) \
EI_printPSTR("Add pin: "); \
EI_printPSTR(#x); \
EI_printPSTR("\r\n"); \
pinMode( x, INPUT_PULLUP); \
enableInterrupt( x, interruptFunction, CHANGE)

#define setupExInterrupt(x) \
EI_printPSTR("Add External pin: "); \
EI_printPSTR(#x); \
EI_printPSTR("\r\n"); \
pinMode( x, INPUT_PULLUP); \
enableInterrupt( x , interruptExFunction, CHANGE)
#else
#error This sketch supports 328-based Arduinos only.
#endif

uint8_t client = 101; // we will change this with eeprom sn

RH_RF95 radio;
// Class to manage message delivery and receipt, using the driver declared above
RHDatagram manager(radio, client);

#define LED_BUILTIN 9 // mini-wireless board LED pin #
#define LED_ON digitalWrite(LED_BUILTIN,1)
#define LED_OFF digitalWrite(LED_BUILTIN,0)


I use the RFM95 Anarduino Mini Wireless with lots of success:

I modify them by cutting out the Voltage regulator, and shorting pin Vin to 3.3V , there by by passing the regualtor and its losses and drop out voltage.

I run the devices from 2 L91 AA Lithium batteries for years.

Here is the setup code to get your current consumption down to 16 ua


*/


#include <SPI.h>
#include <EEPROM.h>
#include <RHDatagram.h>
#include <RH_RF95.h>
#include <Time.h>
#include <MCP7940RTC.h>
#include <LowPower.h> //get library from: https://github.com/lowpowerlab/lowpower
//writeup here: http://www.rocketscream.com/blog/2011/07/04/lightweight-low-power-arduino-library/
#include <Wire.h>

//Radio settings
#define POWER_LEVEL 22 // can vary from 5 to 23, 5 is the lowest.
#define FREQUENCY 913 // Default Transmission frequency, can be changed by EEPROM value
#define TIMEOUT 3000 // transmit timeout until ack is received
#define RETRANSMIT_DELAY 60 // Will retransmit an alarm after this number of seconds.
#define RETRANSMIT_TIMES 1 // How many times to retransmit
#define RETRIES 4 // how many initial retries are used
#define ATTEMPTS_TO_TRY 10 //This times radio setting of timeouts gives number of attempts before giving up

#define EI_NOTEXTERNAL
#define EI_ARDUINO_INTERRUPTED_PIN
#include <EnableInterrupt.h>

volatile uint8_t externalInterruptFlag=0;
volatile uint8_t pinChangeInterruptFlag=0;
volatile uint8_t pinState=0;

#ifdef ARDUINO_328
#define PINCOUNT(x) pin ##x ##Count

void interruptFunction () {
pinChangeInterruptFlag=arduinoInterruptedPin;
pinState=arduinoPinState;
}

void interruptExFunction () {
externalInterruptFlag=arduinoInterruptedPin;
pinState=arduinoPinState;
}

#define disablePCInterrupt(x) \
disableInterrupt( x | PINCHANGEINTERRUPT)

#define setupPCInterrupt(x) \
EI_printPSTR("Add PinChange pin: "); \
EI_printPSTR(#x); \
EI_printPSTR("\r\n"); \
pinMode( x, INPUT_PULLUP); \
enableInterrupt( x | PINCHANGEINTERRUPT, interruptFunction, CHANGE)

#define setupInterrupt(x) \
EI_printPSTR("Add pin: "); \
EI_printPSTR(#x); \
EI_printPSTR("\r\n"); \
pinMode( x, INPUT_PULLUP); \
enableInterrupt( x, interruptFunction, CHANGE)

#define setupExInterrupt(x) \
EI_printPSTR("Add External pin: "); \
EI_printPSTR(#x); \
EI_printPSTR("\r\n"); \
pinMode( x, INPUT_PULLUP); \
enableInterrupt( x , interruptExFunction, CHANGE)
#else
#error This sketch supports 328-based Arduinos only.
#endif

uint8_t client = 101; // we will change this with eeprom sn

RH_RF95 radio;
// Class to manage message delivery and receipt, using the driver declared above
RHDatagram manager(radio, client);

#define LED_BUILTIN 9 // mini-wireless board LED pin #
#define LED_ON digitalWrite(LED_BUILTIN,1)
#define LED_OFF digitalWrite(LED_BUILTIN,0)

//if we want to use a longer serial number this can be changed
#define SN_LENGTH 3
#define FULL_SN_LENGTH 7
#define FREQ_LENGTH 6
#define FULL_EEPROM_LEN 13
char serialNumber[4]; // this one gets transmitted
float frequency = 913.00; //this will get changed by value in eeprom
 
Forum Index » Profile for svorres » Messages posted by svorres
Go to:   
Powered by JForum 2.1.9 © JForum Team