1
\$\begingroup\$

TL;DR: How to avoid an ATtiny to run constantly when the radio receiver is receiving nothing, and possibly enter in deep sleep mode? Configuration:


Context: I have now a working transmitter design based on an ATtiny45, a push button, a superheterodyne radio transmitter, and batteries. By using "pin change interrupts", I can make the ATtiny "deep sleep" until the button is pushed. When this happens, the ATtiny awakens and a few bytes are sent via radio with Manchester coding (using this Manchester library). Because of the deep sleep, the consumption is ~ 0.2 uA when nothing happens. So the batteries could theoritically last for years!


Now I'm designing the receiver part, with a code like this:

#include "Manchester.h"

void setup() {
    pinMode(3, INPUT);
    man.setupReceive(3, MAN_1200);
    man.beginReceive();
}

void loop()
{
    if (man.receiveComplete()) 
    {
        uint8_t m = man.getMessage();
        man.beginReceive();
        if (m == 222)
        { 
            // do something
        }
    }
}

In order to reduce the power consumption, I was thinking about deep sleep and pin change interrupts too, but I don't think it will work here because a radio receiver will have very often noise like 0100010010111010010 until a real byte, Manchester-encoded, arrives...

Question: are there tricks to make a radio receiver code which uses very few power (and possibly sleep until a byte arrives)?

\$\endgroup\$
  • \$\begingroup\$ A superhet receiver won't invent signal to the same degree but you still have the problem of power drawn by the receiver itself. Radio links that don't have one end mains powered typically need careful efforts to establish a schedule of check-in appointments and suffer a latency in that a message may not be able to be sent until the next scheduled opportunity. \$\endgroup\$ – Chris Stratton Dec 8 '19 at 17:42
  • \$\begingroup\$ I hope you're turning off the whole transmitter circuitry while your transmitting microcontroller sleeps. \$\endgroup\$ – Marcus Müller Dec 8 '19 at 18:07
  • \$\begingroup\$ I'll check this @MarcusMüller but IIRC the current was below 1 uA while sleeping (transmitter side). \$\endgroup\$ – Basj Dec 8 '19 at 18:20
  • \$\begingroup\$ if that 1 µA includes the transmitter and not just the microcontroller, you definitely did. \$\endgroup\$ – Marcus Müller Dec 8 '19 at 18:38
  • \$\begingroup\$ Here are interesting linked discussions: forum.arduino.cc/index.php?topic=198020.msg2070578#msg2070578, forum.arduino.cc/index.php?topic=382708.0 \$\endgroup\$ – Basj Dec 8 '19 at 19:58
4
\$\begingroup\$

A superhet receiver won't invent signal to the same degree but you still have the problem of power drawn by the receiver itself. Radio links that don't have one end mains powered typically need careful efforts to establish a schedule of check-in appointments and suffer a latency in that a message may not be able to be sent until the next scheduled opportunity.

This is not a problem which has a general solution, rather only a variety of ways the task can be reduced to something that is solvable, such as mains power, time schedules, or ranges short enough for passive receivers to work.

\$\endgroup\$
  • \$\begingroup\$ Thank you for your answer. What could be potential solutions worth trying? \$\endgroup\$ – Basj Dec 8 '19 at 19:34
  • \$\begingroup\$ Sorry, but this is really "too broad" to belong here - as explained, there is no solution unless or until you find a way to restrict the problem to one which is easier. Normally in such a case I would only comment but in a now deleted comment you asked for that comment to be restated as an answer. \$\endgroup\$ – Chris Stratton Dec 8 '19 at 19:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.