SD Card instead of ADC

A "new fashioned" televisor, using an Arduino to drive the motor and display.

Moderators: Dave Moll, Andrew Davie, Steve Anderson

SD Card instead of ADC

Postby Andrew Davie » Tue Mar 14, 2017 3:51 pm

As luck would have it, I found some SD-card boards at work, and I had a bit of a epiphany. WHY am I trying to do ADC? Just so I can have a signal coming from a CD player line-out - which is another piece of equipment anyway. Playing from an outmoded storage format - an audio CD. Why am I doing this? Well, because that's the way it's done, right? Why not just have the files on a SD card, and read 'em off there. Suddenly I don't have the sampling/timing problems - because if I can read file(s) off a SD card fast enough, that solves pretty much all of the sampling problems - they will be high frequency and there will be no inaccuracy in sampling.

More to the point, why convert the original CD files to analog, then back to digital? Especially when I don't have to. So, maybe it's time to divert to adding one of these SD card boards to my arduino and trying to read files. It's not exactly old-skool NBTV but then again the use of a CD player isn't either. This could be the way to go!
User avatar
Andrew Davie
"Gomez!", "Oh Morticia."
 
Posts: 1590
Joined: Wed Jan 24, 2007 4:42 pm
Location: Queensland, Australia

Re: ADC - Sampling the NBTV signal

Postby Andrew Davie » Tue Mar 14, 2017 4:01 pm

Once you have it wired correctly, incredibly easy to use, as per this tutorial.
Here's a how-to dealing with the exact module I have in-hand, the HCMODU0044.

HCMODU0044_1_800_600.JPG
HCMODU0044_1_800_600.JPG (144.6 KiB) Viewed 6066 times
User avatar
Andrew Davie
"Gomez!", "Oh Morticia."
 
Posts: 1590
Joined: Wed Jan 24, 2007 4:42 pm
Location: Queensland, Australia

Re: SD Card instead of ADC

Postby Andrew Davie » Tue Mar 14, 2017 4:35 pm

User avatar
Andrew Davie
"Gomez!", "Oh Morticia."
 
Posts: 1590
Joined: Wed Jan 24, 2007 4:42 pm
Location: Queensland, Australia

Re: SD Card instead of ADC

Postby Andrew Davie » Tue Mar 14, 2017 10:04 pm

Well, I hooked one up to my Arduino and it kind of worked intermittently. The test program MOSTLY said that it couldn't detect anything, but occasionally said the unit was hooked up correctly and talking and had a card in it, the card type, but could not find FAT16/32 present. I changed wires, I changed pins, I used a 2nd module. No luck at all. Perhaps one time in 20 it worked to that point, but still wouldn't read the card. I've tried searching for people with similar issues - found one - but not of much help to me.
User avatar
Andrew Davie
"Gomez!", "Oh Morticia."
 
Posts: 1590
Joined: Wed Jan 24, 2007 4:42 pm
Location: Queensland, Australia

Re: SD Card instead of ADC

Postby Andrew Davie » Tue Mar 14, 2017 10:43 pm

It's working! I got lucky... was following the instructions here, particularly with the wiring... though I don't have this particular arduino shield shown in the image, it is clear that the SD card reader is wired to the digital pins on the arduino. Anyway, by chance I found the Arduino Micro wiring - and hey it has dedicated pins for SD card connection...

ArduinoMicro_SDCard (2).png
ArduinoMicro_SDCard (2).png (192.08 KiB) Viewed 6059 times


Tried the new wiring, except I'm using pin 4 instead of pin 10 for CS (card select). And it worked first time. Faaaantastic!

SD.jpg
SD.jpg (234.86 KiB) Viewed 6059 times


I did a little test program to read a file off the card and send the data to the serial terminal - worked perfectly. Couldn't be happier. Now I can plonk gigabytes of WAV files on a card and have them all on my televisor for playing. Of course I'll have to figure a neat way to select files. A LCD display would probably be overkill, but hey, having fun....

I guess the next step is to read a NBTV format WAV file and feed the most significant 8 bits to the PWM for the LEDs, spin the disc at 750 RPM and see if I can see a recognisable picture.
User avatar
Andrew Davie
"Gomez!", "Oh Morticia."
 
