Posts Tagged ‘how-to’

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!

The setup detailed in this guide: a wireless router and a PC with a network card and wireless card. This PC (PC One) will connect to the router via wireless. A network cable will then be connected between PC One and the next PC, PC Two. PC Two will get its internet through PC One.

Go to Control Panel > Network and Internet > Network Connections. PC One will have something similar to the screenshot below.

Right click on the wireless adapter. Now select Properties.

Under the Sharing tab, select the option: “Allow other network users to connection through this computer’s Internet connection”.

Now, select the wired network adapter. Right click, go to Properties. Under the default Networking tab, left click Internet Protocol Version 4 (TCP/IPv4). Now click Properties.

Select the button “Use the following IP address:”. Copy the numbers below into your window. Remember, this is PC One’s wired adapter. Click OK once you’re done.

Under PC Two, go to Control Panel > Network and Internet > Network Connections. Select the wired network adapter that you will be using to connect the cable between the two PCs to. Now, select the wired network adapter. Right click, go to Properties. Under the default Networking tab, left click Internet Protocol Version 4 (TCP/IPv4). Now click Properties. Copy these numbers into the window. Note that this is nearly identical to the previous step, except that the IP address for PC Two is 80.1.1.2, instead of 80.1.1.1. Click OK through all the windows, and you should be good to go. Just don’t forget to connect the network cable.

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