<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Audio on BlocNotes</title>
    <link>https://notes.iopush.net/tags/audio/</link>
    <description>Recent content in Audio on BlocNotes</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <lastBuildDate>Wed, 23 Dec 2020 00:00:00 +0000</lastBuildDate><atom:link href="https://notes.iopush.net/tags/audio/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>nfcAudio - WiFi enabled MP3 player with NFC capability</title>
      <link>https://notes.iopush.net/blog/2020/12-nfcaudio-nfc-controlled-mp3-player/</link>
      <pubDate>Wed, 23 Dec 2020 00:00:00 +0000</pubDate>
      
      <guid>https://notes.iopush.net/blog/2020/12-nfcaudio-nfc-controlled-mp3-player/</guid>
      <description>&lt;p&gt;nfcAudio is an MP3 player, with audio files selected thanks to an NFC tag placed
on top of it. I build this two years ago for my kid so he can play by himself
his preferred nursery rhymes and songs, it is still used at least once a week
:-)&lt;/p&gt;
&lt;p&gt;It is powered by an ESP8266 to play audio from a remote server, an I2S DAC
driving the speaker and an NFC reader. Thanks to WiFi we can use it to play
local files or any webradio stream from the Internet.&lt;/p&gt;
    
    
        
        
        
        
    

    
    
    

    
    







  


    

    
        &lt;p&gt;&lt;span class=&#34;image center&#34;&gt;
            &lt;img src=&#34;https://notes.iopush.net/blog/2020/12-nfcaudio-nfc-controlled-mp3-player/nfcaudio-finished.jpg&#34; alt=&#34;Finished nfcAudio project&#34;&gt;
        &lt;/span&gt;&lt;/p&gt;
        &lt;p&gt;&lt;div class=&#34;align-center&#34; style=&#34;font-weight: bold;&#34;&gt;
            Finished nfcAudio project
        &lt;/div&gt;&lt;/p&gt;
    


&lt;h1 id=&#34;hardware&#34;&gt;Hardware&lt;/h1&gt;
&lt;h2 id=&#34;electronics&#34;&gt;Electronics&lt;/h2&gt;
&lt;p&gt;I just used several evaluation boards, linked by soldered wires:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;ESP8266: &lt;a href=&#34;https://www.wemos.cc/en/latest/d1/d1_mini.html&#34;&gt;Wemos Mini D1&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;NFC reader: &lt;a href=&#34;https://www.nxp.com/docs/en/nxp/data-sheets/PN532_C1.pdf&#34;&gt;PN532&lt;/a&gt;
board from Aliexpress&lt;/li&gt;
&lt;li&gt;I2S DAC:
&lt;a href=&#34;https://datasheets.maximintegrated.com/en/ds/MAX98357A-MAX98357B.pdf&#34;&gt;MAX98357A&lt;/a&gt;
board from Aliexpress&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The MAX98357A I2S DAC can easily be replaced by another I2S, or even a single
transistor: please see
&lt;a href=&#34;https://github.com/earlephilhower/ESP8266Audio#i2s-dacs&#34;&gt;ESP8266Audio&lt;/a&gt; project
which is wonderfully documented.&lt;/p&gt;
&lt;h2 id=&#34;case&#34;&gt;Case&lt;/h2&gt;
&lt;p&gt;I designed a laser-cut box to hold everything together and allow NFC tag
storage. All parts of the case are bolted, electronic boards are fixed thanks to
zip ties, then the speaker is hot glued.&lt;/p&gt;



    
    
        
        
        
        
    

    
    
    

    
    







  


    

    
        &lt;p&gt;&lt;span class=&#34;image center&#34;&gt;
            &lt;img src=&#34;https://notes.iopush.net/blog/2020/12-nfcaudio-nfc-controlled-mp3-player/nfcaudio-case-speaker.jpg&#34; alt=&#34;Speaker under the case&#34;&gt;
        &lt;/span&gt;&lt;/p&gt;
        &lt;p&gt;&lt;div class=&#34;align-center&#34; style=&#34;font-weight: bold;&#34;&gt;
            Speaker under the case
        &lt;/div&gt;&lt;/p&gt;
    





    
    
        
        
        
        
    

    
    
    

    
    







  


    

    
        &lt;p&gt;&lt;span class=&#34;image center&#34;&gt;
            &lt;img src=&#34;https://notes.iopush.net/blog/2020/12-nfcaudio-nfc-controlled-mp3-player/nfcaudio-case-opened.jpg&#34; alt=&#34;Top opened, with the PN532&#34;&gt;
        &lt;/span&gt;&lt;/p&gt;
        &lt;p&gt;&lt;div class=&#34;align-center&#34; style=&#34;font-weight: bold;&#34;&gt;
            Top opened, with the PN532
        &lt;/div&gt;&lt;/p&gt;
    


