Show Posts
Pages: 1 [2] 3
16  Forum 2005-2010 (read only) / Interfacing / Re: quesetion about interfacing with rotary switch on: April 02, 2009, 01:32:01 pm
Quote
Put 1K resistors between each of the pins, with the last connected to ground and the last on the other end connected to +5V

Tasty! I'll give this a try when I get home on Monday.

I've been experimenting with a pot and simulating a rotary switch by making each range of the pot be a different setting, broken into 10 parts. This works works but it definitely lacks the nice satisfying "click" of a true rotary switch.

Thanks, this is really a great idea.
17  Forum 2005-2010 (read only) / Interfacing / Re: quesetion about interfacing with rotary switch on: April 01, 2009, 04:47:39 pm
I'm trying that but its super flaky. It'll read the input correctly a few times and then stop. But if I touch the rotary switch it'll then read it again.

Interestingly if I touch or even put my hand near the ground wire or input wires, it then reads it correctly again.

Is that a debounce issue?
18  Forum 2005-2010 (read only) / Interfacing / quesetion about interfacing with rotary switch on: April 01, 2009, 08:33:24 am
I picked up an old 11 position rotary switch:

http://www.smcelectronics.com/SWROT06.JPG
http://www.smcelectronics.com/DOWNLOADS/SWROT06.PDF

I'm not sure what the technical way to describe it is, but it has one pin that I'd call "common", and 11 pins that make contact with the common pin as the switch changes position.

I'm wondering what the proper and most efficient way to connect this to the arduino is. Do I connect what I'm calling the "common" pin to +5v, and each of the other pins to ground via a resistor and then to an input pin on the arduino?

Is there a more efficient way than connecting each output pin of the switch to both ground and an input pin?

Thanks for any help.
19  Forum 2005-2010 (read only) / Interfacing / Interfacing with a string of 12v RGB LEDs? on: July 23, 2010, 06:44:57 am
I have a string of RGB LEDs wired for 12 volts that I'm currently controlling with this controller:

http://www.virtualvillage.com/12v-4a-rgb-led-stepless-dimmer-controller-new-001496-005.html

I've played with other controllers such as this one:

http://www.ledwise.cn/products_detail.asp?id=343

Its ok, but I'd like more control over the fading modes, which is where the Arduino would be nice. I searched around for "arduino led controller shield" and things like that and didn't find anything particularly useful. I'm wondering if there might be some LED controller that people know of that can easily interface with the Arduino?

My main goes is to get more control over the fading modes. For example, to be able to fade very slowly between blue and red and back.

Thanks for any help.
20  Forum 2005-2010 (read only) / Interfacing / Re: I need to turn a knob... Stepper motor? on: May 11, 2010, 04:36:15 pm
Thanks for the excellent tips.
21  Forum 2005-2010 (read only) / Interfacing / Re: I need to turn a knob... Stepper motor? on: May 11, 2010, 04:23:04 pm
The rotary solenoid sounds perfect.

>   I would use a rubber hose or a rubber foot (the kind with a hole in the middle for the screw) to "grab" the camera knob.

Interesting. Could you elaborate on this? I've been worried about damaging the knob through excessive force, and this sounds like a good solution.

As far as the camera being controllable via USB, this camera's predecessor, the S3, turns on when it receives 5v through the USB port. Alas, for whatever reason, the S5 doesn't do that, but I need to use the S5 because only it has a flash hotshoe.

22  Forum 2005-2010 (read only) / Interfacing / Re: I need to turn a knob... Stepper motor? on: May 11, 2010, 01:43:44 pm
Interesting. Can I make a servo motor turn both ways? After it turns that dial, it needs to then turn it back the other way.

I have a servo motor, but it only has 3 wires, which as I understand it is two power leads and one signal lead.

Looking here for example:

http://itp.nyu.edu/physcomp/Labs/Servo
23  Forum 2005-2010 (read only) / Interfacing / I need to turn a knob... Stepper motor? on: May 11, 2010, 01:39:33 pm
I'm trying to remotely turn on a Canon Powershot S5 camera. It has a power knob that you turn about 15 degrees and then it snaps back to center. Here's a picture:

http://www.digitalcamerainfo.com/images/upload/Image/Canon%20S5%20IS/Product%20Photos/S5IS-top.jpg

Note that knob at the bottom right, with the "off" button inside of it. I'd like to simply turn that knob.

I was thinking a stepper motor glued to the top of the knob?

That's kind of a shot in the dark though, I have no experience with stepper motors. If I went that route, would I then use something like this to drive it?

http://store.fungizmos.com/index.php?main_page=product_info&products_id=246&zenid=e9a645bf0b7067566c3ba2aa58502443

And any tips on which motor to use?

Or maybe I'm barking up the wrong tree?

Thanks for any help.
24  Forum 2005-2010 (read only) / Interfacing / Re: Measuring water level with Arduino? on: April 15, 2009, 06:08:16 am
I found this circuit, which looks pretty perfect:

http://www.electronic-circuits-diagrams.com/alarmsimages/6.gif

More description here:

http://www.electronic-circuits-diagrams.com/alarmsimages/alarmsckt6.shtml

