[Chris] wrote us to share a neat technique he has been using to program the Arduinos he uses in his projects. He likes to build bare bones Arduino clones rather than sacrifice full dev boards, and instead of programming them via traditional means, he is using his computer’s sound card.
He builds a simple dead bug Arduino (which he calls an Audioino) using a handful of resistors, a pair of caps, an LED, a reset switch, and most importantly – an audio jack. After burning a special audio bootloader to the chip, he can connect the Arduino directly into his computer’s speaker port for programming.
Once the microcontroller is connected to his computer, he runs the IDE-generated hex file through a Java app he created, which converts the data into a WAV file. With the Arduino put into programming mode, he simply plays the WAV file with an audio player, and the code is uploaded.
He says that this method of programming comes in handy in certain cases where he builds things for friends, because they can easily update the software on their own without a lot of fuss.
Load freebird.pde! Load freebird.pde!
That made my day.
HaD needs a COTD like Gizmodo for this exact reason. Bravo Chris!
Wow, maybe cassette-recorded programs might make a comeback!
I remember that we had a radio show that was sending programs over the air for you to record. They had to cancel the ‘show’. You can take a guess on why.
Because it seemed silly to podcast it?
Sending out commercial proprietary software? Or the regulations didn’t allow data transmission in that radio service.
“You blew up my speakers!”
Back in the 80s, using a BBC Micro with a teletext adapter box it was not only possible to read teletext/ceefax, once a week they broadcast programs that you could download. Took an age because they were sent in many many small chunks.
Sadly I got my own BBC Master Compact with a teletext adapter about a week after they stopped broadcasting programs.
Programs broadcast over the tv waves man!
I remember they did that with Basicode* games?
* https://secure.wikimedia.org/wikipedia/en/wiki/BASICODE
I love it! Reminds me of saving programs to audio cassette tapes from that old Apple ][.
Shit that’s awesome.
wow that is one interesting design.
Programming with an MP3 player, love it.
Even better .. tie a mp3-player full of software to an Audioino and a mini breadboard and small psu. It’s a portable arduino-device.
Neat technique but it’s sad what people call arduino’s nowaday. I don’t see how a bare AVR with some fancy bootloader should be called arduino or xduino for the matter.
Seconded
Maybe because is arduino IDE-compatible?
Agree. I remember when someone did this but with a USB jack and we asked why it was an arduino… the general consensus cause it had the arduino bootloader… fair enough. This is an AVR microcontroller with a neat bootloader. Cool project though.
What more is the Arduino besides the bootloader, IDE and the class library? Does it really matter, if the thing does not have pin headers in uncomfortable places and a USB programmer is not built in?
…Brillant!
This reduces the cost of an Arduino clone to under $10! $~4 for micro, plus a $1.50 audio jack, and approx $1 in resistors, caps, and other items.
And that was at one off purchase prices…
I might have to start using this for long term embedded projects that don’t need shields. Updating would be as simple as bringing over a MP3 player. So much easier and cheaper than using an actual arduino to update, or wirelessly with an xbee, or using a usb adapter.
Brilliant !!
I wondered about doing this exact thing so I could program them using a cell phone. You would just drop all your sound files (programs) into DropBox on your PC and then use your Android phone to program while out in the field.
This is exactly what I was looking for! Great job!
I’m curious if the audio compression over a cell phone or even from mp3 compression would prevent this from working reliably or working at all?
Pretty much any cell phone or MP3 player will play an uncompressed WAV file, thus avoiding any artifacts.
You could always use FLACs.
This will save my day i guess. I am currently working on a small project where i am using the arduino ide but don’t want to include a full board in my system. the atmega is enough.. I will surely give it a go. And 10/10 points on creativity here fokes.
@Benjamin I’m really certain this alone will not replace an Arduino. This only programs the microcontroller. While that is one step in eliminating the need to dedicate an entire Arduino to on project, you will still have to design,and build the supporting circuitry. Build anyway as it seems there are plenty of circuits published to the web.
man, some peoples are crazy, that’s it, really sick crazy peoples that’s what they are.
and I’m redundant, that’s the kind of person I am, redundant.
Seconded. :)
Cellbots and folks got this to work dynamically on a cell phone for serial data. I’m sure you could program using your cell phone and an audio file (in fact thats how i proved the dynamic stuff could be done).
Just make sure you store it as a wave in some native bitrate (arbitrary sampling was not accepted by the phone’s DAC).
Very nice hack!
PRESS PLAY ON TAPE
(Also, this idea is consummately awesome.)
If you plugged in a microphone, Kevin Mitnick could program it by whistling :)
I get this reference.
Now show me how to decode DTMF with an AVR and I’ll be happy.
Simple. Make a program that looks for xxxxHz tones and then figures out which 2 are being used at the same time. This gives you 2 bits from each frequency.
Hint: If you are planning on using a general FFT, you’re doing it wrong! An Apple II did this in software…
If you have trouble, this is old school bare metal machine language hacking to get the most from the least at it’s finest. They gave us all those counters for a reason.
I wanted to do the opposite – use a sound card to spy on an I2C bus(possibly slowed down). Or at the very least, to record the output of a bus spy’s buffer. I was thinking that I wouldn’t even need modulation at low enough of a speed. Just post processing by the ever-so-convenient GigaFLOP CPU that just happens to be connected to the soundcard.
Hehe, nice use of a common output port that will likely be on ANY computer you’re likely to come across.
Oops meant for that 2nd post at the bottom. Sorry about that. http://www.atmel.com/atmel/acrobat/doc1982.pdf Speak of the devil, BTW. Just from using Google to search Atmel’s site. :)
Crud didn’t read it – that’s an encoder.
http://avr.15.forumer.com/a/dtmf-decoding-with-1bit-adcs_post1081.html has a decoder implementation. I actually read this one, heh. Although technically DTMF is sinewaves, you don’t have to use some DTMF-specific chip or frequency detector. I still think there has to be a way without using DCTs/FFTs/etc.
DTMF decoding with no Fourier Transforms or such:
http://www.romanblack.com/DTMF/DTMF_alg.htm
Count the spacings between the pulses. I looked up the information on the Apple II software modems and it seems that a lot used DTMF decoder chips instead of the 6502(CPU). The ‘Cat’ modems come to mind.
Goertzel algorithm does that with a very little computation power nor memory
hahahahaah you win an internet today XD
But now I’m curious how this sounds, if it sounds at all.
A freaking orgasmic set-up would be an old telephone modem (talking about with the handset and all that) programming through the network.
Been wondering about playing/parsing touchtones over BT headset for a cheap wireless solution…
I imagine the government will one day use a similar method to brainwash us. Way to be ahead of the curve!
Between public education and reality tv, how many more ways does the government need to program the sheeple?
I thought my zeptoprog was cool, but this is just killer beans.
I wonder if it would work well enough with a microphone and small amplifier to program “wireless”.
Fucking genius.
This will probably play well with my audio-to-serial thingie that was on hackaday a while ago… Only thing is, how do they deal with levels? I thought you’d need an op amp or at least a transistor to do level shfiting. Maybe that’s just for phones since they aren’t designed to drive big speakers!
People take note that the LINE OUT of the soundcard is being used, NOT the speaker output. That rules out some of the musing taking place, except using a microphone for “wireless” programming. You know of course the telephone is going to ring when you do that.
Just wondering about what would happen if someone played an arbitrary sound file.
Would the bootloader burn it and bork the chip or just reject it?
Also, while ok if you’re just using for upload new firmware for friends etc, having to press the reset button at the correct time to trigger reprogramming would not be ideal/appropriate for a commercial product.
Thinking about it though, if you used a stereo signal, one channel could be used for data and the other could send a short pulse which triggered the reset line to be pulled low.
You’d need more components than would fit on a deadbug design, but if you were making a commercial product that would be an issue.
Overall, very interesting work.
Oops. Last paragraph should read:
You’d need more components than would fit on a deadbug design, but if you were making a commercial product that would NOTbe an issue.
Actually, the only extra component would be a capacitor, so it shouldn’t be a problem.
(and the original arduino didn’t do autoreset either…)
Wait. The link doesn’t seem to indicate that a special boot loader is necessary (other than just the standard arduinoISP boot loader). What’s up?
Well if it works as well as Chris describes, it may lead more to duplicate projects that use this family of microcontroller. A thank you to Chris for taking the time to share this. Keeping in mind the differences between microcontrollers could this be used to program the on board flash of other microcontrollers?
“program the Arduino”; so has Arduino become synonymous with the Amtel AVR microcontroller? Just one more thing we need to keep in context when we read articles. I suppose to start referring to the actual microcontroller would confuse the hell of those who came to the world of microcontrollers, and electronics via the Arduino, and really don’t understand how versatile microcontrollers can be beyond the dedicated development boards.
Valid point. Since its not really an arduino its just a chip with some elegantly connected wires..
Arduino is hard to disambiguate. Its a hardware platform as well as an ide and a set of libraries… So it could be some random Atmega running “Arduino”.
I consider Arduino an ecosystem :)
yeah!
pretty awesome hack. does any type of hardware compression or cleaning ever interfere?
Thats impressive.
I was thinking along those lines to see if a micro could be programmed using a Bluetooth headset so any old cheap touchscreen phone could be used to burn a chip.
It got me thinking though, what about using this to program the Microchip PIC series as these often need an expensive programmer.
What about 24Cxx and larger E2PROMs?
people always bitch and moan about “expensive” microchip programmers, but the pickit2 and pickit3 (clones) are like £20 – or just use a parallel port programmer. in my experience, atmel programmers are of similar cost.
In reality, the “debug” functionality justifies the price tag imo, and allows you to do stuff you just cant do without a huge load of code overhead on a usb bootloader.
This is great indeed. I wonder if it would work with the ATmega8? ;-)
O man, if you thought the HAD comments were out of control, forget it. Do you see some of the comments on the original post in German?
CLASSY!
Great job, this is one of my favorite hacks on here in the last couple of years. Throw that .wav on an iPod and you can update it anywhere. If you could operate the Arduinos using audio that’d be even cooler.
Unique thinking! I’m impressed, tho’ some are not…
Reminds me of my old C-64 with datasette.
My first post ever was deleted earlier after years of checking this site everyday. WTF?? I thought this hack was awesome. The fact that you can throw an update on an iPod in .wav form is really slick. I’d like to see an “audio hack” category here
I was really, really, really, really, really excited about this… Until I read that you still need to burn this audio boot-loader? It’s still cool, just not quite as practical as I had wished. Sad face.
great and nice prototyping with resistor n such, I been wanting to implement some digital communication out an audio jack, What think yalls is the achievable baud?
20khz / 8bits = 2.5MB/s
could it be?
2.5KB/s (less any overhead)
Thank you for all the nice comments.
If someone didn’t find the bootloader link:
http://www.hobby-roboter.de/forum/viewtopic.php?f=4&t=127
Remark:
The IDE produces WAV-Files to program the Audioino. Converting this WAV-Files into MP3s will not work because MP3 is not a lossless compression. Therefore if you want to distribute your programs as sound file it has to be a WAV.
Hardware issues:
the capacitor in the audio line should be changed from 10nF to 100nF. This improves design stability.
“great and nice prototyping with resistor n such, I been wanting to implement some digital communication out an audio jack, What think yalls is the achievable baud?”
In this project
http://www.mikrocontroller.net/topic/224911
the achieved about 20kBit/s. For digital transmission this is close to the maximum possible. If you use audio out with analog signals and a quite complicated algorithm, the theoretical maximum would be the data rate put into the sound channel: 44kHz*16bit
Sweet. Seems like this also enables any smartphone with to program an Arduino. At least in theory.
I like to use IR for programming chips. You only need add an IR sensor like the ones used for remote control. Cost about $1 each. Write the program on the pc and output it as a series of pulses over serial. Also good for environments where you don’t want to physically connect the device.
The Asuro uses this principle:
http://www.arexx.com/arexx.php?cmd=goto&cparam=p_asuro
Programming by IR needs an interface on the PC side.
For programming you can use laptops that have IRDA ports, most do. I’ve done the sound card thing and while it works okay I finalized on the IR route because of the ground isolation it provides. I had issues with some laptops having power supplies that maintain a ground connection to the wall outlet and that is bad when working with devices powered off isolated supplies.
Why are you people calling this an “Arduino clone”? It’s a freaking atmel processor. I have been playing with these since the 90’s… Now someone starts calling them “Arduinos” and its suddenly new to you all!? If I call my old buick a ferrari, will one of you pay lots of moneyz for it???
Because you can use the Arduino IDE and the Arduino Library to write programs.
And the design was inspired from this:
http://www.youtube.com/watch?v=yMzRi4AAvV4
I guess it depends on your definition of arudino clone. If yours is one that requires the shields to be used then I guess it isn’t a clone. My definition is anything that runs the code the arduino libraries and IDE output. One of the things holding the arduino back is the lack of people willing to use it without a shield . There is nothing wrong with arduino programming like he has shown here and yes to me that makes it still an arduino clone.
Android communication with audio not using dtmf.
http://www.robots-everywhere.com/re_wiki/index.php?title=Serial_on_Android_using_the_audio_port
I just dont get it, you have to load a bootloader, so that means you already have a programmer. so … why? is 4 wires really that hard to hook up?
If you don’t get it then you need to read the article again and again until you do…
>He says that this method of programming comes in handy in certain cases where he builds things for friends, because they can easily update the software on their own without a lot of fuss.
He’s got a programmer (that’s how he gets the bootloader onto the chips in the first place) but not everyone does.
This means that when he makes something for his friends, or even sells something commercially, not all of his friends/customers need to have programmers also, they can just play a sound file on their computer.
WOW this is just SUPER :-)
now all we need to do is to bit-bang the sound through USB and we can program AVR’s using USB with no USB-Serial adapters or PL-2303 chip needed! this is just fantastic!..:)
— GTG find those USB speakers… :D
BTW are there versions of this for other chips?..:D
There’s a lot of interest in gadgets that plug into the audio jack of the iPhone or Android.
Perhaps program an Arduino from your smart phone?
I would love to have this on an atmega8.
I found a major issue: some soundcards have an inverted audio output. The initial bootloader will not work with this sound cards.
I made a new version which solves this problem. You will find it here:
http://www.hobby-roboter.de/forum/viewtopic.php?f=4&t=127