That still doesn't answer the question. Why do you think you need an Arduino? You can buy an off-the-shelf 2.4Ghz RC transmitter and receiver for $26 from HobbyKing. You need an ESC (electronic speed controller) to operate the motor. This connects to one of the servo channels and converts the servo signal to engine speed / forward & reverse. There is no need to involve an Arduino unless there is something else you want to do that you are not telling us. Like if you want your hovercraft to have autonomous (i.e. robotic) functions.
There are many questions you need to ask. What is the desired bit resolution of the audio and the samples per second that you plan to record?
Sounds like you know this already if you're talking about using an ADC, but for the sake of it... Remember that a Mic gives you AC voltage. Sound pushes the diaphragm back and forth which generates very small negative and positive voltages. In order to read those on an analog pin on an Arduino, you need to level shift the signal so that negative voltage is read as 0, null voltage is read as 512, and full positive voltage is read as 1023. If you don't do that, you won't capture the audio properly. You'll only get half the waveform and it won't sound right.
The analog input pins on an Arduino will only give you a range of 0-1023 which is a 10-bit number. You would need to 2 bytes to store each sample. If you only need 8-bit audio, you could map the 10-bit number to an 8-bit number and only store a single byte per sample.
Now for the samples per second... 8kHz is 8000 samples per second. So if you were recording 8-bit audio, 1 second of audio would be 8000 bytes. If you are doing 10-bit audio, that would be 16,000 bytes for 1 second of audio!
As for file format... the most common would be a .wav file. A .wav file is basically just a header describing how may channels of audio, the sample rate, etc, followed by the raw stream of samples. You can find documentation explaining how to create .wav files on the Internet. The added bonus here is if you do it right, you can test your recordings on a computer to verify you are actually capturing the audio correctly.
As for playback... there are lots of different ways to about this. I'd look at using an SPI DAC (digital to analog converter) chip. Since you're already reading the .wav file back in via SPI, why not output the raw samples to the DAC?
You could of course pulse digital I/O pins with an added circuit to approximate the sound on a speaker, or you could try using the analog pins and level shift the voltage. In either case, you'll likely need an amplifier.
Yes, the UNO is just fine for the job. i2c is fairly easy to do with an Arduino. You'll just hook up 4 wires to the LCD. Do you know if the LCD is 3.3V or 5V? Connect SDA to A4 and SCL to A5. You'll need to use the Wire library. Take a look at the Wire example sketches in the Arduino IDE. Also plenty of tutorials talking to various i2c devices out there. Just google "Arduino i2c" and you'll get a bunch.
You'll need the datasheet for the LCD to learn what data you need to send to get it to do what you want. Usually it will look something like this:
I've actually got some related experience to this. I have been building a custom RC transmitter for a ship model with dual engine control (and rudder). While the ship is not exactly robotic, it has a lot of robotic concepts. Let me explain.
In a normal RC transmitter / receiver, you collect the stick positions from the joysticks by reading the analog pots. You then encode the stick values, usually to PPM, and then this is transmitted by radio. The radio receiver decodes the PPM for each of the servo channels and converts this to PWM which is output to the servos. For engines, you would have an ESC (electronic speed controller) that converts the PWM to engine speed and direction for each engine.
Here's how my controller is different. What I did is hack an existing RC transmitter and removed the circuit board from the transmitter. I disconnected both the joysticks and set them aside since I'm not using them. Each joystick has 2 axis, and each axis is hooked up to a 10k pot. I bought a quad 10k digital potentiometer chip which is an i2c chip that allows you to vary the voltage between the low and the high via microcontroller. It does exactly what a potentiometer does, but is controlled by a microcontroller. So... in my transmitter, I replaced the joysticks with my own controls, but the controls are connected to the Arduino, not the transmitter. I use the Arduino to read the values and then manage the analog signal being sent to the transmitter. Why would I go to all this trouble? Because my transmitter simulates the actual engine orders and response times on a WW2 Fletcher class destroyer. My transmitter has 2 engine telegraphs instead of throttle. When you want full speed ahead, you move both telegraphs to "Ahead Full". There is a slight delay followed by an audio acknowledgement of the order. (I use a serial-controlled MP3 player to play the sound effects. You'll actually hear "All ahead full, aye! followed by Ding! Ding!" which represents the engine room acknowledging the engine order. The the engines are commanded to slowly come up to speed, representing the actual time it would take for the turbines to get to full speed. Then if you throw the engine telegraphs into reverse, the same kind of thing happens. There's a an acknowledgement of the order, then the engines have to be slowed to a stop first (so you don't damage the turbines!)... then the "reverse" turbines are engaged and the motors start spinning in reverse, slowly at first, until they come up to speed. For steering, I'm actually using a rotary encoder. To get full 30 degree rudder deflection, you have to rotate the wheel 4 full revolutions, just like you would on the real ship. And on the real ship you are just setting the rudder position desired. The rudder motor in real life takes time to get the rudder to the ordered position. My transmitter simulates that as well.
I have a video demo of this whole thing on breadboard here:
Of course this is an RC model ship, and we could get in real trouble real quick by having such slow responses. There's of course an emergency override where the engine telegraphs become linear throttles and the steering only takes 1/2 a turn for full rudder deflection.
Anyway... since the transmitter is being driven by the Arduino, I could have the ship execute automatic patterns. For example, I could have button press make the ship run a figure 8 pattern. Or a zig-zag pattern. Or whatever. Completely autonomously.
One could also put an Arduino in the ship and have it read the PWM on some of the channels of the receiver and make certain ranges of values execute different functions on the ship.
Also, it turns out the transmitter board itself is really just a programmed microcontroller (MA803SA from Megawin) that is not all that different from an Atmel chip. The microcontroller is programmed to read the analog inputs for each of the channels, encodes these values as PPM data, then sends the PPM data to a separate RF module. One could reasonably figure out the PPM encoding and program an Arduino to create the PPM signal going to the RF module itself.
Anyway, I digress. For your robotic boat, I'd recommend using ESC speed controllers for the motors. Make sure you get brushed or brushless depending on whether the motors are brushed or brushless. Use a BEC (battery eliminator circuit) to provide 5V to the Arduino from a LiPo battery. Use a servo controller shield or servo controller on the Arduino (I really like Adafruit's 16-channel controller which can be had for $14.95 US) to output your signals to your motors and servos. If you ALSO want to be able to manually take over control by radio...consider hacking a HobbyKing 4Ch or 6CH transmitter and receiver... they are only like $26 US together. Cheap as heck and easy to hack into. Yes, there are more expensive TX/RC gear designed for hackers that have serial interfaces... but why bother spending $$$ on that when you can hack something for a fraction of the cost? Anyway, good luck on your project.
From what I can tell... the Flutter appears to be nothing more than an Arduino with a few extra components connected to the SPI bus and the i2c bus. Let me clarify... They appear to be using the CC1101 RF chip from Texas Instruments (although there was mention of using the CC1200 series in the future). This RF chip has an SPI interface. There is also hardware encryption done by an i2c chip, the ATMEL ATSHA204. They appear to have a simple radio library that you link into your Arduino code. I'm guessing that the receiving unit just does a SPI read from the RF chip's receiver buffer, then passes the data to the i2c encryption chip for decrypt, then returns the decrypted data to the calling routine. In fact, I noticed that there are no digital I/O pins 11, 12, and 13 in the photos I saw. Guess they don't want anyone to interface with any other SPI devices. Not smart if you ask me. At least allow for the option. What if I wanted to have an SD card? You might have to hack into the board to get at that interface. Anyway, you could probably just write your own interface to the SPI RF chip and skip the data encryption / decryption. Do we really need to encrypt? Guess that depends on your needs. Also Analog pins A4 and A5 appear to be absent, probably because those pins are used for i2c. They must be allowing for i2c somehow, though, because some of their product photos show Adafruit i2c products connected. But those photos show the product upside down the wires hidden. Unfortunately they don't appear to have any detailed pin out listing... I can only go after what I can see in a few photos.
There isn't any encoder. I was wrong as per my edited reply. It's just multiplexed input. See above. Should be really easy to use. You just need to switch the red and brown wires high & low depending on which 4 buttons you want to read. Basically the joystick would have done this many times a second, continously sampling each set of buttons. You can do the same from the Arduino. Just switch red HIGH and brown LOW, then read the 4 input wires for buttons 1, 2, 3, & 4. Then switch red LOW and brown HIGH, then read the same wires to read the states of buttons 5, 6, 7, & 8. Do this often enough in your input loop and you'll have access to all 8 buttons. It's very similiar to using a shift register.
Well... it looks like you have a bunch of tactile switchs from the buttons that were on of the stick. If I recall correctly, there was a "hat" style thumbswitch on those joysticks as well, which would detect left, right, up, down, and diagonals (probably by combining left & up, left & down, right & up, right & down). I'm going to guess there are a few transistors on there as well. Looks like there is also an optical encoder for a wheel of some sort. Need to look at the pictures some more...
UPDATE: Scratch that... no rotary encoder. I hadn't yet looked at the top-down picture and see what I thought was the encoder was just the side of one of the hat switches. If I read your diagram correctly and look at the pictures, there are 8 buttons but only 6 wires. My guess is that like they are multiplexing the input. Meaning... they are using the transistors to switch which buttons they want to "read". In order words they can only read some of the buttons at a time, and they use the transitors to switch which buttons they are reading.
I'm thinking that the blue, orange, yellow, and green wires are where you read the inputs, and you switch which inputs you want to read by applying voltage to either the red wire or the brown wire. I think the red wire will let you read inputs 1,2,3,4 off the input wires and the brown wire will let you read inputs 5,6,7,8 off the same input wires.
Thanks for the suggestions. Can somebody tell me why the zener diode didn't solve the problem? I thought the zener diode would prevent backflow until you reach the breadkdown voltage -- I thought that was the whole point of a zener diode? I'm just wondering why it didn't work. Maybe I needed a zener that could handle more amps, since the power supply is 2A? Did I maybe blow the zener?
I'm surprised as well as to how much of a charge this thing holds. I actually have several of them and they all do the same thing. I could probably put on some more LED's (I have about 48 more of them, lol) but I don't have time to build that many candles. Maybe I'll just put on a double throw switch to break the contact to reset them manually.
This is a generic question that has nothing to do with Arduinos. In my Halloween display I have 2 flicker LED's that I use for fake candles on my cemetery gate. These LED's have some sort of tiny IC inside that makes them flicker like a candle. Unfortunately I don't have a datasheet on these... I got them from a friend. They look like regular LED's except it's a bigger package and you can see some sort of white chip inside the epoxy. I'm using a 12V 2A regulated switching power supply (I know it's overkill, but it's what I had on-hand) and a 470ohm resistor for each LED.
Now the issue... When I cut power to my display, the LED's slowly fade off over about 10 seconds. In actuality it takes about 3-5 MINUTES for the voltage to drop below 1V from the power supply. It takes a full 20 minutes before voltage drops below 10 milliamps. (I hooked up my multimeter to find out). Anyway, this causes a problem. If power slowly fades away from the LED, the IC in the LED gets "locked" in an off state. When I reapply power later, the LED's will not turn on an appear dead. Unplugging the power supply and replugging it in does not fix the problem. The only thing that will fix the problem is disconnecting one of the power leads to the circuit (cutting power instantly versus slowly fading away). Now when reconnecting the wire, the LED's will fire up and all is good again, until the next time the power supply is cut and the power slowly trickles off.
I need to fix this so I don't have to keep going out there and manually resetting the LED's when I power on my display. I first thought of using a 9V zener diode, but it doesn't seem to be working as expected. When hooked up backwards, the LED's still power on (albeit with a slight voltage drop) and they still fade off slowly. I was thinking that once the voltage dropped below 9V the current should stop flowing across the zener, but that isn't happening.
What am I doing wrong and what should I be doing to fix this problem? My friend wants to use a 12V relay to solve the problem but I think that is excessive and wasteful. Thoughts?
The premise here is that when the captain calls for 1/3rd speed ahead, an enlisted man pulls a Telegraph lever to point to 1/3 ahead. The guys in the engine room see this and change the engine speed. They answer back by moving another Telegraph to indicate 1/3 ahead. This is seen by the bridge crew, and somebody says "engine room answers one third ahead, sir."
So we are sorta trying to simulate this. I might even decide to have a servo move an analog indicator like a Telegraph.
The electronics in the ship model will all be standard rc parts. There is a receiver, 2 esc's or a dual esc, a servo for the rudder, and 2 ungeared motors, one for each prop.
I need all interaction to happen in transmitter so that I can drive indicators and such. I want to slowly change the speed of the motors.
Okay, I need a little guidance here. I thought this was going to be really simple, but I found that not to be case.
It might help to understand what it is that I'm really trying to accomplish. My father has built a WWII Fletcher class destroyer model that he wants to make remote control. But he doesn't want conventional RC controls. He actually wants independent engine control, and he wants to literally call for "1/3 AHEAD" and "FULL SPEED AHEAD" by pressing buttons. He wants the engines to slowing come up to speed just as they would in a real ship. He's trying to make this a minature ship simulator to relieve his memories serving aboard the bridge as an officer back in the 60's.
I was thinking I could take the wires intended for the analog sticks on a RC transmitter and instead have the Arduino vary the voltage on the wires via the analog pins. Unfortunately, I haven't been able to get this to work. I modified a cheap park flyer transmitter already as a proof-of-concept and created an interface cable to one of the analog inputs on the transmitter. The wires intended for the linear pot are also on the interface cable as separate wires. So I have 2 wires going to the connector on the transmitter and 2 wires going to the linear pot. If I connect the 2 sets of wires together appropriately, the analog stick work like it did before. (Note that I'm only working with a single axis stick for my proof-of-concept). Using just the 2 wires going to the transmitter board, if I short them together (no resistance) the engine on the receiver goes to 0% throttle. If I unshort them, the engine goes to 100% throttle.
Here's where I'm stuck. How do I control this from the Arduino? I already tried hooking up each wire to an analog pin and trying a range of values using AnalogWrite(), but the engine always ran full tilt. I'm obviously missing something important. I did test the range of voltages across these 2 pins with a multimeter while the analog stick was hooked up, and I got a range between 0.001 and close to 1V. Of course I realize the analog pin wants to put out 5V at the top end of the range. Do I just need to add some resistors? I feel like I lack the appropriate knowledge. Any help would be greatly appreciated.