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.
My own Arduino shield is finally coming to market! I've been working on this since March of this year. It basically turns an Arduino into a cost-effective and powerful prop controller for use with the Halloween industry. Typically you would use this to control up to 4 pneumatic solenoid valves for prop animation, although you can the relays to control any load up to 125VAC 10A or 30VDC 10A. There's an on-board EEPROM chip that allows you to record 15 separate animations. Animation 0 can be set to run in a continous loop (ambient) until the prop is triggered. Triggering is done by hooking up a motion sensor, pressure mat, etc to a screw-in terminal. Trigger voltage can be configured in software. There's also a header on board for an MP3 module that takes SD cards. Each animation slot is tied to a different MP3 file.
There's 2 ways to program your animations on the MonsterShield. You can "key-bang" the animation by using the optional detachable keypad that connects using a standard cat5 ethernet cable. Or you can plug the Arduino/MonsterShield into your computer and use the Windows MonsterShield Editor visual editing software to edit, download, and upload your animations to and from the MonsterShield. The software is actually one of the features I'm really proud of. You can interact with the MonsterShield in realtime when it is connected to your computer and using our software.
Of course we didn't want to stop there. We've got the hobbyist and hackers in mind, too. You can order the MonsterShield with or without stackable headers. You'll have access to the the secret sauce (Arduino sketch) that makes the MonsterShield work. Our Arduino sketch also implements an easy-to-use serial protocol that you could utilize to turn the MonsterShield into a computer-controlled home automation controller. We'll be publishing the serial interface protocol and command list shortly. Of course you could pitch our sketch and write your own, or reuse our routines to think up your own stuff.
Hey, just wanted to let you know I've already experimented with the 8-relay Sainsmart 5V relay board. They work REALLY well. I'm going to be using the 4 relay version for a commercial project. Note that you need a pin for each relay. So if you're using the 16 relay board, you're going to have to use a shift register or multiplexor or two in order to access all the relays from the Arduino Uno. Also be aware that by for these relay boards HIGH = relay off, LOW = relay on.
Here's a video of mine running my test program on the Arduino:
Here's another tip... don't use pins 0 and 1 (the RX and TX) for one of the relays... When you upload a program to the Arduino you'll cause that relay to switch WAY fast. Will probably shorten the life the relay. I accidentally did this because I wasn't thinking. I gotta stop prototyping in the middle of the night!
I'm planning on using the TDB380 for my own project. Just ordered a couple from MDFLY last night to try out. One question I have is the MDFLY site seems to indicate the minimum input voltage is 6V, but the "good" PDF for the TBD380 is unclear... It says in one place anything from 5V to 30V will work, but in another place it says 6V min. Actually it says both of those on page 2 of this PDF: http://www.echelleinconnue.net/outils/mobio/composants/TDB380_datasheet_V2_(Tenda_Electronics).pdf
So... my question is, can I power this thing from the 5V pin off the Arduino Uno? Or should I be doing some sort of dc dc converter or booster or something?
I was able to get it working using the TIP31C and the diode as described in that instructable. Now I can focus on building my sequence of solenoid events and triggering them when the motion sensor sees motion. Thanks for the help. I'd still be curious as to what I was doing wrong with the Darlington Array quad.
Okay now I am thoroughly confused. I put my meter's + probe on the C and the meter's - probe on the ground. Whenever B goes high, the meter reads 257 V! What the heck? How is that even possible? When B goes low, the meter reads 0V. By the way, this is with a fresh chip thrown on. I put on a 10K resister in between C and the solenoid and now the meter reads 2V when B is high. So... maybe if I get the resister right I'll have around 12V?
EDIT: I replaced the resistor with two 100 ohm resistors (200 ohm total) and now I'm getting 10.3 volts but the solenoid is still not activating. I also measured mA and I'm getting 0.24 mA. The solenoid says 400 mA by the way.
And here is an ugly picture of what I currently have on the breadboard. My apologies for only having 1 color of wire -- it is driving me nuts, too.
Pin 12 is being used to trigger the solenoid via the ULN2065B. Pin 13 is being used as an indicator LED for when I should have switched the solenoid on. The purple wires go to the solenoid. The top right hand part of the breadboard with 3 wires going into the top strip is the ground for the 10 Volt switched power supply I am using for the solenoid. The 10Volts is plenty to switch the solenoid, that has already been tested. In fact, you can see a video of that here: Let me know if you have any other questions.