Schlagwort: sound

  • 10 most popular modules and sensors for the Arduino UNO all on one board

    10 most popular modules and sensors for the Arduino UNO all on one board

    Reading Time: 2 minutes

    10 most popular modules and sensors for the Arduino UNO all on one board

    Arduino TeamDecember 1st, 2020

    Getting started with electronics and sensing the world around you is now easier than ever with the new all-in-one Arduino Sensor Kit from Arduino, in partnership with Seeed.   

    The 10 most popular modules and sensors for your Arduino UNO have been integrated onto a single board, providing plug-and-play convenience without the need for any soldering or wiring! Combining basic Grove sensors and actuators for the Arduino UNO, the kit contains a base shield featuring the following modules that can be connected either through the digital, analog, or I2C connectors:

    • An OLED screen
    • 4 digital modules (LED, button, buzzer and potentiometer)
    • 5 sensors (light, sound, air pressure, temperature, and accelerometer)

    Just plug the Arduino Sensor Kit into the Arduino UNO, then you’re ready to follow the Plug, Sketch & Play online lessons that make getting started a breeze.

    The kit is equipped with 16 Grove connectors, which when placed on the board, offer functionality to the various pins. With seven digital connections, four analog connections, four I2C connections, and a UART connection, the base shield can be easily mounted onto an Arduino UNO board and programmed through the Arduino IDE. 

    Now available from the Arduino Store, the Arduino Sensor Kit comes as a standalone kit for only €23.00 / US$23.00, or can be purchased with the Arduino UNO Rev3 board as a great value bundle for €38.70 / US$38.70. For more details, check out our website here.

    Website: LINK

  • How to play sound and make noise with your Raspberry Pi

    How to play sound and make noise with your Raspberry Pi

    Reading Time: 9 minutes

    If your amazing project is a little too quiet, add high-fidelity sound with Raspberry Pi and the help of this handy guide from HackSpace magazine, written by PJ Evans.

    The PecanPi HAT features best-in-class components and dual DACs for superior audio reproduction

    It’s no surprise that we love microcontrollers at HackSpace magazine. Their versatility and simplicity make them a must for electronics projects. Although a dab hand at reading sensors or illuminating LEDs, Arduinos and their friends do struggle when it comes to high-quality audio. If you need to add music or speech to your project, it may be worth getting a Raspberry Pi computer to do the heavy lifting. We’re going to look at the various audio output options available for our favourite small computer, from a simple buzz, through to audiophile bliss.

    Get buzzing

    Need to keep it simple and under a pound?
    An active buzzer is what you need

    The simplest place to start is with the humble buzzer. A cheap active buzzer can be quickly added to Raspberry Pi’s GPIO. It’s surprisingly easy too. Try connecting a buzzer’s red wire (positive) to GPIO pin 22 (Broadcom numbering) and the black wire (ground) to any GND pin. Now, install the GPIO Zero Python library by typing this at the command line:

    sudo apt install python3-gpiozero

    Create a file called buzz.py in your favourite editor and enter the following:

    import time from gpiozero import Buzzer buzzer = Buzzer(22) buzzer.on() time.sleep(1) buzzer.off()

    Run it at the command line:

    python3 buzz.py

    You should hear a one-second buzz. See if you can make Morse code sounds by changing the duration of the sleep statement.

    Passive but not aggressive

    Raspberry Pi computers, with the exception of the Zero range, all have audio output on board. The original Raspberry Pi featured a stereo 3.5mm socket, and all A and B models since feature a four-pole socket that also includes composite video. This provides your cheapest route to getting audio from your Raspberry Pi computer.

    A low-cost passive speaker can be directly plugged in to provide sound, albeit probably quieter than you’d like. Of course, add an amplifier or active speaker and you have sound as loud as you like. This is the most direct way of adding sound to your project, but how to get the sound out?

    Need a simple solution? USB audio devices come in all shapes and sizes but are mostly plug-and-play

    Normally, the Raspbian operating system will recognise that an audio device has been connected and route audio through it. Sometimes, especially if you’ve connected an HDMI monitor with sound capability (e.g. an HDMI TV), sound will not come out of the correct device.

    To fix this, open up a terminal window and run sudo raspi-config. When the menu appears, go to Advanced Options and select Audio, then select the option to force the output through the audio jack. You may need to reboot Raspbian for all changes to take effect.

    Plug and playback

    A USB sound device is another simple choice for audio playback on Raspberry Pi. Literally hundreds are available, and a basic input/output device with better audio quality than the on-board system can be purchased for a few pounds online. Installation tends to be no more complicated than plugging the device into the USB port. You may need to select the new output, as the underlying audio system, ALSA (see the ALSA and PulseAudio section for more), may mute it by default. To fix this, run alsamixer from the command line, press F6 to select the new sound device, and if you see ‘MM’ at the bottom of the volume indicator, press M to unmute and adjust the volume with the cursor keys.

    Many DACs also come with on-board amplifiers. Perfect for passive speakers

    Unsurprisingly, when choosing your USB sound device, you can start at a few pounds and go right up to professional equipment costing hundreds. As they are low-power, USB devices do not tend to feature amplification, unless they have a separate power source.

    Let’s play

    The simplest way to play audio on Raspbian is to use OMXPlayer. This is a dedicated hardware-accelerated command-line tool that takes full advantage of Raspberry Pi’s capabilities. It sends audio to the analogue audio jack by default, so playing back an MP3 file is as simple as running:

    omxplayer /path/to/audio/file.wav

    There are many command-line options that allow you to control how the audio is played. Want the audio to loop forever? Just add --loop to the command. You’ll notice that when it’s running, OMXPlayer provides a user interface of sorts, allowing you to control playback from within the terminal. If you’d just like it to run in the background without user input, run the command like this:

    omxplayer --no-keys example.wav &

    Here, —-no-keys removes the interface, and the ampersand (&) tells the operating system to run the job ‘in the background’ so that it won’t block anything else you want to do.

    OMXPlayer is a great choice for Raspbian, but other players such as mpg321 are available, so find the tool that’s best for you.

    Another useful utility is speaker-test. This can produce white noise or vocal confirmation so you can check your speakers are working properly. It’s as simple as this:

    speaker-test -t wav -c 2

    The first parameter sets the sound to be a voice, and the -c tests stereo channels only: front left and front right.

    Phat Beats

    If space is an issue, a Raspberry Pi 4, amplifier, and speaker may not be what you have in mind. After all, your cool wearable project is going to be problematic if you’re trailing an amplifier on a cart with a 50-metre extension lead powering everything. Luckily, the clever people at Pimoroni have you covered. The Speaker pHAT is a Raspberry Pi Zero-sized HAT that not only adds audio capability to the smallest of the Raspberry Pi family, but also sports a 3 W speaker. Now you can play any audio with a tiny device and a USB battery pack.

    Small, cheap, and fun, the Speaker pHat features a 3 W speaker and LED VU meter

    The installation process is fully automated, so no messing around with drivers and config files. Once the script has completed, you can run any audio tool as before, and the sound will be routed through the speaker. No, the maximum volume won’t be troubling any heavy metal concerts, but you can’t knock the convenience and form factor.

    Playing the blues

    An easy way to get superior audio quality using a Raspberry Pi computer is Bluetooth. Recent models such as the 3B, 4, and even the Zero W support Bluetooth devices, and can be paired with most Bluetooth speakers, even from the command line. Once connected, you have a range of options on size and output power, plus the advantage of wireless connectivity.

    Setting up a Bluetooth connection, especially if you are using the command line, can be a little challenging (see the Bluetooth cheatsheet section). There is a succinct guide here: hsmag.cc/N6p2IB. If you are using Raspbian Desktop, it’s a lot easier. Simply click on the Bluetooth logo on the top-right, and follow the instructions to pair your device.

    If you find OMXPlayer isn’t outputting any audio, try installing mpg321:

    sudo apt install mpg321

    And try again:

    mpg321 /path/to/audio/file.mp3

    But seriously

    If your project needs good audio, and the standard 3.5 mm output just isn’t cutting it, then it’s time to look at the wide range of DACs (digital-to-analogue converters) available in HAT format. It’s a crowded market, and the prices vary significantly depending on what you want from your device. Let’s start at the lower end, with major player HiFiBerry’s DAC+ Zero. This tiny HAT adds 192kHz/24-bit playback via two RCA phono ports for £12.50. If you’re serious about your audio, then you can consider the firm’s full HAT format high-resolution DAC+ Pro for £36, or really go for it with the DSP (digital sound processing) version for £67. All of these will require amplification, but the sound quality will rival audio components of a much higher price.

    Money no object? The Allo Katana is a monster DAC, and weighs in at £240, but outperforms £1000 equivalents

    If money is no object and your project requires the best possible reproduction, then you can consider going full audiophile. There are some amazing high-end HATs out there, but one of the best-performing ones we’ve seen is the PecanPi DAC. Its creator Leonid Ayzenshtat sourced each individual component carefully, always choosing the best-in-class. He even used a separate DAC for each audio channel. The resulting board may make your wallet wince at around £200 for the bare board, but the resulting audio is good enough to be used in professional recording studios. If you’ve restored a gorgeous old radio back to showroom condition, you could do a lot worse than add the board in with a great amp and speaker.

    ALSA and PulseAudio

    There’s often confusion between these two systems. Raspbian comes pre-installed with ALSA (Advanced Linux Sound Architecture), which is the low-level software that makes sound work. It comes with a range of utilities to control output device, volume, and more. PulseAudio is a software layer that sits on top of ALSA to provide more features, including streaming capabilities. Chances are, if you need to do something a bit more clever than just play audio, you’ll need to install a PulseAudio server.

    Bluetooth cheatsheet

    If you want to pair a Bluetooth audio device (A2DP) on the command line, it can be a little hairy. Here’s a quick guide:

    First-time installation:

    sudo apt-get install pulseaudio pulseaudio-module-bluetooth sudo usermod -G bluetooth -a pi sudo reboot

    Start the PulseAudio server:

    pulseaudio --start

    Run the Bluetooth utility:

    bluetoothctl

    Put your speaker into pairing mode. Now, within the utility, run the following commands (pressing Enter after each one):

    power on agent on scan on

    Now wait for the list to populate. When you see your device…
    pair <dev>
    Where <dev> is the displayed long identifier for your device. You can just type in the first few characters and press Tab to auto-complete. Do the same for the following steps.

    trust <dev> connect <dev>

    Wait for the confirmation, then enter:

    quit <dev>

    Now try to play some audio using aplay (for WAV files) or mpg321 (for mp3). These instructions are adapted from the guide by Actuino at hsmag.cc/N6p2IB.

    File types

    There are command-line players available for just about every audio format in common use. Generally, MP3 provides the best balance of quality and space, but lower bit-rates result in lower sound quality. WAV is completely uncompressed, but can eat up your SSD card. If you don’t want to compromise on audio quality, try FLAC, which is identical in quality to WAV, but much smaller. To convert between audio types, consider installing FFmpeg, a powerful audio and video processing tool.

    HackSpace magazine

    This article comes direct from HackSpace magazine issue 28, out now and available in print from your local newsagent, the Raspberry Pi Store in Cambridge, and online from Raspberry Pi Press.

    If you love HackSpace magazine as much as we do, why not have a look at the subscription offers available, including the 12-month deal that comes with a free Adafruit Circuit Playground! Subscribers in the USA can now get a 12-month subscription for $60 when joining by the end of March!

    And, as always, you can download the free PDF from the Raspberry Pi Press website.

    Website: LINK

  • Raspberry Pi interactive wind chimes

    Raspberry Pi interactive wind chimes

    Reading Time: 2 minutes

    Grab yourself a Raspberry Pi, a Makey Makey, and some copper pipes: it’s interactive wind chime time!

    Perpetual Chimes

    Perpetual Chimes is a set of augmented wind chimes that offer an escapist experience where your collaboration composes the soundscape. Since there is no wind indoors, the chimes require audience interaction to gently tap or waft them and encourage/nurture the hidden sounds within – triggering sounds as the chimes strike one another.

    Normal wind chimes pale in comparison

    I don’t like wind chimes. There, I said it. I also don’t like the ticking of the second hand of analogue clocks, and I think these two dislikes might be related. There’s probably a name for this type of dislike, but I’ll leave the Googling to you.

    Sound designer Frazer Merrick’s interactive wind chimes may actually be the only wind chimes I can stand. And this is due, I believe, to the wonderful sounds they create when they touch, much more wonderful than regular wind chime sounds. And, obviously, because these wind chimes incorporate a Raspberry Pi 3.

    Perpetual Chimes is a set of augmented wind chimes that offer an escapist experience where your collaboration composes the soundscape. Since there is no wind indoors, the chimes require audience interaction to gently tap or waft them and encourage/nurture the hidden sounds within — triggering sounds as the chimes strike one another. Since the chimes make little acoustic noise, essentially they’re broken until you collaborate with them.

    Follow the Instructables tutorial to create your own!

    Website: LINK

  • Play multiple sounds simultaneously with a Raspberry Pi

    Play multiple sounds simultaneously with a Raspberry Pi

    Reading Time: 2 minutes

    Playing sound through a Raspberry Pi is a simple enough process. But what if you want to play multiple sounds through multiple speakers at the same time? Lucky for us, Devon Bray figured out how to do it.

    Play multiple audio files simultaneously with Raspberry Pi

    Artist’s Website: http://www.saradittrich.com/ Blog Post: http://www.esologic.com/multi-audio/ Ever wanted to have multiple different sound files playing on different output devices attached to a host computer? Say you’re writing a DJing application where you want one mix for headphones and one for the speakers.

    Multiple audio files through multiple speakers

    While working with artist Sara Dittrich on her These Blobs installation for Provincetown Art Association and Museum, Devon was faced with the challenge of playing “8 different mono sound files on 8 different loudspeakers”. Not an easy task, and one that most online tutorials simply do not cover.

    These Blobs - Sarah Dittrich

    These Blobs by Sara Dittrich

    Turning to the sounddevice Python library for help, Devon got to work designing the hardware and code for the project.

    The job was to create some kind of box that could play eight different audio files at the same time on eight different unpowered speakers. New audio files had to be able to be loaded via a USB thumb drive, enabling the user to easily switch files without having to use any sort of UI. Everything also had to be under five inches tall and super easy to power on and off.

    Devon’s build uses a 12v 10 amp power supply controlled via a DC/DC converter. This supply powers the Raspberry Pi 3B+ and four $15 audio amplifiers, which in turn control simple non-powered speakers designed for use in laptops. As the sound is only required in mono, the four amplifiers can provide two audio tracks each, each track using a channel usually reserved for left or right audio output.

    A full breakdown of the project can be seen in the video above, with more information available on Devon’s website, including the link to the GitHub repo.

    And you can see the final project in action too! Watch a video of Sara Dittrich’s installation below, and find more of her work on her website.

    These Blobs

    Poem written and recorded by Daniel Sofaer, speakers, conduit, clay, spray paint, electrical components; 4′ x 4′ x 5′ ft.

    Website: LINK

  • Drake Breaks World Record Playing Fortnite

    Drake Breaks World Record Playing Fortnite

    Reading Time: 2 minutes

    Unless you’ve been living under a rock for the past few months Fornite: Battle Royale has been taking the online multiplayer PvP arena by storm, even big-named artists like Drake are obsessively playing it.

    When the 6 God isn’t going around donating large amounts of money to help better peoples lives (shout out to God’s Plan) Toronto’s favourite son loves to play video games, with the MMO battle royale game being his latest addiction.

    Just to prove how dedicated he is to the game, he hopped on Twitch and is currently livestreaming a session with Ninja who has one of the most popular accounts on video game streaming platform. The two are currently livestreaming a session which has broken the world record for people watching live.

    As well as being one of the most popular rappers today, he’s also the most ‘meme-able’

    The previous record for most watched livestream stood at 400,000 – Drake and Ninja have smashed it with a world record breaking 500,000. You can call it impressive, extraordinary or whatever great epitaphs you can think of – I’d like to think it was God’s Plan.

    During the live stream he was joined by fellow rapper, and baby father to Kylie Jenner’s daughter Stormi, Travis Scott and NFL wide-receiver JuJu Smith-Schuster.

    During the livestream Drake mentions he’s been playing Fortnite for a month or two and – along with his entourage – plays to wind down during his 20-hour studio sessions.

    While Fornite isn’t the first online battle royale game, that distinction goes to PlayerUnknown Battlegrounds, it has quickly become the most popular. It has single handily surpassed PUBG in both player count and views.

    This week Fornite’s developers Epic Games, who are responsible for other classics such as the Gears of War and Unreal series, announced they’ll be taking the franchise to mobile phones next. Invitations have already been sent out to people with iOS to get early access to the smartphone version of the game.

    Please enable Javascript to watch this video

    Android users will have to wait a few more months, unfortunately.

    In a blog post, the game’s development team wrote:

    On phones and tablets, Fortnite is the same 100-player game you know from PlayStation 4, Xbox One, PC and Mac.

    Same gameplay, same map, same content, same weekly updates.

    In partnership with Sony, Fortnite Battle Royale will support Cross Play and Cross Progression between PlayStation 4, PC, Mac, iOS and eventually Android.

    This means players across devices can squad up with friends and play together.

    Please enable Javascript to watch this video

    In Drake’s video for God’s Plan his team were given a budget of just under $1 million – $996,631.90 to be exact – in production, but rather than go all out on some high budget, throwaway instantly-forgettable, overblown vanity project, they went in the complete opposite direction.

    They gave away every last cent of the video’s budget, which explains the string of charitable gestures Drake has taken part in recently.

  • PS4 Startup Beep/Fan Noise

    PS4 Startup Beep/Fan Noise

    Reading Time: < 1 minute

    Here is a video showing the PS4′s startup beep and the fan noise, due to the stupid intro and outro videos in this clip, don’t watch with headphones:

    Official Source: http://www.vg247.com/2013/09/25/check-out-ps4s-startup-beep-and-fan-noise/

    http://www.youtube.com/watch?v=RZX4NzQ2084&feature=player_embedded