send 8bits using RF 434 Mhz module(with ht12d-ht12e)

These things are neat, cheaper and easy to work with but these modules have a problem.
Normally if you work with them using MCUs, they hardly work because a lot of background noise interferes with the signals.
And when you interface the module with ht12e-ht12d encoder-decoder pair, you can only send 4 bits at a time(that too cannot handle small delays between consecutive transmissions).
But now i present you the ability to send 8bits at a time!!!
Basically what you need to do is to attach an 8bit 74595 shift register with the ht12d decoder(attach d8-12 latch, d9-11 clock, d10-14 data for ht12d-74595 chips). also make sure you attach correct pins on ht12e encoder(d8 for latch,d9 for clock, d10 for data).
Since there is 1 bit left, you can use this bit to send a signal indicating wether input is ready or not, or program it to tell the interfacing MCU(one on receiver side) to start reading or not.
i have given 5V inputs to all chips and the module with a 500k resistor on transmitter and 27k resistor on receiver.
Also here is the Arduino Codehttps://docs.google.com/document/d/1HeEXt1swMchCuPue-oUmYe1PPGxue6Ot_OQGrhajS3Y/edit?pli=1 and the hex file for ATmega168P/ATmega328Phttps://docs.google.com/file/d/0BydfW1W9I7J2VUwtYThTNVJaNkU/edit?pli=1.
I’ve shorted the TE(star transmission) pin on the encoder chip to ground so that it keeps sending data(The TE pin is ‘active low’).
This specific program runs a led train on the shift register outputs(q0-q7).just connect 8 leds to the outputs and you'll see.
if you have doubts on the connections or the module model, here is the modelhttp://probots.co.in/index.php?main_page=product_info&cPath=22&products_id=29.
One thing you’ll notice is the “transdelay” - this is done so that there is a delay between successive transmissions.
Don’t hesistate in changing the values of “transdelay”. But doing so will affect the range and of course - speed. If you make too less delay, it won’t work, if you make too large delay, the range will increase but speed decreases.
Also if you want a faster mode then you can churn up your encoder and decoder chips by selecting values of VCC, Rosc from the graphs in the datasheets. Basically you need to increase the clocks on both chips. Just remember that HT12Dosc=50*HT12Eosc(so that they stay in-sync) will give you best results. Here are the datasheets of HT12D andHT12E.

I find using the simple RF modules with the VirtualWire library to be pretty robust.

"I’ve shorted the TE(star transmission) pin on the encoder chip to ground so that it keeps sending data(The TE pin is ‘active low’)."
Not sure what is being referred to here.

You left off the links to HT12D andHT12E at the end.

Hey i was more like introducing the idea of attaching a shift register. also i had worked with the vw library but it gave me errors so i had to figure out another way(this was it). i am currently using arduino dueminalove with AT168p. scratched my brain with vw for 4 hours or so. thanks and btw google ht12e/ht12d and the [PDF]s that come up are the data sheets :).

