HT12E / HT12D RF433 not fast enough, for a simple led flasher?

Thread Starter

Laszlo Szabo 1

Joined Feb 27, 2017
28
Hi there. I've put together a test circuit that's mostly working, but not quite perfect.
The LED I use to test the RX (receiver) isn't flashing three times as it should, sometimes it's just once or twice. (Meanwhile, the main TX (transmitter) LED is flashing correctly, three times as programmed.)
My goal was to create a synchronized 3x LED flasher system where the sender unit flashes its LED three times, then when it's off, the receiver LED flashes three times. To achieve this, I'm using an ATtiny85 microcontroller. I've included a quick sketch for reference. (Don't worry about the transistor components, they're there because ultimately, I won't be driving LEDs with them.)
So, the LINK LED indicates that there's transmission happening, but it seems like the process isn't happening fast enough.

I initially tested without the ATtiny, just using a switch to signal the HT12E. When I pressed the switch slowly, everything worked fine. However, when I tried to speed up the pushing (to around 3Hz), the RX module LED didn't flash as many times as I pressed the button, which was also the case with the microcontroller.
I don't believe the issue is due to slowness, but it appears that way.

Any idea why is that? What can be wrong? I have some more ideas to do all this a different way, but it should work this way too.
Please share your ideas. Thank you.
 

Attachments

Last edited by a moderator:

Thread Starter

Laszlo Szabo 1

Joined Feb 27, 2017
28
As you see in my attachment, I used 1m and 51K for TX and RX and yes, it works well, as LINK LED shows, the LINK is stable.
As I mentioned, it looks like "slow". I am really not getting it. Flashes with slow speed are OK.
 

DickCappels

Joined Aug 21, 2008
10,236
(Some text removed for clarity)
As I mentioned, it looks like "slow". I am really not getting it. Flashes with slow speed are OK.
You might be sending commands faster than your system can handle them.

What is your intended flash rate and what is the RF datalink’s data rate (how much data is in a command)?
 

Thread Starter

Laszlo Szabo 1

Joined Feb 27, 2017
28
You might be sending commands faster than your system can handle them.

What is your intended flash rate and what is the RF datalink’s data rate (how much data is in a command)?
Well, 3 times flash under around a second is fast for a circuit that is used to control more complex and faster applications? I am not an electrical engineer even far away from a real hobbyist, but I was looking around and I thought this circuit could handle 3x flash transmission easily.

Regarding the "RF datalink..." don't know. I used the resistors to setup the TX and RX modules, and write this simple code for the ATtiny.
The HT12E pin10 receives the flash HIGH signal well, I have checked with an LED. However, I am not able to check the signal output pin. Only test was that I have described already "button test"

Simple 3 times double flasher code:
#define t   80
#define LED_PIN 0,1

void setup() {
pinMode(0, OUTPUT);
pinMode(1, OUTPUT);

}
void loop() {
    digitalWrite(0, HIGH);
    delay(t);
    digitalWrite(0, LOW);
    delay(t);
    digitalWrite(0, HIGH);
    delay(t);
    digitalWrite(0, LOW);
    delay(t);
    digitalWrite(0, HIGH);
    delay(t);
    digitalWrite(0, LOW);
    delay(250);

    digitalWrite(1, HIGH);
    delay(t);
    digitalWrite(1, LOW);
    delay(t);
    digitalWrite(1, HIGH);
    delay(t);
    digitalWrite(1, LOW);
    delay(t);
    digitalWrite(1, HIGH);
    delay(t);
    digitalWrite(1, LOW);
    delay(250);
}
 

BobTPH

Joined Jun 5, 2013
9,182
The speed may well on transmitter power and environmental noise.

What voltage are you using for the transmitter? I found that 5V barely worked at all and 9V was far better.
 

Thread Starter

Laszlo Szabo 1

Joined Feb 27, 2017
28
The speed may well on transmitter power and environmental noise.

What voltage are you using for the transmitter? I found that 5V barely worked at all and 9V was far better.
I use it exactly as the circuit shows. 9V battery for the transmitter and 9V battery (with voltage regulation) on the receiver. To be honest, I cannot see anything that is "wrong" with the setup, simple just the transmission is strange. Maybe needs more testing, as this button test only shows, that it works well if pressing the button is slow. It would be good for a remote switch :D but I need more from this.
 

Thread Starter

Laszlo Szabo 1

Joined Feb 27, 2017
28
Have you tried increasing the baud rate?
I didn't read about it, don't know anything about the baud rate or its modification. How should I do it? Would it help in the current situation? I think it is worth trying. :D Antying that can help. Because this is unacceptable from this circuit. :D
 

BobTPH

Joined Jun 5, 2013
9,182
I didn't read about it, don't know anything about the baud rate or its modification. How should I do it? Would it help in the current situation? I think it is worth trying. :D Antying that can help. Because this is unacceptable from this circuit. :D
What does the datasheet say about the baud rate and resistor selection?

The encoder is probably sending about 16 bits for each data packet. To do 3 per second, that would only be 48 bps, though you would want at least 10 times that to get reasonable time resolution. The project Idid with this type of modules used 1K baud.

I don’t suppose you have a scope or logic analyzer? Either would be very useful for diagnosing this.
 
Last edited:

Thread Starter

Laszlo Szabo 1

Joined Feb 27, 2017
28
What does the datasheet say about the baud rate and resistor selection?

The encoder is probably sending about 16 bits for each data packet. To do 3 per second, that would only be 48 bps, though you would want at least 10 times that to get reasonable time resolution. The project Idid with this type of modules used 1K baud.

I don’t suppose you have a scope or logic analyzer? Either would be very useful for diagnosing this.
I cannot see any word about baud rate in the datasheet. I have checked again. It says only Oscillator Frequency 1.1Mohm around 3Khz.
No, I don't have those. I wanted to get a multimeter-style scope already, but well, I am too poor for that, I guess :D
Maybe it is worth trying out with 750Kohm / 33Kohm resistors, as I see other guys doing. Lots of circuits are available on google and many videos on YT. However, nowhere I have seen anything about the baud rate.
 

Thread Starter

Laszlo Szabo 1

Joined Feb 27, 2017
28
It worked! I have changed the 1Mohm to 750 and the 51Kohm to 33Kohm resistors and now the signal has been transmitted well!
The only issue is the distance which is a maximum of 50cm. But, I suppose I can use an antenna (some wire) to extend it!
Thank all the ideas anyway!
 

DickCappels

Joined Aug 21, 2008
10,236
You can cut down on the bandwidth required from the link if instead of sending three commands you just send a "do it" command and let the receiving end figure out that it means to flash the LED three times.
 

Thread Starter

Laszlo Szabo 1

Joined Feb 27, 2017
28
You can cut down on the bandwidth required from the link if instead of sending three commands you just send a "do it" command and let the receiving end figure out that it means to flash the LED three times.
That's what I was figuring out myself too, but already moved on to Arduino and nRF24L01 for a more sophisticated solution. Thank you for your idea.
 
Top