Posts: 1590
Joined: Wed Jan 24, 2007 4:42 pm
Location: Queensland, Australia

Re: SD Card instead of ADC

Postby gary » Tue Mar 14, 2017 11:37 pm

Great!

It probably sounds a little disingenuous to say I had the same epiphany earlier today Andrew, but I did, and it probably came from the same source, looking at other people using arduinos for playing audio.

The only caveat is that I can't bring myself to exclude the possibility of a camera in your future, but first things first.

Of course, I think YOU first really touched on this solution when I brought up the possibility of test cards, but how short sighted was I? Test cards? we don' need no steenkin' test cards! We'll have full NBTV video! :-)
gary
 

Re: SD Card instead of ADC

Postby Andrew Davie » Tue Mar 14, 2017 11:56 pm

gary wrote:Great!

It probably sounds a little disingenuous to say I had the same epiphany earlier today Andrew, but I did, and it probably came from the same source, looking at other people using arduinos for playing audio.

The only caveat is that I can't bring myself to exclude the possibility of a camera in your future, but first things first.

Of course, I think YOU first really touched on this solution when I brought up the possibility of test cards, but how short sighted was I? Test cards? we don' need no steenkin' test cards! We'll have full NBTV video! :-)


You're probably right. We don't work in a vacuum.
I was even thinking about having a full-colour hires pixel display LCD for selecting the track to play. How ironic would that be :)
User avatar
Andrew Davie
"Gomez!", "Oh Morticia."
 
Posts: 1590
Joined: Wed Jan 24, 2007 4:42 pm
Location: Queensland, Australia

Re: SD Card instead of ADC

Postby gary » Wed Mar 15, 2017 10:41 am

Andrew Davie wrote:
You're probably right. We don't work in a vacuum.
I was even thinking about having a full-colour hires pixel display LCD for selecting the track to play. How ironic would that be :)


weeeeeeellll guess what? LOL

It makes sense (at least to me ;-)) to have some kind of a monitor. It's what I find so useful with my raspi - you can use the LCD monitor (or TV, I used to use one of those little B&W portable TVs until I bought a cheap "in car" monitor) to "benchmark" what you are seeing on the NBTV monitor - the fact that the audio of the video you are playing is the NBTV signal means the the two pictures are more or less in sync.

Of course it's a little more difficult to do with an arduino, but it appears to possible:

youtu.be/WlBXiZpuncg
They appear to be doing something similar to what I do with a parallel port on an old pentium 4:

youtu.be/tW822Yv6b4s

I haven't gone into an arduino version in any detail, and, of course, this version is lacking proper grey scale, but...
gary
 

Re: SD Card instead of ADC

Postby Andrew Davie » Wed Mar 15, 2017 2:27 pm

Huge display. Cheap. Touch-sensitive (resistive, I think - not as good as capacitive). Simple interface. Would have to load images/graphics from SD card, as the Arduino Mirco has only 32K for program, so embedded graphics/fonts are out. But still, cheap enough that it might be fun to buy one to play with learn with.

Here's another, smaller, cheaper. It's interesting the note about 4M flash for user code and data. So actually maybe the images are stored on-board... interesting. I might get one of these.


Yes, this is interesting. You program the display using a windows tool "Nextion Editor" which allows you to make a number of screens, import pictures to them, define touch hotspots, and events. It's all self-encapsulated. Then you put the generated "ROM" for want of a better word on a MicroSD card and put it in the onboard slot. Power-on and the device detects the ROM and self-flashes. Then, when you're using the device in anger, the onboard program does all the graphics, and sends encoded events to the host - the touch commands, basically. It removes all of the storage requirements from the Arduino and puts 'em on the LCD display flash RAM. Interesting.
User avatar
Andrew Davie
"Gomez!", "Oh Morticia."
 
Posts: 1590
Joined: Wed Jan 24, 2007 4:42 pm
Location: Queensland, Australia

Re: SD Card instead of ADC

Postby gary » Wed Mar 15, 2017 3:34 pm

I have the second one but it looks slightly different (mine is v2.1)

I was rummaging around looking for that and found my Arduino Duemilanove.
It's incredible to think that this board is 8 years old!

IF ONLY I had the time!
gary
 


Return to Andrew Davie's Arduino Televisor

Who is online

Users browsing this forum: No registered users and 1 guest