&lt;h2 id=&#34;tags&#34;&gt;Tags&lt;/h2&gt;
&lt;p&gt;All RFID 14443 tags can be used with the PN532 reader. I saw some projects using
&amp;ldquo;credit card&amp;rdquo; sized tags which can be printed with some inkjet printers, but I
used small stickers so I can print an image on any printer, stick the tag on it,
then put everything in thermal laminated film.&lt;/p&gt;



    
    
        
        
        
        
    

    
    
    

    
    







  


    

    
        &lt;p&gt;&lt;span class=&#34;image center&#34;&gt;
            &lt;img src=&#34;https://notes.iopush.net/blog/2020/12-nfcaudio-nfc-controlled-mp3-player/nfc-tag.jpg&#34; alt=&#34;Adhesive tag&#34;&gt;
        &lt;/span&gt;&lt;/p&gt;
        &lt;p&gt;&lt;div class=&#34;align-center&#34; style=&#34;font-weight: bold;&#34;&gt;
            Adhesive tag
        &lt;/div&gt;&lt;/p&gt;
    


&lt;h1 id=&#34;software&#34;&gt;Software&lt;/h1&gt;
&lt;p&gt;The most complicated part, MP3 management, is made by the great
&lt;a href=&#34;https://github.com/earlephilhower/ESP8266Audio&#34;&gt;ESP8266Audio&lt;/a&gt; project.&lt;/p&gt;
&lt;p&gt;Then I had to modify Adafruit&amp;rsquo;s PN532 library as it was only polling the NFC
chip, so I implemented interrupts to be able to detect new tags while playing
audio; my fork can be found &lt;a href=&#34;https://github.com/Oliv4945/nfcAudio&#34;&gt;here&lt;/a&gt;.
Adafruit never merged my pull request but two months ago another (cleaner) one
based on my work have been merged. As Adafruit changed all the library API since
2018 I am still using my fork.&lt;/p&gt;
&lt;p&gt;My code is really simple: wait for a tag to be detected, read its content then
play the associated file :-)&lt;/p&gt;
&lt;p&gt;I encode the MP3 URL directly in the tag in the standardized
&lt;a href=&#34;http://sweet.ua.pt/andre.zuquete/Aulas/IRFID/11-12/docs/NFC%20Data%20Exchange%20Format%20(NDEF).pdf&#34;&gt;NDEF&lt;/a&gt;
format so I wrote a small parser for it, then it was done. I program the tags
directly from my phone with the application
&lt;a href=&#34;https://play.google.com/store/apps/details?id=mr.nfcreader&amp;amp;hl=en&amp;amp;gl=US&#34;&gt;NFC Reader &amp;amp; Writer&lt;/a&gt;.&lt;/p&gt;
&lt;h1 id=&#34;project-sources&#34;&gt;Project sources&lt;/h1&gt;
&lt;p&gt;Everything, including case files and the wiring is available on
&lt;a href=&#34;https://github.com/Oliv4945/nfcAudio&#34;&gt;Github&lt;/a&gt;.&lt;/p&gt;</description>
    </item>
    
  </channel>
</rss>
