Show Posts
Pages: 1 ... 20 21 [22] 23
316  Using Arduino / General Electronics / Re: PNP transistors... how to use them? on: July 06, 2011, 03:36:27 am
Hey guys , excuse me for kicking up settled dust, i understand how the PNP switches the high side which means to go about actually switching we apply negative to the base...but how does one go about that? let me explain
I have an arduino , and  i would like to pulse width modulate to vary the speed of a small dc motor.
and yes  i do have NPN transistors and i have done it like this just fine  , but if in reality a PNP can replace an NPN then how do i pulse width modulate with a PNP
using the arduino?
If my understanding of PWM is simply ranging from 0-5 volts,lets say on pin 9 , that would be feeding the base of an PNP positive charge , which is not what i need.
so how do i go about this.
317  Using Arduino / General Electronics / Re: Should my transistor heat up THAT much with this circuit on: July 05, 2011, 11:14:37 am
Oh i have done my share of online reading , and specially on transistors but i guess i just had it totally wrong i was using them all with the same polarity just like my picture connecting all positives to all 3 leads but then after really looking at what you told me to do,  the most obvious thing clicked  " NPN "  why would i add all of the same polarities to both N and P type material. Thanks a lot though for part taking  in my breakthrough!

This crucial moment is almost as important as the invention of the transistor it self lol, at least to me.
318  Using Arduino / General Electronics / Re: Should my transistor heat up THAT much with this circuit on: July 05, 2011, 10:55:37 am
Good MAN thank you! works like a charm, now perhaps a little insight as to why? And i would of figured since i was switching the transistor to the ground i would need a PNP transistors, since that for the "negative" side of things..?
319  Using Arduino / General Electronics / Should my transistor heat up THAT much with this circuit on: July 05, 2011, 10:36:08 am
Okay now here is a picture since my schematic drawing abilities are not up to par, and by the looks of it neither are my circuit building abilities because i dont know if i am doing something wrong or if this is how things go, i know transistors dispense heat but i thought it would be when you got up there like at 24 volts or something and this transistor i thought would be more then enough and not get hot, anywho here is a picture of my connections and transistor datasheet
my goal was to make my own little H bridge on a circuit board but i cant even get passed testing out my components

oh and the code on the Arduino is simply the fade led example code that comes with the ide, and the motor does run and the code works fine  it speeds up and slows down but the transistor gets reallly really hot
http://alumni.cs.ucr.edu/~sneema/mje3055t.pdf

http://i54.tinypic.com/311kwoi.jpg
320  Using Arduino / Interfacing w/ Software on the Computer / Re: Another Arduino VB Serial question. on: July 03, 2011, 08:13:07 pm
Quote
How do you know? You can't trust the VB prog yet so how do you know the Arduino is not transmitting?
oh i know my code with VB is buggy  i dont trust much but the Arduino not transmitting goes back since  i was trying to Use some RF links
once unplugged from usb after uploading a sketch to  test the rf links range it worked no more, i also go by rx tx led, its blinks when transmitting right after i upload a sketch thats about it  , only time  i got the RF transmitter to work was when i used virtual wire thats the only time my arduinos can transmit data is through other pins not my designated rx tx pins , im wondering if i can use virtual wire to send to serial?
Quote
const char *msg = "hello";
vw_send((uint8_t *)msg, strlen(msg));
that right there is virtualWire's way of transmitting thorugh a digital pin ,  i guess its the equivilant of "serial.print"
i wonder if used while on the computer without anything connected to the specified pin if it will just send through serial, perhaps ill try that but right now  i have to go eat smiley



update : just tried it , does not work , i didnt think it would
321  Using Arduino / Interfacing w/ Software on the Computer / Re: Another Arduino VB Serial question. on: July 03, 2011, 04:04:53 pm
Quote
Can you reasonably expect us to divine the answer to that question? You haven't posted any Arduino code.
Code:
void setup()
{
Serial.open (9600);

}
void loop()
{
Serial.print ("Hello world");
}
I could , and have, put code as simple as that
and after unplugging the Arduino and plugging it back in to the USB or even the Power plug
its does not transmit data.

