Once this works, you can treat TinyTTS as a small “speech layer” you can drop into any future Arduino project whenever you need voice feedback instead of (or in addition to) LEDs and displays.

Project Overview

We’ll use the same basic wiring in two modes:

PC → Arduino (USB Serial) → TinyTTS (UART).

You send text from a terminal on your computer, TinyTTS speaks it.

Sensor → Arduino → TinyTTS.

Arduino reads a sensor (temperature in the example), builds a string such as "Temperature is 23 degrees," and sends it to TinyTTS.

The only real difference between the scenarios is where the text comes from.

The TinyTTS interface stays identical in both cases.

How It Works

TinyTTS behaves like a simple UART device:

On the Arduino side:

For Arduino Mega: This board has multiple Hardware Serial ports. You can use the standard USB connection for the PC and a second Hardware Serial (e.g., Serial1 or Serial 2) to talk to TinyTTS reliably at high speeds.

For Arduino Uno/Nano: These boards have only one Hardware Serial (Pins 0 and 1). To ensure reliable audio performance, we connect TinyTTS to the Hardware Serial. To communicate with the PC simultaneously, we use aseparate USB-TTL adapter connected via SoftwareSerial on digital pins.

In code, this boils down to just one operation:

if (debugSerial.available()) {
// 1. Read plain text from the PC via the USB-TTL adapter
// ... read into inputBuffer ...
// 2. Convert to TTS protocol and send to module via Hardware Serial
speak(inputBuffer);
}

In Scenario 1, you call speak() with text from the PC.

In Scenario 2 you call speak() with text built from sensor readings.

Hardware

You can reproduce this project with common Arduino parts.

Core components

– UART interface for text input

– 3.5 mm audio jack for headphones or speaker

Tested with:

– Arduino Uno

– Arduino Nano

– Arduino Mega 2560

Any board that has a hardware Serial for TinyTTS and a second serial port (hardware or software) for USB will work.

Plugged into TinyTTS 3.5 mm output.

To program the board and, in Scenario 1, to send text from a PC.

Sensor for Scenario 2 (example)

You can replace it with another sensor you know well (DHT11/DHT22, photoresistor, HC‑SR04, soil moisture, etc.). The TinyTTS part does not depend on the sensor type.

Wiring

Common Connections (TinyTTS ↔ Arduino)

The basic connections are the same for both scenarios:

On Arduino Mega you can, for example, use Serial1:

On Uno/Nano you can use Hardware Serial:

Specific Wiring for Arduino Uno/Nano:

Because pins 0 and 1 are used by the TinyTTS module, you must add a USB TTL adapter to send text from your computer.

Additional Sensor Wiring (Scenario 2)

BME680 sensor (Temperature, Humidity, Pressure, Gas):

If you use a different sensor, connect it as recommended in its own documentation. The TinyTTS part of the wiring remains unchanged.

Code Overview and Upload

Scenario 1 – USB Demo: Type Text, Hear Speech

In this scenario, Arduino acts as a bridge between your PC and TinyTTS.

1. Upload the sketch

Select your board and port in the Arduino IDE.

Upload the demo sketch that:

Important for Uno users: Disconnect the TinyTTS wires from pins 0 and 1 while uploading, then reconnect them and press Reset.

2. Open a serial terminal on the PC

Any of these will work:

3. Send text

At this point, you’ve verified:

Scenario 2 – Sensor‑Driven Voice

Now we switch from text typed on a PC to text generated from a sensor reading.

1. Keep the existing TinyTTS wiring

No changes are required on that side.

2. Add the sensor wiring

Connect the BME680 via I2C as described in the Wiring section.

3. Modify the sketch

Include the necessary library (e.g. CloseCube_BME680) and replace the serial input loop with sensor logic:

// Inside the loop
bme.setForcedMode();
double temp = bme.readTemperature(); // Read temp in Celsius
// Format the message
char msg[40];
sprintf(msg, "Temperature %d degrees.", (int)(temp + 0.5));
// Speak the message
speak(msg);
// Wait before next reading
delay(10000);

4. Test the talking sensor

From here, you can substitute any sensor: distance, light level, soil moisture, etc.

Reusing This Pattern in Other Projects

The main goal of this build is not a single talking thermometer, but a general pattern you can reuse:

1. Reserve a serial port for TinyTTS.

2. Implement a small function like speak(text).

3. Decide in your project when to call it and what to say.

You can drop this into:

The rest of your application code can stay as it is.

Next Steps

Ideas for extending this project:

Only speak when a value crosses a limit, e.g.

"Warning: temperature above thirty degrees."

Use TinyTTS to confirm state changes:

"Setup mode", "Measurement started", "Calibration complete".

Show the value on an OLED or LCD and speak it at the same time.

The TinyTTS UART protocol works the same with other boards (e.g. ESP32). You only need one spare serial interface.

If you build your own voice‑enabled tool or experiment using this pattern, consider publishing it as a separate project and referencing this one as the TinyTTS base. That way, others can see different ways to reuse the same speech layer.

Useful Links