You are on page 1of 4

KLP / KLPA Module Walkthrough

Spark Fun Electronics - Jeff Gray

Introduction
These laipac modules provide a simple, straight-forward transmitter/receiver pairs for all of your low-cost wireless pro ect needs! These integrated circuits range in datarates and electronic characteristics as outlined "elow!
Laipac Model TLP/RLP 434 TLP/RLP 434-A TLP/RLP 16-A TLP/RLP 16-F Spark Fun SKU RF-KLP RF-KLPA RF-KLP 16-A!K RF-KLP 16-F!K Frequency Range 315, 418, and 434 MHz 315, 418, and 434 MHz 15 MHz 15 MHz Data Rate 2,400 bps 4,800 bps 200,000 bps 40,000 bps Operating Voltage (Transmitter 2 - 12V 2 - 12V 2 - 12V 2 - 12V Operating Voltage (Recei!er 4.5 5.5 V 3.3 6V 2." 5 V 2." 5.5V

Pin Diagrams and Wiring Information


#long with this information, here are the pin diagrams for the transmitter and receiver units! #ll four models of receivers use the same pin configuration, "ut the T$% &'(-F transmitter is an odd man out, having e)tra pins to accommodate for its slightly larger "oard si*e!

These devices are simple pass-through integrated circuits! +eaning, you set up your "aud-rate ,as long as its within an accepta"le range of whatever pair of devices you are using-, and then start sending "ytes to the transmitter! .uite simply, it ust sends your data out the transmitter and the receiver gra"s it, acting as if you had a wired serial connection "etween them, minus the wire/ 0ased on these specifications, here1s some sample images and code to get you started, followed "y some things to consider while using these devices!

Three of the four transmitter modules have four pins, while the other has si)! The si)-legged version simply has redundant pins of power and ground, "ut otherwise remains the same! Starting from the top, %in ' goes to ground! %in 2 is the data input from the microcontroller of your choice! 3t transmits one "yte at a time, at the given "aud rate of the unit you1re using! %in 4 is the supply voltage, which will commonly "e 5 volts! 6e1ll e)plore other options later! Finally, %in 7 is the optional antenna we1ll look at later! The receiver modules all share common pin assignments, as follows ,from the top-! %in ' goes to ground! %in 2 sends the incoming "yte from the transmitter out to the microcontroller! %in 4 needs no connection, "ut can "e taken to ground! %ins 7 and 5 go to the receiver voltage! %ins ( and 8 go to ground, leaving %in 9 as the optional antenna pin! .uite simply, that1s all there is to it/

Sample Code
:n the following page, 31ve provided two different sets of transmitter and receiver code for the microcontrollers you may "e using in your pro ect! :ne set is provided in %ic 0asic %ro for the %3; microcontroller users, while the other is provided using the #rduino environment for #<= microcontrollers!

Pic Basic Pro


'********************************************* '* Simple Transmitter (2400 baud) '* For PIC18F452 '********************************************* !FI"! #SC 20 $ounter %ar b&te $ounter ' 0 #(TP(T P#)TC*+ main, ' 1+-80 is 2400 non.in%erted ' send out to transmitter S!)#(T2 P#)TC*+/1+-80/ 0$ounter1 $ounter ' $ounter 2 1 P3(S! 10 4oto main '********************************************* '* Simple )e$ei%er (2400 baud) '* For PIC18F452 '********************************************* !FI"! #SC 20 inb&te %ar b&te #(TP(T P#)TC*+ I"P(T P#)T *1 main, ' 1+-80 is 2400 non.in%erted ' )e$ei%e on Pin Port 1 S!)I"2 P#)T *1/1+-80/ 0inb&te1 ' debu4 to $omputer serial/ =ust to see it S!)#(T2 P#)TC*+/ 1+4+8/ 0inb&te1 ' $lear out inb&te* >ou see repeatin4 ?eros ' i8 &ou are losin4 si4nal inb&te ' 0 4oto main

Arduino 0004
5* * Simple Transmitter Code * T6is $ode simpl& $ounts up to 255 * o%er and o%er * (T7 out o8 3rduino is i4ital Pin 1) *5 b&te $ounter9 %oid setup(): 552400 baud 8or t6e 4;4 model Serial*be4in(2400)9 $ounter ' 09 < %oid loop(): 55send out to transmitter Serial*print($ounter)9 $ounter229 dela&(10)9 < 5* * Simple )e$ei%er Code * (T7 out o8 3rduino is i4ital Pin 1) * ()7 into 3rduino is i4ital Pin 0) *5 int in$omin4@&te ' 09 %oid setup(): 552400 baud 8or t6e 4;4 model Serial*be4in(2400)9 < %oid loop(): 55 read in %alues/ debu4 to $omputer i8 (Serial*a%ailable() A 0) : in$omin4@&te ' Serial*read()9 Serial*println(in$omin4@&te/ !C)9 < in$omin4@&te ' 09 <

Tips and Considerations

Signal Strength Transmitter !oltage and Antennas" 6hile the a"ove esta"lishes a wireless connection "etween two separate circuits, there are two considerations which will e)pand the range and efficiency of these two devices! First of all, each transmitter device has an supply voltage range of 2 > '2 volts! The higher the voltage, the stronger the signal strength! ;ommonly, your microcontroller and other circuitry may "e running at 5 volts, so you may need to route a separate line of power, either from a non-voltage resisted incoming voltage, or a separate power supply sharing a common ground! Since these devices take very little amperage, consider using a '2 volt power supply, and running voltage directly from it to the transmitter, while isolating the other circuitry1s voltage through a voltage regulator! #lso, the use of an optional antenna will increase the effectiveness of your wireless communication! # simple wire will do the trick, "ut Spark Fun Electronics also sells antennas specifically designed for this as well! E)periment with different antenna shapes and configurations "ased on the shape and make of your pro ect for "est results!

Different Suppl# !oltages for $ecei%ers #s the chart at the "eginning of this document shows, each receiver has different ranges for accepta"le voltage! This is handy for use with 4!4 volt microcontrollers and low power 3;s! ?eep in mind that the =$% 747 only has a range of 7!5 > 5!5 volts, making it the e)ception in this case! Counters for De&ugging 3 found, when e)periencing weird results with the pair, to implement a counter in my transmitter code as shown in the a"ove e)amples! The "enefit of this, is it gives you a pattern you can follow visually, whereas an analog input or a com"ination of "its may "e harder to trou"leshoot! Especially when tuning the lower @uality devices with a small screwdriver, its nice to "e a"le to see a pattern of num"ers scroll past in the serial window! :nce you have successfully tuned the units and e)amined the data flow and protocol you want to send from device to device, remove the de"ugging serial-to-computer commands and you1re ready to "uild up the code from there! (note: In most occasions, I
don't recommend tuning the devices, as they are generally tuned when shipped, but you may need to do so for one reason or another).

0est of luck in your wireless pro ect/

You might also like