Thursday, September 28, 2023
ArduinoIoT HardwaresTutorials/DIY

Text to Speech on Arduino

We have already made many projects regarding Arduino. Today, we will use “Text to Speech” to give voice to these projects, Without Text-to-Speech Module. We can do this through the Arduino TTS library. Using this library, voice synthesizer that converts a stream of digital text into retro (robot) speech. It is very easy, we need only external LM385 amplifier with arduino Uno, No special components or shields required.
Thanks to Gabriel Petrut and Clive Webster for making this thing. We found this project on GitHub :
Using this project we can read Internet-based data streams (such as e-mails or Twitter feeds), Conveying status or sensor outputs from robots, or industrial machinery.

Components required:

  • Arduino Uno
  • LM386
  • Speaker
  • Capacitors and few resistors as shown in circuit

Circuit Diagram

text to speech arduino

Library download

Arduino Code for Text to Speech

Note: This program and library works only with Arduino 1.0 version
  Text To Speech syntesis library

  The Text To Speech library uses Timer1 to generate the PWM
  output on digital pin 10. The output signal needs to be fed
  to an RC filter then through an amplifier to the speaker.

#include <TTS.h>

// Media pins
#define ledPin 13       // digital pin 13                          

// Variables
char text [50];
boolean state=0;

TTS text2speech;  // speech output is digital pin 10

void setup() { 
  pinMode(ledPin, OUTPUT); 

// Main Loop
void loop(){
    state = !state;
    digitalWrite(ledPin, state);
    delay(1000);          // delay a second

void Test_Speech() {
 text2speech.setPitch(6); //higher values = lower voice pitch
 strcpy(text, "Hello, How are you?");
 text2speech.setPitch(1); //lower values = higher voice pitch
 strcpy(text, "I am fine.");

For more details please visit

Harshvardhan Mishra

Hi, I'm Harshvardhan Mishra. I am a tech blogger and an IoT Enthusiast. I am eager to learn and explore tech related stuff! also, I wanted to deliver you the same as much as the simpler way with more informative content. I generally appreciate learning by doing, rather than only learning. If you want to help support me on my journey, consider sharing my articles, or Buy me a Coffee! Thank you for reading my blog! Happy learning!

Leave a Reply