Introduction: DIY a Wi-Fi Speaker
Here share my latest project, a Wi-Fi Speaker.
This speaker is based on LinkIt Smart 7688, an open source development board that featured with Wi-Fi and Audio.
I made a wooden box to make the speaker look retro, wooden will provide nice sound as well.
This speaker has the simple hardware and shell, it won't be hard if you has some knowledge of electronic, any way if you want one, you can make it.
Step 1: The Video
Here's a simple video to help you to have a overview of this speaker.
Step 2: Prepare the Stuff
There's something need to be prepared.
Electrical Parts
- Smart LinkIt 7688 Duo
- Breakout for LinkIt 7688
- Grove - LCD RGB Backlight
- 5'' Horn
- High gain Power Amplifier board
- WS2812B LED
- Logic DC Jack
- 12V Switching Power
Wooden board & Acrylic
- 5mm width wooden board
- 3mm lucid acrylic
Others
- M3 Nut
- M3 Cu pillar
Tools
- Laser Cutter
- glue gun
- screwdriver
Step 3: Laser Cutting the Speaker Body
You need a PC and a laser cutter here. Generally speaking you wouldn't have such a machine at home. Never mind, you can find a laser cutter in any maker space.
And there's many place supply the laser cutting service, just upload you file and pay for it, then you will get the things days later.
You can download the 2d file attached and make some change for your need.
Attachments
Step 4: Building the Speaker Body
For this step we will need:
- Glue gun
- Wooden white glue
After the previous step, we got 6 piece of wooden board. Put them(expect the back one) together with the glue gun.
Step 5: Fitting the Electronic Modules
For this step we will need:
- glue gun
- M3 nut x 20
- M3 Cu pillar x 10
Screwdriver
There are many parts of electronic modules, include:
- High gain Power Amplifier board with two Volume knob
- Grove - LCD RGB Backlight
- Breakout for LinkIt 7688
- 5'' Horn
- Acrylic
For the details of the fitting, you can refer to the above images.
Step 6: Fitting the Power
The High gain Power Amplifier board need 12VDC and the LinkIt 7688 need a 5VDC.
I was thinking that make it 2 power input, one for 12V and the other 5V. But's it's some kind of inconvenient.
Finally I got a AC -> 12VDC switch power, about the 5VDC, I got a Logic DC Jack, which will buck 12V to 5V.
As the LinkIt 7688 is micro usb input, and Logic DC Jack Grove output, so we need to make ge Grove -> Micro USB cable.
Step 7: Programming
There's few steps to follow:
1. Connect 7688 to a Wi-Fi router
& vi /etc/config/wireless config wifi-iface 'sta' option device 'radio0' option mode 'sta' option network 'wan' option ifname 'apcli0' option led 'mediatek:orange:wifi' option ssid 'UplinkAp' # Setting SSID option key 'SecretKey' # Setting paas word option encryption 'psk' option disabled '0' # Enable setting # Save and exit & wifi down & wifi up # wait for WiFi connecting</p>
2. Install shairport
& opkg updat & opkg install avahi-daemon dbus libao libavahi libavahi-client libdbus libexpat shairport
3. Enable startup running
& /etc/init.d/shairport enable & /etc/init.d/shairport start
4. Change shairport Configuration
& echo “” > /etc/config/shairport & vi /etc/config/shairport config shairport option name 'Shairport_lks7688' option password '' option port '5002' option buffer '256' option log '/var/log/shairport' option cmd_start '' option cmd_stop '' option cmd_wait '0' option audio_output '' option mdns '' & reboot
5. Now use iphone to push music to Shairport_lks7688
6. Code to display music and IP address through Grove - LCD RGB Backlight
# Copy and save code bellow to /root/ rgb_lcd_display_mpc_music.js function ledStrip_init(){ var m = require("mraa"); i2c = new m.I2c(0); i2c.address(0x23); var buf1 = new Buffer([0x80, 0, 0xCC, 0, 0xCC]) var buf2 = new Buffer([0x80, 1, 0xCC, 0, 0xCC]) var buf3 = new Buffer([0x80, 2, 0xCC, 0, 0xCC]) var buf4 = new Buffer([0x80, 3, 0xCC, 0, 0xCC]) var buf5 = new Buffer([0x80, 4, 0xCC, 0, 0xCC]) i2c.write(buf1); i2c.write(buf2); i2c.write(buf3); i2c.write(buf4); i2c.write(buf5); }; setTimeout(ledStrip_init, 2000); var LCD = require('jsupm_i2clcd'); // Initialize Jhd1313m1 at 0x62 (RGB_ADDRESS) and 0x3E (LCD_ADDRESS) var myLcd = new LCD.Jhd1313m1 (0, 0x3E, 0x62); myLcd.setCursor(0,0); // RGB Blue //myLcd.setColor(53, 39, 249); // RGB Red function clear_lcd(line){ myLcd.setCursor(line, 0); myLcd.write(" "); myLcd.setCursor(line, 0); } var musicName = ""; var ipAddr = ""; function display_music_name(){ var exec = require('child_process').exec; exec('mpc status | awk \'{if(NR==1) print}\'',function(error, stdout, stderr){ if(musicName != stdout) { console.log(stdout); clear_lcd(0); myLcd.write(stdout); } musicName = stdout; }); exec('ifconfig | awk \'{if(NR==2) print $2}\'', function(error, stdout, stderr){ if(ipAddr != stdout) { console.log(stdout); clear_lcd(1); myLcd.write(stdout.slice(4)); } ipAddr = stdout; }); } setInterval(display_music_name, 1000);
7. Copy and save Startup running
script /etc/init.d/rgb_lcd_mpc #!/bin/ash /etc/rc.common<br>START=99 start() { sleep 5 # make sure boot process is done, no more console msgs . /etc/profile echo $PATH node /root/rgb_lcd_display_mpc_music.js } stop() { killall node } Step 8 – Enable startup running script & /etc/init.d/ rgb_lcd_mpc enable & /etc/init.d/ rgb_lcd_mpc start& Finally, connect cables and restart lks7688.
Step 8: Play a Music
Now, open your music player and enjoy.
cheers.
23 Comments
Question 5 years ago on Introduction
Hai
Over all price for implementation
Answer 4 years ago
about $100-$130
Question 4 years ago
Do you guys have any shematics?
5 years ago
Sir i have to learn linklt7688 give sorces for it
6 years ago
I connected the speaker and when iam running a mp3 file using madplay,it is not coming out of speaker and i am able to hear through audio jack using headphones.
I am using linkitsmart 7688 breakoutboard v2.0.
Pleaae correct me where i need to change to give output through stereo speakers,i am using 8ohm 0.5w speaker.
Reply 5 years ago
I had same problem. Did you find out the solution for this? Tks
Reply 6 years ago
you most certainly need a for a speaker.
6 years ago
can this be set up without an existing wifi network? Can it become portable outside when there is no wifi? Can it create the wifi network for the phone to stream to the speaker?
Basically I'm looking for a truly portable outdoor speaker that has better sound and range than Bluetooth? I have a Auris Skye that does this, but they don't make it any more for some reason and want to make mother speaker.
6 years ago
Hi! I don't know if you have time to help me, but... I'm usually pretty good at figuring things out and never afraid to jump into the deep end. I've gotta say, I'm in awe of your speaker. Very cool. I'd really like to make one, but I have no clue what you are doing when it comes to your programming. Could you point me in the right direction to help me read up on the language you are using, the ins and outs of wifi, etc. Basically, how would I go from 0 to being able to understand your project? Treat me like an idiot haha, but just know I'm not one. Thank you for any help you can give!
7 years ago
Noice instructable _loovee_!
Thanks for contributing this. Educational for those of us who are just starting to learn about IoT concepts.
7 years ago
Hey, great project! Is it possible to do a multi-room wifi setup similar to what SONOS does?
Reply 7 years ago
yep, just set the different address. have fun.
7 years ago
what software did u use for the coding and what language?
Reply 7 years ago
Hi, it's nodejs, I used putty, thanks.
7 years ago
Awesome, seems like the best design you've ever done!!!!
Reply 7 years ago
Thanks man. How are you going recently. Have tea when you are free.
7 years ago
hi
this project is awesome
I have one question!!
can I use and play music with android?
thanks
Reply 7 years ago
yes of curse, actually my phone is an Android phone, you can refer to Step8, it's a Smartisan T1.
7 years ago
Wow this is an awsome speaker
Reply 7 years ago
thanks