One thing I'm not sure about is how to connect this to an Arduino. Could I just connect to digital inputs instead of the LEDs?
25  Forum 2005-2010 (read only) / Interfacing / Measuring water level with Arduino? on: April 15, 2009, 03:20:26 am
I need my Arduino to measure the water level in a 50 gallon drum. I don't need very fine resolution, in fact I really only need to know when the drum is almost empty.

I found a few posts that recommend doing this by measuring pressure in a column of air or water, such as this blog post:

http://spiffie.org/electronics/archives/microcontrollers/Arduino%20and%20Freescale%20MPX%20Pressure%20sensors.html

And I could dfo it by measuring the weight of the drum. But for my purposes I was hoping for an even simpler solution, and one that would allow me to mount the Arduino 10 meters or so from the water barrel.

I used to have an RV that measured the level in its water tank via a sensor placed in the water itself. All the sensor did was know if there was water at that point. Note that it could distinguish between it being a little wet and actually submerged. Can anyone think of a way to do this?

Thanks for any help.
26  Forum 2005-2010 (read only) / Interfacing / Re: possible for computer to receive messages? on: April 06, 2009, 03:41:54 am
For future reference, I just discovered that the Arduino IDE can monitor the arduino just fine. Click the serial port button at the top right of the IDE....
27  Forum 2005-2010 (read only) / Interfacing / Re: possible for computer to receive messages? on: April 05, 2009, 12:47:43 pm
I wrapped a gui around it:

http://gizmoware.net/arduinospy/ArduinoSpy.exe

For now its Windows only, but its Python so once I get the kinks out I'll cross-compile. Still definitely beta. For example I'd like to change the way the serial port is getting polled to make it a bit more efficient. I'll release the Python sourcecode once I finish it. No clue whether it works on Vista, feedback invited.

A few features:

- not meant to be a general purpose arduino/computer bridge like gobetwino, this is just to see println messages from the Arduino for debugging.

- single file, no installer. Sorry about the file size, the program itself is very small but I have to include all the Python libraries.

- minimal interface, and resizable and remembers window size & position.

- global hotkey: printscreen or scrolllock will connect/disconnect from the arduino. So if you need to upload a new version of your script to the arduino, hit printscreen to disconnect without having to focus on arduinospy.

- can optionally try to find your arduino

- if you need to go to device manager to look up your arduino's comport number, view --> show device manager

- button turns green when connected, red when not. The idea is you can see connection state at a glance



28  Forum 2005-2010 (read only) / Interfacing / Re: possible for computer to receive messages? on: April 02, 2009, 02:34:37 pm
True, but personally I see a commandline switch as a hassle since that means not being able to run it with a mouse click. I suppose someone could make a shortcut with the switch included or a batch file, but still that's extra work.

Something like this might be easier:

Code:
comport = raw_input("What's the number of your com port? ")

Or better yet just hard code the comport number in the script and have the user edit the script manually, since the comport number probably won't change on any given computer:

Code:
comport = 6

If I get a chance I'll wrap it in a simple gui using WxPython, my gui framework of choice. I'm not sure how much need there is for one though since gobetwino works.


29  Forum 2005-2010 (read only) / Interfacing / Re: possible for computer to receive messages? on: April 02, 2009, 11:19:29 am
Thanks, the gobetwino works. I made a little Python script that works too if anyone needs it:

Code:
import time, wmi, serial

def find_arduino():

    c = wmi.WMI ()
    for device in c.Win32_PnPEntity ():

        current = device.Name

        if "(com" in current.lower():

            if "FTDI" in device.Manufacturer:
                # figure out the port # with a horrible bit of duct tape
                # other way to get the port number?
                comport = device.Caption.replace("USB Serial Port (COM", "")
                comport = comport.replace(")", "")

                try: comport = int(comport)
                except ValueError: return None

                return comport



print "Searching for the arduino, this might take a moment..."

comport = find_arduino()

else: comport = 6

if comport: print "Hallelujia, I found it! Its at COM" + str(comport) + "..."
else: print "Whoops, I didn't find an arduino..."



baud = 9600
ser = serial.Serial(comport - 1, baud, timeout=.25)

while True:    
    ln = ser.readline()
    ln = ln.replace("\n", "") # get rid of the extra hard return
    print ln
  

Note that this is written for Windows. The only semi slick thing it does is find the Arduino's serial port automatically, at least on my computer. It does this using the Windows WMI interface using a bit of duct tape. Its slow since it iterates through the entire PNP interface, but it works reliably for me.

Would probably be better to hardcode the serial port if you're running it often.

And also note that you'll need to install the pyserial module from here: http://pyserial.wiki.sourceforge.net/pySerial

And I think to use WMI you need to install the Windows extensions for Python.
30  Forum 2005-2010 (read only) / Interfacing / possible for computer to receive messages? on: April 01, 2009, 08:53:11 pm
I'm wondering if its possible for the computer to receive messages from the arduino? In other words, have the arduino print the word "hello" or whatever, and have it show up on the computer?

I'm guessing if so it's using the Serial class, but I'm not sure how to receive the messages. I'm on Windows if it matters.

Thanks for any help.
Pages: 1 [2] 3