element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Internet of Things
  • Technologies
  • More
Internet of Things
Blog IoT Alarm Clock - Part 4
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Internet of Things to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: fvan
  • Date Created: 2 Jul 2014 6:58 PM Date Created
  • Views 3634 views
  • Likes 3 likes
  • Comments 9 comments
  • wolfson
  • clock
  • audio
  • internet_of_things
  • micro
  • raspberrypi
  • iot
  • alarm
  • arduino
  • train
Related
Recommended

IoT Alarm Clock - Part 4

fvan
fvan
2 Jul 2014

Previous blog posts for this project:

  • IoT Alarm Clock - Part 1
  • IoT Alarm Clock - Part 2
  • IoT Alarm Clock - Part 3
  • IoT Alarm Clock - Part 4 (this post)

 

  • Hardware
  • Software
    • Voice control
    • Web interface
    • Avahi daemon
  • Demo
    • Voice control
    • Train selection
  • Version 2.0

 

I've been working hard the past few weeks in order to finalise both software and hardware for my IoT Alarm Clock.

This is the final post for this project, or at least this first prototype, where I elaborate on the software and the final parts of the build.

 

 

Hardware

 

Here it is, the final look of the alarm clock.

 

I printed a bracket able to hold the LED matrix so that it remains correctly positioned, but is still removable. Then came the front panel for which I printed a frame with rounded edges to which I attached some spare speaker cloth I had laying around.

imageimage

 

I chose the speaker front panel for following reasons:

  • it softens the light produced by the LED matrix, making it easier to read (and easier on the eyes at night!)
  • the integrated microphones of the Wolfson audio card remain "accessible" for voice control purposes
  • I think it looks good image

 

imageimage

imageimage

 

Software

 

Voice control

 

I had some difficulties getting Jasper to work with the Wolfson audio card. I created a question in the community and recently got some very useful answers. Thanks guys!

You can find the thread here: Re: Wolfson audio card + Jasper ?

 

Jasper is now working, but it has some difficulties understanding what I say. If I articulate properly, I manage to get an answer from Jasper image

 

 

 

Web interface

 

The web interface has been finalised. It offers different pages, each with their own functionality:

  • Overview: Chosen train information and to what time the alarm is set
  • Trains: Search criteria for the train connection
  • Alarms: Configured alarms
  • Sounds: Configured sounds available for alarms, supporting files and internet radio streams

 

imageimageimage

 

All data such as train information and train stations is retrieved dynamically via the iRail API for Belgian public transportation.

 

Some pages require to be visualised in landscape mode due to long text (url/path):

imageimage

 

imageimage

 

 

Avahi daemon

 

Having a web interface with all information needed is nice, but how do you know which ip address to use ? You could configure a fixed IP address, but even nicer would be to access the GUI via a name. This is made possible with the avahi daemon.

 

pi@alarmclock ~ $ sudo apt-get install avahi-daemon
pi@alarmclock ~ $ sudo insserv avahi-daemon
pi@alarmclock ~ $ sudo nano /etc/avahi/services/multiple.service

 

<?xml version="1.0" standalone='no'?>
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
        <name replace-wildcards="yes">%h</name>
        <service>
                <type>_device-info._tcp</type>
                <port>0</port>
                <txt-record>model=RackMac</txt-record>
        </service>
        <service>
                <type>_ssh._tcp</type>
                <port>22</port>
        </service>
</service-group>

 

pi@alarmclock ~ $ sudo /etc/init.d/avahi-daemon restart

 

The pi is now accessible via alarmclock.local:

 

Fredericks-MacBook-Air:~ fvan1$ ping alarmclock.local
PING alarmclock.local (192.168.0.178): 56 data bytes
64 bytes from 192.168.0.178: icmp_seq=0 ttl=64 time=37.015 ms
64 bytes from 192.168.0.178: icmp_seq=1 ttl=64 time=59.842 ms

 

So is the web interface:

 

image

 

Demo

 

Voice control

 

Here's a video of Jasper telling me the time. I extended the "Time.py" script to also print the time on the LED matrix.

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

 

Here's Jasper telling me to what time the alarm is set:

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

 

And finally, Jasper telling me when my train leaves:

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

 

Rather than use voice control, you can also press the button sat the top of the alarm clock, which will then display the same output as when using voice control.

 

 

Train selection

 

What follows are some examples of the alarm clock calculating the alarm time, after determining which train to take.

imageimage

To go from Lokeren to Callenelle, the clock picked the train leaving at 05:22, and decides to set the alarm fro 04:52, taking into account 30 minute to get prepared and go to the station.

When performing the same query on the railways website, we see there are multiple options, but the clock picked the most appropriate one.

image

 

A second example, still from Lokeren, but this time to Brussels Central:

imageimage

 

This second example illustrates the fact that the application will select the train that allows to sleep as long as possible, while still arriving on time.

One of the trains arrives exactly at the desired arrival time, but leaves earlier. The application therefore decided to pick a train that arrives a little bit earlier than desired, but allows to sleep longer than the one arriving exactly on time.

 

 

Version 2.0

 

As stated earlier, this is the final post for this first prototype. It doesn't mean that this project is over!

There are a lot of improvements which can be implemented in order to create version 2.0.

 

Some ideas for a next version:

  • improve voice control: ensure better recognition of questions and extend range of supported questions
  • expand the transport options: current implementation supports train, but it could be expanded to include bus, car, subway, etc ...
  • ...

 

 

 

Thank you element14 for giving me the chance to create this build!

  • Sign in to reply

Top Comments

  • Stuartsjones
    Stuartsjones over 11 years ago +3
    This... is amazing, fvan !
  • Former Member
    Former Member over 10 years ago +1
    Oh My- This is crazy cool...I'm a bit shocked by how fantastic it works and looks.. Nice Job!! Very Nice Job!
Parents
  • DAB
    DAB over 11 years ago

    Well done Frederick,

     

    Are you planning to work on the delay to make the device more responsive or is that a function of the processing speed?

     

    DAB

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
Comment
  • DAB
    DAB over 11 years ago

    Well done Frederick,

     

    Are you planning to work on the delay to make the device more responsive or is that a function of the processing speed?

     

    DAB

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
Children
  • fvan
    fvan over 11 years ago in reply to DAB

    Hi DAB,

     

    the delay is much too long as it is now, so yes, I'd like to improve it.

     

    Jasper seems to take too long to realise no more input is coming. I'll have to look if this is caused by a (configurable?) timeout or due to something else.

    Perhaps by limiting the size of the dictionary and possible lookup values, some time can be gained as well.

     

    Frederick

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube