Bluetooth: Send
Bluetooth: Send
Many electronic systems need to send information to other devices.
For example:
- Robots sending status updates
- Sensors reporting measurements
- Controllers sending commands
- Smart devices sharing information
- Phones communicating with electronics
One of the most common wireless technologies used for this purpose is Bluetooth.
The Bluetooth: Send category allows the D1 R32 to transmit information wirelessly to another Bluetooth device.
That information may include:
Text messages
Variables
Sensor measurements
Program states
Commands
Status information
Responses to received messages
Introduction
Imagine using a walkie-talkie.
You speak into one device.
The message travels wirelessly.
Someone else receives it.
Bluetooth communication works in a very similar way.
The D1 R32 creates information and sends it wirelessly to another device.
Conceptually:
D1 R32
↓
Bluetooth
↓
Phone / Tablet / Computer
Unlike Bluetooth Receive, which brings information into the D1 R32, Bluetooth Send allows information to leave the D1 R32.
What Is Bluetooth Send?
Bluetooth Send is the wireless output channel of the program.
Conceptually:
Program
↓
Data
↓
Bluetooth
↓
Connected Device
The transmitted information might be:
- Text messages
- Sensor values
- Numbers
- Program status
- Robot commands
- Calculated results
Why Use Bluetooth?
Bluetooth allows information to be transmitted wirelessly.
Examples include:
Sending sensor readings to a phone
Sending robot status information
Wireless monitoring systems
Smart-device communication
Interactive robotics projects
Two-way phone applications
Wireless diagnostics
Bluetooth Category
[INSERT CATEGORY IMAGE HERE: Bluetooth Send]
Figure 11.1 – Blocks available in the Bluetooth Send category.
The category is easiest to understand using the workflow:
CONNECT
↓
PREPARE DATA
↓
SEND
↓
VERIFY
Understanding Communication Direction
Before using Bluetooth communication, students should understand information flow.
Bluetooth Send
D1 R32
↓
Other Device
Information leaves the D1 R32.
Bluetooth Receive
Other Device
↓
D1 R32
Information enters the D1 R32.
Memory Rule
SEND = OUT
RECEIVE = IN
Bluetooth Central and Peripheral Devices
Bluetooth communication generally involves two roles.
Central Device (Host)
[INSERT BLOCK IMAGE HERE: BLE Central Init]
A Central device controls the connection process.
It searches for devices and initiates communication.
Conceptually:
Scan
↓
Find Device
↓
Connect
Think of the Central device as:
Controller
or
Boss of the Bluetooth Network
Peripheral Device (Slave)
[INSERT BLOCK IMAGE HERE: BLE Peripheral Init]
A Peripheral device waits for another device to connect.
Example:
"Clu-Bots"
Conceptually:
Wait
↓
Receive Connection
↓
Communicate
Think of the Peripheral as:
Helper Device
that waits for instructions.
Scanning for Bluetooth Devices
[INSERT BLOCK IMAGE HERE: BLE Scan]
Before connecting, the Central device may search for nearby Bluetooth devices.
Conceptually:
Scan
↓
Discover Devices
↓
Choose Device
Think of scanning as Bluetooth radar.
Connecting to a Device
[INSERT BLOCK IMAGE HERE: Bluetooth Connect]
After finding a device, the D1 R32 can connect.
Two methods are available.
Connect by Name
Example:
“Clu-Bots”
Conceptually:
Search Name
↓
Connect
Connect by MAC Address
A MAC Address uniquely identifies a Bluetooth device.
Conceptually:
Unique Address
↓
Connect
This is more precise than connecting by device name.
Connection Status
[INSERT BLOCK IMAGE HERE: Connection Status]
Before sending information, programs should verify that Bluetooth is connected.
Conceptually:
Connected?
↓
True / False
Example
IF Connected
↓
Allow Transmission
Memory Rule
No Connection = No Communication
Local MAC Address
[INSERT BLOCK IMAGE HERE: Local MAC Address]
Every Bluetooth device has a unique identifier known as a MAC Address.
Conceptually:
Robot Identity
The MAC Address can be useful when:
- Pairing devices
- Identifying robots
- Connecting directly by address
Sending Text Messages
[INSERT BLOCK IMAGE HERE: Bluetooth Send Data]
The simplest information to transmit is text.
Example:
“Clu-Block”
Conceptually:
Message
↓
Bluetooth Send
↓
Connected Device
This should be the first transmission exercise because the message is easy to recognize.
Actual Bluetooth Send Example
Example transmission:
Bluetooth Send Data
“Clu-Bots”
Conceptually:
"Clu-Bots"
↓
Bluetooth
↓
Phone
If the receiving device displays:
Clu-Bots
communication is working correctly.
Sending Variables
Bluetooth becomes more useful when the transmitted information changes while the program runs.
Example:
counter
Conceptually:
Variable
↓
Bluetooth
↓
Remote Device
This connects the Bluetooth category with the Variables category.
Sending Sensor Information
Real projects often send sensor data.
Example:
DHT11
↓
Temperature
↓
Bluetooth
↓
Phone
Another example:
Ultrasonic Sensor
↓
Distance
↓
Bluetooth
Bluetooth becomes a bridge between:
Physical World
↓
Sensor
↓
Bluetooth
↓
Remote Device
Raw Data vs Readable Messages
Students should understand the difference between:
Raw Data
23
Readable Information
Temperature: 23
The second form is easier for humans to understand.
Information Flow
Sensor
↓
Value
↓
Format Text
↓
Bluetooth
Bluetooth + Text
The Text category is useful for creating meaningful messages.
Example:
Distance: 45 cm
instead of simply:
45
Communication Pattern
DATA
↓
TEXT
↓
MESSAGE
↓
TRANSMIT
Bluetooth + Serial
While learning Bluetooth, Serial should remain central.
A useful debugging pattern is:
Data
↙ ↘
Serial Bluetooth
↓ ↓
PC Phone
This allows students to compare:
- What the D1 R32 reports locally
- What the D1 R32 sends wirelessly
Send Only When Necessary
Not every program needs to transmit continuously.
Control blocks can decide when transmission occurs.
Example:
Button Pressed?
↓
True
↓
Bluetooth Send
Another example:
Sensor Changed?
↓
True
↓
Bluetooth Send
Sending Only New Information
Efficient communication sends information only when something changes.
Conceptually:
Current Value
↓
Compare Previous Value
↓
Changed?
↓
Yes
Important Idea
Transmit information when it becomes useful, not simply because transmission is possible.
Sending Periodically
Sometimes information should be transmitted at regular intervals.
Example:
Read Sensor
↓
Bluetooth Send
↓
Wait
↓
Read Again
Useful for:
- Temperature
- Humidity
- Light sensors
- Distance measurements
- Motion sensing
Bluetooth Send vs Serial
Students should understand why both systems exist.
| Serial | Bluetooth |
|---|---|
| Communicates with PC | Communicates wirelessly |
| Excellent for debugging | Excellent for remote devices |
| Local communication | Wireless communication |
| Learning tool | Communication tool |
Best Learning Strategy
SERIAL FIRST
↓
BLUETOOTH SECOND
↓
BOTH TOGETHER
Bluetooth Send vs Radio
Bluetooth and Radio are different communication systems.
Bluetooth
D1 R32
↓
Phone / Tablet
Radio
Device
↔
Device
Important Idea
Same Goal:
Communicate
Different Technologies:
Different Blocks
Bluetooth Send vs Network
Students should also distinguish Bluetooth from Network communication.
Bluetooth
Device
↔
Device
Wireless local communication.
Network
Device
↔
Internet
Network communication.
First Bluetooth Send Experiment
The first Bluetooth project should remain simple.
Step 1
Connect Bluetooth.
Step 2
Prepare message:
“Clu-Block”
Step 3
Send message.
Step 4
Observe it on the receiving device.
Learning objective:
SEND MESSAGE WIRELESSLY
Nothing more.
Second Experiment: Changing Values
Transmit information generated by the program.
Example:
Counter
↓
Bluetooth
Students see that Bluetooth can transmit changing information.
Third Experiment: Sensor Data
Example:
Temperature
↓
Bluetooth
↓
Phone
Students move from fixed information to live measurements.
Fourth Experiment: Meaningful Information
Instead of sending:
25
Send:
Temperature: 25
This teaches:
MEASURE
↓
INTERPRET
↓
COMMUNICATE
Fifth Experiment: Two-Way Communication
After Bluetooth Send and Bluetooth Receive are understood separately:
Phone
↓
Command
↓
D1 R32
↓
Action
↓
Response
↓
Phone
This creates:
RECEIVE
↓
PROCESS
↓
RESPOND
Bluetooth Send + Receive
Together, Bluetooth Send and Bluetooth Receive create complete communication systems.
Example:
Remote Device
↓
Command
↓
D1 R32
↓
Action
↓
Bluetooth Response
↓
Remote Device
This is how interactive Bluetooth applications are built.
Quick Guide for Students
Want information to leave the D1 R32?
Use:
Bluetooth Send
What should I send first?
Simple Text Message
Can I send variables?
Variable
↓
Bluetooth
Can I send sensor values?
Sensor
↓
Bluetooth
Should I format sensor data?
Sensor
↓
Text
↓
Bluetooth
How do I debug transmissions?
Data
↓
Serial + Bluetooth
Do I need to send continuously?
No.
Use Logic and Control to determine when sending occurs.
Key Vocabulary
| Term | Definition |
|---|---|
| Bluetooth | Wireless communication technology |
| Central Device | Device that initiates connections |
| Peripheral Device | Device waiting for connections |
| Scan | Search for nearby Bluetooth devices |
| MAC Address | Unique identifier of a Bluetooth device |
| Transmission | Sending information |
| Variable | Program-generated information |
| Sensor Data | Physical measurements sent wirelessly |
| Message | Information transmitted to another device |
| Two-Way Communication | Both devices send and receive |
Summary
In this lesson, you learned how Bluetooth Send allows the D1 R32 to transmit information wirelessly.
You explored how to:
Configure Bluetooth communication
Understand Central and Peripheral devices
Scan for Bluetooth devices
Connect to devices
Send messages
Send variables
Send sensor information
Verify communication
Build two-way communication systems
Bluetooth Send transforms the D1 R32 from a standalone controller into a device that can communicate wirelessly with phones, tablets, computers, and other smart devices. By combining Bluetooth Send with Bluetooth Receive, students can create complete interactive communication systems.
Key Takeaway
Bluetooth Send turns the D1 R32 into a wireless transmitter, allowing it to send messages, sensor data, program information, and responses to phones, tablets, computers, and other Bluetooth devices.
By learning to connect, format information, transmit data, and build two-way communication systems, students can create wireless monitoring systems, remote-control applications, smart robotics projects, and interactive Bluetooth-enabled devices.
