Here’s a quick post for you home automatuers. Screw protocol stacks with their complex encryption, hand-shaking, UID long addresses, IP addresses, MAC addresses, complex Moore state-machines, SYN-ACK-NACK-Crap! What you want is unadulterated, untampered, raw speeds deep into the hundreds, if not thousands of baud!(lawl) Your solution is here at only $5.95! That’s plenty enough !exclamation! for one sitting.

http://www.sparkfun.com/commerce/product_info.php?products_id=8945

This guy accepts TTL level RS232 and ships it out over the air at a blazing 4800 baud. All this board requires is 5v, GND, and TTL signal. No antenna. This board is only the transmitter.

http://www.sparkfun.com/commerce/product_info.php?products_id=8947

Next up, we have the receiver board with the same pin requirements except its signal pin pumps out whatever it finds on the 315Mhz spectrum that remotely resembles UART Asynchronous Serial.

Easy enough, now how do we talk to it? I can think of two ways. One of these ways also has three separate ways. Thatsa lotta ways!
1.) Attach the transmitter to a computer.

1a.) Using the Max232 chip to convert 12v RS232 to TTL RS232 you can talk directly to the transceiver. (Contact me for help)
1b.) Using the FTDI FT2232 chip, open up a USB-Serial bridge via free drivers from FTDI, and the output will be TTL RS232. (Don’t contact me for help)
1c.) Build a simple voltage divider or BJT switcher circuit to drive the 5v output.(Eh.)

2.) Implement your very own stack!

What you’ll need: A PIC (’cause Arduino’s are dumb, JK Joe), ICSP programmer, MPLAB, electronic essentials.
We are going to employ the power of the MCC18 libraries that come with MPLAB C18. Or you could use the HTC libs as I did below.

/*
This is the transmitter code, 2400 baud, RB3 input
*/
#include <htc.h>
#include <stdio.h>
#include “usart.h”
__CONFIG(INT & WDTDIS & PWRTDIS & BORDIS & LVPEN & UNPROTECT);
void putch(unsigned char byte)  //place the function before main so you don’t need function prototypes!
{
while(!TXIF)    //check for the TX buffer to be cleared flushed!
continue;
TXREG = byte;  //shove the data into the buffer, and the PIC will automatically flush!
}
int main(void)
{
unsigned char TRNSval;
init_comms();
int x=0;
TRISB3=1; //set direction of trigger pin

while(1)
{     if(RB3==1) //if the trigger is set, fire 100 O’s
{
for(x=0;x<100;x++)  //do this 100 times because the fidelity of FM is low.
{putchar(‘O’);} }
if(RB3==0)
{
for(x=0;x<100;x++) //if the trigger is cleared, fire 100 F’s
{putchar(‘F’);} }
}
return 0;  //make MPLAB happy!
}

This is the receiver code. because of infidelity of FM signal, a certain value of a particular signal must be received in succession to convince the receiving PIC that the message was fully intended

/*
This is the receiver code, 2400 baud, RB3 output on
50 sequential O’s causes ON condition on … etc.
*/
#include <htc.h>
#include <pic.h>
#include <stdio.h>
#include “usart.h”
__CONFIG(INT & WDTDIS & PWRTDIS & BORDIS & LVPEN  & UNPROTECT);
#define Led1 RB3
unsigned char getch() {
/* retrieve one byte */
while(!RCIF)    //check that the newest data is in the receive buffer
continue;
return RCREG;
}
void main(void)
{
unsigned char RCVed;
init_comms();
int CountOn=0;
int CountOff=0;
TRISB3=0;
Led1=0;
while(1)
{
RCVed=getch();
if (RCVed==’O')
{CountOn++;
if (CountOn==20) //if count reaches 20, perform the operation
{Led1=1;CountOn=0;CountOff=0;}}
if (RCVed==’F')
{CountOff++;
if (CountOff==20)  //if count reaches 20, perform the operation
{Led1=0;CountOff=0;CountOn=0;}}
}
}

So there you have it. Your very own simple wireless switch. It’s very primative, and not to excuse my stack but I became rather bored with these devices and never really finished creating a stack that was more solidly coded. Any questions!? Ask away!

2 Responses to “Cheap Wireless Communications!”

  • Does my mac adresse change if I upgrade my computer with some other hardware? For example change the graphic card?

  • Corey Webster:

    No, your MAC address is a Hexadecimal value that is stored in a particular place on your wired and wireless controller chip. Those MAC addresses, by law, stay with those particular chips forever. You can use software to “spoof” that address because the operating system, due to security reasons, reports it using the TCP/IP stack. This is done using the ARP protocol included with the TCP/IP stack.

Leave a Reply

Post Categories

Error: Please make sure the Twitter account is public.

  • Chuck was great. For some reason it entertains me. 7 months ago
  • You NEVER clean a loaded gun. 11 months ago
  • Which group is funnier, protesting Obama's Speech or a new Harry Potter film. Vote Now! 1 year ago
  • I am glad I didn't go to school where they censored freedom of speech. 1 year ago
  • Those who protested Obama's speech dropped out of High School or College... See I can make hasty generalizations too... 1 year ago
RoastedToast Adverts