Skip to content
Parallax Learn

Parallax Learn

  • Welcome
  • Tutorials
        • Tutorial Series head tag

          Tutorial Series
        • Tutorial Series

          The special, classroom-ready series pages are organized collections of tutorials for our most popular hardware and/or languages. The tutorials for each topic are conveniently accessible from a single page, shown in the order it is recommended that they be completed.
        • Robotics Series Head tag

          Robotics Series
        • Robotics Series

          • Artificial Intelligence
          • Cybersecurity: Radio Data tutorialCybersecurity
          • cyber:bot + Python
          • cyber:bot + MakeCode
          • Boe-Bot Tutorial SeriesBoe-Bot
          • Arduino Shield-Bot
          • ActivityBot with C TutorialsActivityBot + C
          • ActivityBot with BlocklyProp Tutorial SeriesActivityBot + BlocklyProp
          • Scribbler 3 Tutorial SeriesScribbler 3
        • Electronics & Programming Series Head tag

          Electronics & Programming Series
          • BS2 Board of Education Tutorial SeriesBS2 Board of Education
          • Propeller C-Language BasicsPropeller C Basics
          • FLiP Try-It Kit C Tutorial SeriesFLiP Try-It Kit + C
          • FLiP Try-It Kit BlocklyProp TutorialsFLiP Try-It Kit + BlocklyProp
          • Badge WX Tutorial SeriesBadge WX
          • Propeller BlocklyProp Basics and ProjectsPropeller BlocklyProp Basics
          • View All Tutorial Series »
        • Browse Tutorials
        • Browse Tutorials

          Individual tutorials sorted by robot or kit, and language.
        • By Robot or Kit
          • ActivityBot
          • SumoBot WX
          • Boe-Bot
          • Shield-Bot
          • cyber:bot
          • Badge WX
          • ELEV-8
          • ARLO
        • By Language
        • By Language

          • Propeller C
          • Arduino
          • BlocklyProp
          • PBASIC
          • Python
          • MakeCode
          • View All Tutorials »
  • Educators
  • Reference
  • Downloads
  • Home
  • All Courses

A Wireless Musical Keyboard Project

Curriculum

  • 1 Section
  • 2 Lessons
  • Lifetime
Expand all sectionsCollapse all sections
  • A Wireless Musical Keyboard Project
    2
    • 1.0
      What is RF?
    • 1.1
      How the Keyboard Works

What is RF?

What is RF?

Some of the most exciting BASIC Stamp applications can be accomplished with Radio Frequency (RF) transmitters and receivers.  The best part is that RF communication is all around!  Every time you listen to the radio, use a cell phone, or watch television, RF transceivers are at work.  RF communication uses radio waves instead of wires for exchanging signals, which is where the name “wireless communication” comes from.  RF modules use frequencies (measured in Hz) to distinguish different radio signals, so in order for RF modules to “talk”, they must be operating on the same frequency.  This activity uses the 433 MHz Parallax RF Transceiver modules.  The modules have a transmitter that sends signals using radio waves that oscillate at 433 MHz, and a receiver that is tuned to the 433 MHz frequency, so a pair can communicate with each other.

Inside Wired Serial Communication

Since RF modules replace the wires that devices would otherwise need to exchange information, let’s first take a look at how BASIC Stamp modules would exchange information if they were connected by wires.  BASIC Stamp modules (and a myriad of other digital devices) exchange information using serial communication. For example, a BASIC Stamp sending the character “E” to another BASIC Stamp could use the command SEROUT TxPin, 16470, [“E”]. You can look up the SEROUT command in the BASIC Stamp Manual or the BASIC Stamp Editor’s Help feature. One of the thing’s you’ll find is a table that tells you when the SEROUT command’s baudmode argument is set to 16470, it means that 8-bit data is sent inverted at a baud rate of 2400 bits/second.

Figure 1 shows an example of this exchange. Since the baud rate is 2400 bits/second, each high/low signal has to last for 1/2400 of a second. Inverted means that every binary 1 is transmitted as a 0, and vice-versa, and 8-bit means that each message has a byte’s worth of information (8 bits).

Figure 1 – Serial Transmission Between Two Connected BASIC Stamp Modules

The ASCII value for the character “E” is 69, which is %01000101 in binary.  So why does it appear that the data is transmitted as %101011101? 

The answer is for two reasons.  First, the SEROUT command is sending ‘inverted’ data, and second, serial communication always sends its values least significant bit (LSB) first.

  • ‘Inverted’ changes all the 1 bits to 0, and all the 0 bits to 1.  In the case of our ASCII value, it transforms %01000101 to %10111010.
  • ‘LSB first’ sends the rightmost digit first, followed by the second digit from the right, and so on.  That’s why the diagram shows all the digits backwards, as %01011101.

A serial message also has a start and stop bit, shown below in Figure 2.  At a baud rate of 2400 bits-per-second (inverted), the start bit is a high signal that lasts 1/2400 of a second, and it signals that 8 more 1/2400 of a second bits are on their way.  The stop bit is the minimum time before the transmitter is allowed to send another byte.  The BASIC Stamp uses 1 stop bit, which at 2400 bits/second means that the transmitter has to wait at least 1/2400 of a second before sending the next byte.

Figure 2 – How Data is Transmitted Serially

Inside Wireless Serial Communication

So we’ve covered transmitting serial data when two BASIC Stamp modules are connected.  What if we want them to transmit the data wirelessly, like we will in the following activity?  Does the theory change completely? Not at all. In fact, you can simply replace the wire with an RF transmitter and receiver, and the two BASIC Stamp modules can still exchange data as though they were using a wire.  Figure 3 shows how this works.  The only difference is that the transmitter gets data from the BASIC Stamp and sends it out through an antenna and into the air via radio waves, and the receiver module demodulates the radio signals back to wired serial signals and transmits them to the receiving BASIC Stamp.

Figure 3 – How Data is Transmitted Wirelessly

 

Schematics and Building the Circuits

  • Build the two circuits as shown below,  using one BASIC Stamp HomeWork Board (or Board of Education) per circuit.

Figure 4 – RF Transmitter Board Schematic

Figure 5 – RF Receiver Board Schematic


Printer-friendly version
How the Keyboard Works
Next

DISCUSSION FORUMS | PARALLAX INC. STORE

About | Terms of Use | Feedback: learn@parallax.com | Copyright©Parallax Inc. 2024

© 2026 Parallax Learn • Built with GeneratePress