Show Posts
Pages: 1 ... 3 4 [5] 6 7 ... 14
61  Using Arduino / Motors, Mechanics, and Power / Re: Controlling a Peristaltic Filler with the Arduino on: September 01, 2012, 08:13:54 pm

    I am assuming pressing the foot switch just connects pin 1 to pin 2 temporarily.  

No, it should connect the pin1 the logic pin to pin 3 the ground pin. The 24 volts should just power whatever it is that drives the mechanism.

If it just requires a 5 volt signal to toggle the mechanism, then you should be able to connect the Arduino directly to the logic pin 1 with a common ground on pin 3.  Might be wise to see how much current the input pulls when the logic goes high. If it is less than about 30 mv then you can connect directly. it should be way less than that for most solid state things. If it isn't then you need to use a transistor or some other device between the Arduino output and pin 1. The Arduino would be connected to the base of the transistor through a 1 k ohm resistor. If there is a inductive kick ( some sort of relay) down the line from the Arduino, you should also put in a bypass capacitor.
62  Using Arduino / Motors, Mechanics, and Power / Re: Have I stuffed my stepper driver? on: September 01, 2012, 07:51:40 pm
there was a bad smell and I shut it down pretty quickly

By the time you smell it, it is too late. Yeah you smoked something. probably the board. You might check it out with a multimeter, sounds like there is some functionality. See if it draws a lot of current when nothing is happening. That would mean you burned a new current path some where. The driver working a low amps and not at higher amps may mean you partially fried something and now you have a high resistance path to output that limits the current and unbalances the steps after a certain load. Either way, the easiest thing is to just get a new board unless you are into removing board components. 
63  Using Arduino / General Electronics / Re: Help with IR Phototransistors on: August 29, 2012, 07:05:40 pm
Is the total dark reading > 35? with this low reading the delta between the pulse high and low may be below the threshold of detection.
64  Using Arduino / General Electronics / Re: Resistor Color Code Finder App on: August 29, 2012, 06:55:10 pm
The only mnemonic I ever learned is unpublishable... anyone have a better one?  smiley-lol
65  Using Arduino / Motors, Mechanics, and Power / Re: Looking for relay that can power pool pump?? on: August 27, 2012, 08:02:12 pm
The pump relay that Jeffmans speced out looks like a solid state. I have had no trouble with high current solid states, but then I run only resistive loads that don't kick back. The trick I use to avoid lots of heat is to use a relay rated at twice the amps. That way I only need a good heat sink and a little ventilation. The cost isn't that much more. The old kiln relays were all duty cycle contacts and they were always needing replacement... but they were switching probably a lot more than most applications.
66  Using Arduino / Interfacing w/ Software on the Computer / Re: Arduino LM335 and visual basic 6 on: August 25, 2012, 10:12:51 am
if the second sensor shows a value less then 10 or more than 100 the strings get confused.
on which end the VB or Arduino?  

i beleive it is the threshold for mscomm1

The com port only sees characters coming through.You need to use the string functions to find the start and end of the value you are looking for. Then if it is a 10 or a 1000 will make no difference.

so if your input string is a10b or a1000b it makes no difference to the code below

strt = InStr(str, "a") +1  ' one char past the a
  fin = InStr(str, "b")
  If (fin - strt) <= 0 Then
   Exit Function
   SensorVal =  Mid(str, strt, (fin - strt))
67  Using Arduino / Sensors / Re: Best way to tell if a lid is open. on: August 24, 2012, 06:52:37 pm
I've used a simple contact micro switch. with the pin as input, make sure you add a 10K pull down to ground and make the logic to trigger on the switch going HIGH. That means having a switch that you can wire as normally open. works fine and uses a little  less current.
68  Using Arduino / Interfacing w/ Software on the Computer / Re: Arduino LM335 and visual basic 6 on: August 24, 2012, 11:25:23 am
Yes you can send a long string over from the Arduino like  @a13.98b200c0.079d346e122.7 and use the VB string functions to select out each sensor value. You might write a function to simplify this

function GetSensorVal(BeginingLetTer,EndingLetter)  returns float or whatever

then to get the first value you could just call Val1 = GetSensorVal("c","d") and it would give you 0.079

You really don't need the @. I just used it as the start of the string since I am looking at only one temperature value and it made a good character to use when I was trying to identify the correct com port.
69  Using Arduino / Interfacing w/ Software on the Computer / Re: Arduino LM335 and visual basic 6 on: August 23, 2012, 09:32:27 pm
you are pretty much there fenderrobban as far as I/O from the Arduino to the VB app.  You need to learn to use some of the string functions in VB. Look at my previous post with instr and mid and figure out what I am doing to pull the info out of the total string coming over from the Arduino.

The last Arduino code you sent had pretty much all commented out. you need a Serial.println() to terminate the string. look at what is coming out the Arduino side and compare it with what you have coded it to expect on the VB side