And you guys where absolutely right , my code needed an over haul , I did what paul said and added a seprate button for connect and disconnect and just to make sure a disconnect when the window closes , i just need to clean it up a bit more because it works sometimes and sometimes freezes .
this is the new form with a SerialPort component  (my_SerialPort)
Code:
Public Class Form1

    Private Sub btn_connect_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_connect.Click
        my_SerialPort.Open()

    End Sub

    Private Sub Form1_Disposed(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Disposed
        my_SerialPort.Close()


    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub

    Private Sub btn_ClosePort_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_ClosePort.Click
        my_SerialPort.Close()
    End Sub

    Private Sub btn_Read_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_Read.Click
        lbl1.Text = my_SerialPort.ReadLine
    End Sub

    Private Sub btn_Send_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_Send.Click
        my_SerialPort.WriteLine(txt1.Text)
    End Sub
End Class



322  Using Arduino / Project Guidance / Re: Setting time for starting the motor on: July 03, 2011, 01:52:40 am
oh thats awsome! one question those things on the upper left corner that look like old mini-vacumes way before the transistor came into play what are those? sorta resemble  fuses as well, and i would also like your input on a project i was pondering earlier today but ill post it as a thread in a second.
323  Using Arduino / Project Guidance / Re: Setting time for starting the motor on: July 03, 2011, 01:39:32 am
hey that keybad looks nice and simple where did you find it? link perhaps
324  Using Arduino / Project Guidance / Re: Kitty Invisible fence on: July 02, 2011, 12:46:18 pm
yes that crossed my mind as well , i just dont know what to do with my rfid reader its either going to be this or use it to turn on my computer so that only I may get access , unless anyone in my family knows how to rewire it which  i bet my life they dont
325  Using Arduino / Interfacing w/ Software on the Computer / Re: Another Arduino VB Serial question. on: July 02, 2011, 12:27:29 pm
very interesting, i was not aware that opening it resets the arduino, i will take note of that, how ever this is the code for receiving data ,  i got it from the MSDN library online
http://msdn.microsoft.com/en-us/library/7ya7y41k.aspx

Code:
Function ReceiveSerialData() As String
        
        Dim returnStr As String = ""

        Dim com4 As IO.Ports.SerialPort = Nothing
        Try
            com4 = My.Computer.Ports.OpenSerialPort("COM4")
            com4.ReadTimeout = 10000
            Do
                Dim Incoming As String = com4.ReadLine()
                If Incoming Is Nothing Then
                    Exit Do
                Else
                    returnStr &= Incoming & vbCrLf
                End If
            Loop
        Catch ex As TimeoutException
            returnStr = "Error: Serial Port read timed out."
        Finally
            If com4 IsNot Nothing Then com4.Close()
        End Try

        Return returnStr
    End Function
in response to what you said about not having to open the port every time im only pressing the button one time ,
One thing to note i noticed if i unplug my arduino and plug it back in via USB the Tx led will not blink which means its not sending my data? why not? if its connected to the computer? only time it send is if i upload the sketch again but never after it loses power, anyways thats a whole different issue , so i only test it after i upload a sketch to make sure VB is trying to read only while im actually transmitting data , what i think the problem is that Arduino is taking up both connection weather or not i have serial monitor open
As far as  i know to send data its just a matter of opening serial on arduino and matching baud rates and Serial.print or println
326  Using Arduino / Interfacing w/ Software on the Computer / Another Arduino VB Serial question. on: July 02, 2011, 03:43:15 am
i cannot for the life of me get VB to read from the Serial with out it either say access is denied or just freezing and not doing anything.

First i did my research and came across this on the old forum
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1295434018

Tried it and yes i renamed everything accordingly but nothing.

1.I know my arduino is actually sending data because i press the serial monitor and i see my data that i want sent.
2. I can Send from VB to arduino just fine with this code
Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
      

     SendSerialData(txt1.Text) 'this here send whats inside a text box to Com4 and Arduino gets it all just fine

      
    End Sub

    Sub SendSerialData(ByVal data As String) 'this is the function that is sending my data from VB to Arduino
      
        Using com4 As IO.Ports.SerialPort =
                My.Computer.Ports.OpenSerialPort("COM4")
            com4.WriteLine(data)
          
        End Using
    End Sub

Now you would figure that something like "com4.ReadLine" would fetch my data but it does not
this is oneway of doing it without using the SerialPort control which i have also tried and nothing

One thing to Note and what i think may be the problem
If i send data from VB to Arduino to Blink an led it will do it just fine, SO LONG as i DO NOT have serial monitor open in Arduino because then it says access denied.
So with that little bug witch is fine  i dont need serial monitor open to send or receive data but still when sending from Arduino to VB it does not work.
by the way im on an Arduino uno revision 2 and Ide version 0022 , and Visual Basic 2010 express.


on a totally random side note: I just got an accelerometer and Ping from parallax and oh man they are so beautiful <3
 
327  Using Arduino / Interfacing w/ Software on the Computer / Re: How to use arduino uno with the computer? on: June 30, 2011, 03:22:16 am
Yes you can use it with your computer, i would also look into Processing for that
http://processing.org/

but the Arduino is more for interfacing Software with the real world , so lets say you make an application that notifies your arduino when you have a message or comment etc.. with nothing connected to it, not even an LED then its really pointless if you ask me, if all its doing is telling you something that you HAVE to be at your computer to see and since your there  then why not just open up a browser page and log into your facebook.
328  Using Arduino / Project Guidance / Re: Kitty Invisible fence on: June 30, 2011, 03:01:58 am
So very true , i was just thinking of the transmitter on the cat, but my kitty sporting an Arduino would be a first in the Arduino community. Anywho thanks for the insight
329  Using Arduino / Project Guidance / Kitty Invisible fence on: June 29, 2011, 06:11:19 pm
Hey guys, its funny how i havent really made anything i have just been stocking up on all types of sensors switches , smack loads of resistors and transmitors ,and things of the like...
anywho i use to work at this mansion and they had those invisible fences for their dog , that when they cross the "fence" i think he got a small shock on his collar , at least thats how i think it worked, now i would like to make something like that for me kitty on a much smaller scale , which is my room.
at first  i was thinking laser trip wires but that will just tell me when  he crosses it and i wont know if he crossed and came back in or crossed and left , you know..
 i was thinking something that would keep buzzing untill he was back in the controlled area.
So then  i was thinking gps but dues to the small area i doubt that it will be accurate enought to detect a couple of feet/inches of movement .
so now i think maybe a not so invisible fence i can use actual wires around my room but still not sure what type of sensor or how to go about this.. i can mount something on his collar to keep  track if he is in my room or not ...but what could it be?  any ideas?
330  Using Arduino / General Electronics / Connecting Grounds Together...why? on: June 26, 2011, 01:00:46 am
Hey guys, i was reading the Arduinos Servo Library Documentation and i came across this..
Quote
Note servos draw considerable power, so if you need to drive more than one or two, you'll probably need to power them from a separate supply (i.e. not the +5V pin on your Arduino). Be sure to connect the grounds of the Arduino and external power supply together.

now this is not the first time ive read about connecting the Arduinos ground to the external power source's ground, i just do not  know, rather understand, why?
 because as far as I understand, and i am just begging to self teach my self , in electronic engineering it is said that current flows from positive to negative, but in real life it actually flows from negative to positive, so if i am using lets say a 9v or even better a 12v battery and connect it to the Arduinos ground would'nt i in "real life" be sending 12v to the Arduino?
Pages: 1 ... 20 21 [22] 23