Basic Serial Comms With Inexpensive 315 Mhz Transmitter and Receiver Modules

I want to establish simple wireless communications between a Leonardo board and PC. I'm keeping things basic initially and using simplex, i.e. one way communication. The sketch running on the Arduino is a basic command interpreter which I have written to understand commands such as dout 9 1 (set digital output 9 high). I have an accompanying GUI terminal program written in VB which allows me to click on buttons on screen to set inputs high and low. Alternatively I can type commands in a text window which are transmitted to the Arduino. Everything works fine over a USB serial link. For my experiments I am using an inexpensive transmitter and receiver pair - a 315 Mhz wireless transmitter at the PC end and a corresponding 315 Mhz receiver module at the receiver end. See link:

These work fine when used for controlling a servo because a continuous PWM signal is transmitted and received. However when no data is being transmitted, the data output of the receiver changes randomly resulting in random characters being read from the serial port. When I transmit a command multiple times (> 3 times), it sort of works. Presumably I would have to implement data packeting and adding a checksum or use a CRC system for error checking so that the validity of received data can be checked. This would mean that at least a half duplex link would be needed so that the receiver could acknowledge/not acknowledge receipt of data. What libraries are available to do this or would it be better to go down the road of using XBee modules for comms?

Try the VirtualWire library.

http://www.pjrc.com/teensy/td_libs_VirtualWire.html

"Very low cost RF modules require specially formatted data, with sync patterns, equal balance of 0 and 1 bits, and error checking. VirtualWire provides all of these features, allowing for best performance from very cheap radio circuits."

johnwasser:
Try the VirtualWire library.

VirtualWire Library, for very cheap wireless communication

"Very low cost RF modules require specially formatted data, with sync patterns, equal balance of 0 and 1 bits, and error checking. VirtualWire provides all of these features, allowing for best performance from very cheap radio circuits."

Thanks I had a look at that and will try it out. This library only allows comms though between two Arduino boards. If I am transmitting/receiving from a serial port/ USB to serial adapter on a PC, what are my options? Am I going to have to convert the library to VB (or maybe someone has done this already?!)