You can use VB to display the results in the form as a text box or label, or even drop them into a list box. You just need to take one step at a time and build your code on that.

I used the debug.print just because it was the easiest way to see if you were getting anything over the line.  Now you can use any of the widgets or functions in VB to manipulate it and get the output you want

Charting the output will require you to really know what you are doing in VB. Don't even think of it till you have a much better understanding of how to manipulate string and numeric values in VB. The chart widgets included in VB are not that good, and they are kind of hard to learn, unless you have a pretty good feel for what you are coding.

70  Using Arduino / Interfacing w/ Software on the Computer / Re: Arduino LM335 and visual basic 6 on: August 23, 2012, 11:28:18 am
Try this... start a new project in the VB IDE. Create a form and put a VB com control component on it. open the code window and paste the following code into it. be sure and change the com port to the one the Arduino is using. Make sure you have the Arduino IDE closed or the VB app will not connect.

open the immediate window in the VB IDE

This is the simplest possible case. If should work if you are sending a string with a @ in it .

Private Sub Form_Load()
With MSComm1
        If .PortOpen Then .PortOpen = False
        ' change this to the com port shown by the arduino
        .CommPort = 3
        .Settings = "9600,N,8,1"
        .DTREnable = True
        .RTSEnable = True
        .RThreshold = 4
        .SThreshold = 3
        .PortOpen = True
  End With

End Sub

Private Sub MSComm1_OnComm()
Dim strData As String
Static strBuffer As String
Dim strWords() As String
Dim intPos As Integer
Dim boComplete As Boolean
Dim mystr As String


        mystr = "" ' set the string to nothing
        mystr = MSComm1.Input
            intPos = InStr(mystr, "@")
            If intPos > 0 Then
            Debug.Print mystr
           End If
End Sub

71  Using Arduino / Interfacing w/ Software on the Computer / Re: Arduino LM335 and visual basic 6 on: August 22, 2012, 07:44:38 pm
Re: Arduino LM335 and visual basic 6

Yes it is written for VB6... isn't that what you are using?
72  Community / Bar Sport / Re: Not TRYING to start a flame war honest. on: August 21, 2012, 10:29:12 am
Re: Not TRYING to start a flame war honest.

How we doing so far?
73  Using Arduino / Sensors / Re: voltage divider with max31855 vs level shifter on: August 20, 2012, 05:23:12 pm
Thanks CrossRoads. I am sampling with a 20 ms delay . I have not trapped any anomalous reading in a five hour run so this will probably be OK.
74  Using Arduino / Interfacing w/ Software on the Computer / Re: Arduino LM335 and visual basic 6 on: August 20, 2012, 03:57:32 pm
the Arduino code is ok. I ran it and it showed the correct values in my VB program, so it's coming across the USB ok
Here is the code I use to find the correct com port. It cycles through until it finds a com port sending out the correct string
you will have to declare some of the variables to get it running, but it
stick some debug.print statements in the code and step through it. You should be getting values comming over if the baud rate is set correctly
also, you need to put the VB side read insome kind of loop also so it will keep reading the input

For n = 1 To 16 ' com ports
  ' close any open ports
  If MSComm1.PortOpen = True Then MSComm1.PortOpen = False
   On Error Resume Next
   MSComm1.CommPort = n
   On Error Resume Next
   MSComm1.InputLen = 0
   MSComm1.PortOpen = True
   If MSComm1.CommID > 0 Then
     For i = 1 To 100 ' keep looking
      str = ""
      str = MSComm1.Input
      ' finds the port sending out the correct string.
      If InStr(str, "Tmp") > 0 And InStr(str, "@") > 0 Then GoTo jump:
      Sleep 50
     Next i
  End If
Next n

75  Using Arduino / Interfacing w/ Software on the Computer / Re: Arduino LM335 and visual basic 6 on: August 20, 2012, 02:12:26 pm
This works for me. You should be able to modify it to get what you want.
Function TempNow() As Single
Dim str As String
Dim strt, fin, ct As Integer
Dim tempstr As String
Dim u As Single
Dim i, B  As Integer
u = 0
str = ""
For i = 1 To 5
Sleep 10
 str = MSComm1.Input
' I use "Tmp and "@" instead of "<" and ">"
 If InStr(str, "Tmp") > 0 And InStr(str, "@") > 0 Then
   GoTo J1
 End If
Next i

ct = 0
u = 0
  strt = InStr(str, "@-") + 2
  fin = InStr(str, "-Tmp")
  If (fin - strt) <= 0 Then
   Exit Function
   ct = ct + 1
   u = u + Mid(str, strt, (fin - strt))
 End If
 TempNow = u / ct
 If Option1.Value = True Then
    TempNow = TempNow * (9 / 5) + 32
 End If
End Function
Pages: 1 ... 3 4 [5] 6 7 ... 14