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 & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • 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
      • Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Vietnam
      • 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
Sci Fi Your Pi
  • Challenges & Projects
  • Design Challenges
  • Sci Fi Your Pi
  • More
  • Cancel
Sci Fi Your Pi
Blog The Picorder: A Star Trek style tricorder - Day 30
  • Blog
  • Forum
  • Documents
  • Files
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: saturnv
  • Date Created: 23 May 2015 9:21 PM Date Created
  • Views 274 views
  • Likes 4 likes
  • Comments 0 comments
  • star_trek
  • raspberry_pi
  • handheld_sensor
  • sci_fi_your_pi
  • tricorder
Related
Recommended

The Picorder: A Star Trek style tricorder - Day 30

saturnv
saturnv
23 May 2015

May 23 2015

Day 30 Sound Test

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

I have been working diligently on some of the sound bytes I intend to use and the necessary scripting involved triggering the sound bytes at the appropriate time during sensor reading activity. Scripts will be commented appropriately when modified specifically for the Picorder operation. Final code and documentation will be provided later as the project nears completion.

 

In the accompanying video sound test, I am using the previously dissembled stereo speakers normally used with an mp3 player or Smartphone. I took the system apart and mounted the speaker housing on one side of a perf board and secured it with hot glue and mounted the accompanying circuitry on the reverse side. The original unit was powered by a 1.5 vdc power source and will later on be adapted to draw its power from the Raspberry Pi power source. I supplied power to the speakers with a 1.5 vdc battery and made temporary connections to the Pi sound output jack for the video demonstration.

 

Within the script are 4 GPIO pins set as input triggers. Each pin is held high in its idle state. When pulled low on a specific GPIO pin, the appropriate sound byte will play through the speaker. I am using temporary sound bytes from Star Trek the original series for testing and these will change to be aligned with the sensors I use later on such as the tricorder or alert sounds. As seen in the video, as I pulled each GPIO pin low (to a ground potential) that action initiated the playing of the particular sound byte identified in the script and associated with the specific pin. The momentary triggering is essential to avoid the instant replaying of the sound byte over and over until it is unintelligible as demonstrated in the video.

 

Here is the basic code used for this sound test:

#!/usr/bin/env python

import os

from time import sleep

import RPi.GPIO as GPIO

GPIO.setmode(GPIO.BCM)

GPIO.setup(18, GPIO.IN)

GPIO.setup(23, GPIO.IN)

GPIO.setup(24, GPIO.IN)

GPIO.setup(25, GPIO.IN)

 

 

while True:

    if (GPIO.input(18) == False):

        os.system('mpg123 -q twohours.mp3 &')

    if (GPIO.input(23) == False):

        os.system('mpg123 -q access.mp3 &')

    if (GPIO.input(24) == False):

        os.system('mpg123 -q defense.mp3 &')

    if (GPIO.input(25)== False):

        os.system('mpg123 -q Destruct.mp3 &')

    sleep(0.5);

 

imageimageimageimageimage

   Speaker mount                         Hot glued to secure to board      L/R channels and amplifier       Amplifier power connections        Speaker powered up

 

The above assembly will be positioned inside the final casement along with the Pi and appropriate sensors.

 

Next blog post is planned to be the multiple sensor testing and scripting for the various sensors. It may also include the readout display either as a graphic or numerical display.

 

Michael

  • Sign in to reply
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 © 2026 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