I use VW in a 434 MHz RF Remote Control, has been in use for ~18-20 months now.
Press a button, remote wakes up, reads the button, sends a character out embedded in VW manchester encoding scheme, receiver gets the byte out & makes stuff happen. No need for external shift register.

    // go read the keypad
  char key = keypad.getKey();                 // reading the keypad
  if(key)                                     // same as if(key != NO_KEY)- did something change?
  {
    msg[0]=key;                               // load the array with the key character
    // msg[1]=NULL;                           // Rx side seems to work without this

    digitalWrite(ledPin, true);               // Flash a light to show transmitting

    vw_send((uint8_t *)msg, strlen(msg));     // send the character out

//    Serial.println(key);                // for debugging only

    vw_wait_tx();                             // Wait until the whole message is gone

    delay (50);                               // need some delay or seem to miss key presses

    digitalWrite(ledPin, false);              // turn off the flash of LED

Path to success for me was putting the keypress data in an array
msg[0]=key;
someone here helped me figure that out.
The other thing is deleting the
PTT inverted = true;
(or something like that) from the example - the Tx you selected does not have PTT. Mine is almost identical, just older.

thank you i gotta try this.

On the receive side, I get the byte and use switch:Case to decide what to do:

// look for wireless input or for unsolicited message from arduino2

uint8_t buf[VW_MAX_MESSAGE_LEN];
uint8_t buflen = VW_MAX_MESSAGE_LEN;

if (vw_get_message(buf, &buflen)) // Non-blocking
{
  int i;
  digitalWrite(ledPin, LOW); // Turn on LED to show working a message

  // Message with a good checksum received, dump it.
  //Serial.println("Got: ");  // Show on PC for debugging

  //    for (i = 0; i < buflen; i++)
  //    {
  //Serial.print(byte(buf[i]));
  //    }
  //Serial.println(""); // spaces it out for the monitor

  switch ( buf[0] ) 
  {    
  case '2':
:
:
    digitalWrite(ledPin, HIGH); // LED off
    break;  // end switch (buf[0]), case 2
:
:
}

my problem is that transmitter is working but on the receiver side the program keeps on going into the 'else part' of the 'if (vw_get_message(buf, &buflen))' i set the baud rates at 1200. this could mean that they both are not in sync. thats why i had decided to use the ht12d-ht12e.
i have attached a led at the rxpin(pin 11) and the one inside the 'if statement'. rx led glows perfectly and stays glowing(flickering) even when i switch the transmitter off :~.

Hard to say without seeing all of what you were running on both sides.
I started with just the sample code on both ends, take the PTT part out.
Then made the change for the message array.
Then added the keypress reading part.

You could try the same - get it simple to start, add from there.

so heres what i did- i ran the transmitter and receiver examples in the vw library and in the receiver code i forced the program to give output by using vw_have_message==false and then opened up the serial port to see some outputs here are some
Got: C1 0 1 0 B8 14 FF 0 5 C1 0 4 6 3D 2 3B 2 3B 0 C2 6 65 0 5 2 3B 7 15 0 C2
Got: C1 0 1 0 B8 14 FF 0 5 C1 0 4 6 3D 2 3B 2 2 70 1 F5 0 25 0 0 1 0 0 93 0
Got: C1 0 1 0 B8 14 FF 0 5 C1 0 4 6 2 70 0 77 0 25 DF 0 1 0 0 93 2 A1 20 A0 0
Got: C1 0 1 0 B8 14 FF 0 5 C1 0 4 6 2 70 2 70 1 F5 0 25 0 0 1 0 0 93 0 0 2
Got: C1 0 1 0 B8 14 FF 0 5 C1 0 4 6 2 70 2 70 2 70 0 77 0 25 DF 0 1 0 0 93 2
Got: C1 0 1 0 B8 14 FF 0 5 C1 0 4 6 2 70 2 70 2 70 1 F5 0 25 0 0 1 0 0 93 2
Got: C1 0 1 0 B8 14 FF 0 5 C1 0 2 70 1 F5 0 25 0 0 1 0 0 93 0 0 2 A0 0 0 9C
Got: C1 0 1 0 B8 14 FF 0 5 C1 0 2 70 1 F5 0 25 2 70 1 B3 0 25 DF 0 1 0 0 93 2
Got: C1 0 1 0 B8 14 FF 0 5 C1 0 2 70 1 F5 0 25 2 70 2 70 0 77 0 25 DF 0 0 25 DF
Got: C1 0 1 0 B8 14 FF 0 5 C1 0 2 70 0 77 0 25 DF 0 1 0 0 93 2 A1 20 A0 0 0 E7
Got: C1 0 1 0 B8 14 FF 0 5 C1 0 2 70 0 77 0 25 2 70 1 F5 0 25 0 0 1 0 0 93 0
these outputs don't repeat themselves but this part(C1 0 1 0 B8 14 FF 0 5 C1 0) is always there. i am sending "hello"
here is the changed part-
if (vw_have_message()==false) // Non-blocking
{
vw_get_message(buf,&buflen);
int i;

digitalWrite(13, true); // Flash a light to show received good message
// Message with a good checksum received, dump it.
Serial.print("Got: ");

for (i = 0; i < buflen; i++)
{
Serial.print(buf*, HEX);*

  • Serial.print(" ");*
  • }*
  • Serial.println("");*
  • digitalWrite(13, false);*
  • }*

someone please help me!
stuck with the Virtual Wire library. :disappointed_relieved:
really can't get it to work. =(
the transmitter side works perfectly but the receiver side is giving a lot of issues. :0
the above thread explains my situation.
m in dire need. delayed my project by 2 days(@#*).

What happens when you just run it normally?
I don't see any characters in there that correspond to "hello"

68 65 6c 6c 6f

You are using these pins?
digital IO pin to use for transmit data. Default is 12
digital IO pin to use for receive data. Default is 11

Transmit code

// A simplex (one-way) transmitter. Sends a short message every 400 ms. Test this with the receiver below.
#include <VirtualWire.h>
void setup()
{
vw_setup(2000); // Bits per sec
}
void loop()
{
const char *msg = "hello";
vw_send((uint8_t *)msg, strlen(msg));
delay(400);
}

Receive code

#include <VirtualWire.h>
void setup()
{
Serial.begin(9600);
Serial.println("setup");
vw_setup(2000); // Bits per sec
vw_rx_start(); // Start the receiver PLL running
}
void loop()
{
uint8_t buf[VW_MAX_MESSAGE_LEN];
uint8_t buflen = VW_MAX_MESSAGE_LEN;
if (vw_get_message(buf, &buflen)) // Non-blocking
{
int i;
// Message with a good checksum received, dump HEX
Serial.print("Got: ");
for (i = 0; i < buflen; i++)
{
Serial.print(buf[i], HEX);
Serial.print(" ");
}
Serial.println("");
}
}

I installed this code just like that on 2 promini's, one with Tx module, one with Rx. Worked just fine with both sitting on my laptop keyboard.
I then added 17cm antenna wire to both, separated them by the length of my house, still worked fine.

Get that simple part working as is, then you can start modifying.

extremely thanks you sir!!!!
finally got it.
its like 100 times faster than my method!!
Thanks again for all the help

Excellent.

@godSent can you please give a schematics of ur circuit??