Voice-Controlled Alarm Clock Instructable

Check this out:

http://www.instructables.com/id/Voice-Controlled-Clock-With-Arduino-no-WiFi-No-PC/

Thanks for posting the project. I put together one using a logger shield that contains the DS1307 RTC and memory card slot. I also attached a relay control shield I built for controlling things with voice. I hope to be showing this at this year’s 2017 Maker Faire at my exhibit space, “No-Bang Hat for the visually impaired”. http://makerfaire.com/maker/entry/59848/
This would make an ideal device to help the visually and mobility impaired.

[Last edited Mar 25, 2017 18:05:56]

The clock fits well inside a speaker box. I used a 3 watt PAM digital amp to drive the speaker. Next I added an external electret to the ext. mic jack. I’ve tried several electret microphones, but get nowhere the same sensitivity as the one on the board. Because the board is inside a box, I can’t use the on-board microphone. Apparently, when using an external mic, the signal does not go through an auto-adjusting gain amplifier like the on-board microphone does. Since I’m warned not to add a pre-amp, how can I get the same response like the on-board mic can provide? I would like to speak to MOVI from about 3 feet and not up very close to the microphone.

This topic has been discussed at some length in this thread:


http://www.audeme.com/forum.html#/20160106/external-microphone-5138266/

Gerald’s recommendation when the question was posed some time ago was the Adafruit MAX9814 together with an attenuator circuit. I went with that and it works quite well. The thread goes on to discuss a voice bandpass filter that helped me out with a very noisy (car) environment - you may or may not need that part.


There have been some other threads where some more “out-of-the-box” microphone solutions were proposed, though I don’t think anyone posted any feedback on how effective they were or not.


Hope that helps.

1 Like

I want to do this sketch with the DS-3231

This is the sketch that worked for me:

#include <RTClib.h>
#include <SoftwareSerial.h> // MOVI needs SoftwareSerial
#include <Wire.h> // The RTC module is a 2-wire interface
#include <MOVIShield.h> // Include MOVI library
#include <RTClib.h> // Real Time Clock Library. Download at https://github.com/adafruit/RTClib

//

// This example implements a talking clock.
// If you have a real time clock module such as a DS3231, connect:
// DS3231 Uno R3
// GND -> GND
// 5V -> 5V
// SDA -> SDA pin A4
// SDC -> SDC pin A5

MOVI recognizer(true); // Get a MOVI object, true enables serial monitor interface, rx and tx can be passed as parameters for alternate communication pins

RTC_DS3231 rtc; // Real Time Clock using the DS3231 Chip

char monthsOfTheYear[12][12] = {“January”,“Febraury”,“March”,“April”,“May”,“June”,“July”,“August”,“September”,“October”,“November”,“December”};

short int Timer = 0;

long TimerEndTime; // Timer end time when set

void setup()

{
// Comment out the first time to set the time and date on the RTC module. After this,
// it will remember it via it non-volatile memory.
Serial.begin(115200);
// start the connexion to the RTC

if (! rtc.begin()) {
Serial.println(“Couldn’t find RTC”);
while (1); // can’t go further
}

// Uncomment this code to set the time of your RTC to the last compile time of this code
// if you compile and upload in one go, that will be close enough to a good time
// this is convenient as you don’t need to manually mess around with the time manually
// rtc.adjust(DateTime(F(DATE), F(TIME)));
// or uncomment this line to decide what you want as a date/time for your RTC
// format is year, month, day, hours, minutes, seconds
// but you need to set that manually, take into account it takes a bit of time to compile, upload and run
// so give yourself some padding in the seconds and check your wall clock and press reset on your arduino
// when it’s the right time.

rtc.adjust(DateTime(2019, 1, 5, 21, 06, 00));

Serial.println(“RTC date is set”);

recognizer.init(); // Initialize MOVI (waits for it to boot)
recognizer.callSign(“Servant”); // Train callsign Servant
recognizer.addSentence(F(“What time is it ?”)); // Add sentence 1
recognizer.addSentence(F(“What is the time ?”)); // Add sentence 2
recognizer.addSentence(F(“What is the date ?”)); // Add sentence 3
recognizer.addSentence(F(“Set Timer for 5 minutes”)); // Add sentence 12
recognizer.train(); // Train (may take 20seconds)
recognizer.say(“Real Time Clock Starting”);

// recognizer.setThreshold(10); // uncomment and set to a higher value (valid range 2-95) if you have a problems due to a noisy environment.

}

void loop() // run over and over

{

DateTime now = rtc.now(); // Get real time
signed int res = recognizer.poll(); // Get result from MOVI, 0 denotes nothing happened, negative values denote events (see docs)

// Tell current time

if (res==1 | res==2) { // Sentence 1 & 2

if ( now.hour() > 12)

recognizer.say("It’s " + String(now.hour()-12) + " " + ( now.minute() < 10 ? “O” : “” ) + String(now.minute()) + “P M” ); // Speak the time

else

recognizer.say("It’s " + String(now.hour()) + " " + ( now.minute() < 10 ? “O” : “” ) + String(now.minute()) + “A M” ); // Speak the time

}

// Tell current date

if (res==3 || res==4) { // Sentence 3 & 4

recognizer.say(“Today is” + String(monthsOfTheYear[now.month()-1]) + String(now.day()) + " " + String(now.year()));

}

// Cancel Timer

if (res==5) { // Sentence 6

Timer = 0;

recognizer.say(“Timer was cancelled”);

}

// Check Timer Status

if (res==6 || res==7 ) {

if (Timer) {

recognizer.say(“Timer is set”);

long left = TimerEndTime - now.secondstime();

if ( left < 60 )

recognizer.say(“There is " + String(left) + " seconds left”);

else

recognizer.say("There is " + String((int) (left/60)) + "minutes and " + String(left%60) + “seconds left”);

}

else

recognizer.say(“Timer is not set”);

}

// Set timer

if (res>=8 && res <=12) {

Timer = 1;

TimerEndTime = now.secondstime() + (res-7)*60 ;

recognizer.say(“Timer set for " + String(res-7) + " minutes”);

}

if ( Timer && ( now.secondstime() >= TimerEndTime) ) {

Timer = 0;

recognizer.say(“Time is up!”);

}

}

1 Like