Skip navigation

Hi

I have searched the internet for a way to stream music to arduino using serial port.

What I actually wanted doing is playing music during the time arduino drive DC motor.

I can say I couldn't find a descent library for doing it, so I ended up doing it by myself.

 

I found some template which I can work with: Streaming Audio over Serial

But many things were missing, mostly the remote software and the parsing of WAV files...

 

After a weekend (my most productive times are weekends ) I managed to play sound in arduino and in the middle of playing the sound do something else (e.g. turn led pin on/off)

Since many files are needed (arduino code, wav parser, remote SW) I put it all on github.

https://github.com/idanre1/audioStreamArduino

 

To play sound i used 2N222 transistor in this setup:

 

 

My remote program is written in Perl, and I'm using linux as a remote station.

I am using ffmpeg as a generic converter to pre-process the files for arduino format (8 bit PCM), convert.sh file is provided under music folder.

 

I would like to hear your thought about it

  • Can somebody try run it on windows? I know many users like windows.
  • Do you think the code is robust enough?
    • Is it self explained how to add new codes?
  • Do you think this is something you could use for some project?
  • Using bluetooth serial module this project can be wireless.
    • Is there an android fan who thinks he can code Java remote client to interface with the code?
      I think a phone as a remote could be great...

 

Regards

Idan

I have bought a 4 digit seven segment module on banggood.

1 Pcs 0.561 Pcs 7-Segment 4 Digit Super Red LED Display Common Anode Time - US$1.79

these things cost about 2$ and i wanted to test if they worth anything.

20170301_061604.jpg

 

I have decided to connect them to arduino nano in a quick plug and play connection, so that it can be added for existing design using only 1 connector.

 

The thing about buying from china online is that you not always get what you order.

The module I received is CL5642BH and the module they published is HSX41056K.

So without any schematics i have decided to reverse engineering it using a breadboard.

 

Apparently the module turned out to be common anode as specified and with pin diagram as in arduino mega - How to wire up 4-digit 7-segment display? - Arduino Stack Exchange

 

When you google about these displays there is allot on confusion when to put the current limiting resistors, some say in the digits, some in the segments.

Actually I figured it out it can be both ways, only the code of the arduino is changed.

 

Then I found a nice library to deal with with that really simplifying it all

http://playground.arduino.cc/Main/SevenSegmentLibrary

 

You can config where you want to put the resistors and if its common anode/cathode or even more complex drivers and it works!

Just by reading the code you can see this lib is great.

 

Form factor:

As I mentioned i have decided to make the circuit as compact as possible.

Because of that I put the resistors on the digits (4 instead of 8 resistors) and I used perforated board.

 

The front side is quite neat, only display and 4 resistors (and connectors)

20170306_184553.jpg

 

The rear side is quite messy

20170306_184600.jpg

 

I was using an old IDE connector from an old computer to drive it all from the arduino

20170307_074424.jpg

 

 

Open items:

  • The SevSeg library uses loop to always update the leds (kind of a tdma over the leds), I read around there is a was to use charlieplexing for keeping the leds on without the fluctuations.
    Still I didnt find any way to implement it on my display.
    Anyone have an idea?
  • Decreasing cable amount. Is there a module that uses i2c to only take 2 cables out of the arduino onstead of 12 cables?

 

Video of operation:

 

Idan