1 72 73 74 75 76 1,913 Replies Latest reply on Aug 6, 2014 3:11 PM by tonnie_wittenaar Go to original post Branched to a new discussion.
      • 1,095. Re: Have a question about Arduino? Ask me!

        I faced the same question a few months ago and after some research, decided to go with the Uno.  While there are lots of choices, the main thing is that the Uno offers a "middle ground" in terms of learning.  There are plenty of I/O pins for both digital and analog, and unless you have space limitations that would require a smaller board or design constraints that require more I/O pins, the Uno should do just fine.  The programming is pretty much the same and there are tons of examples and tutorials for the Uno.  I've already graduated from an easy starter kit to one that costs a lot more but has tons of things to tinker with.  I would recommend getting a starter kit that comes with the little book on getting started and then go on to the Jeremy Blum tutorials on YouTube. 

        • 1,096. Re: Have a question about Arduino? Ask me!

          @Robert Maple - I would suggest starting with the Uno, as it matches a lot of the tutorials, like this one from Oomlout: http://www.oomlout.com/a/products/ardx/


          It also allows you to easily connect shields, if you decide to go that route later.


          If you're not fixed on Arduino, the Freedom FRDM-KL25z using mbed.org is also a very nice unit that's easy to use and low cost ($12.95 msrp).


          Happy building!



          • 1,097. Re: Have a question about Arduino? Ask me!

            Hello everyone,


            I'm trying to get an attitude indicator which was designed to work with flight simulator software, to work with arduino uno.


            From the manufacturer, i have received a code example, but written in another compiler than the arduino one which i guess is C++.


            Basically what has to happen is this:


            I deflect a 2-axis potentiometer joystick and the attitude indicator has to show the corresponding deflection on the screen, which is controlled by 2 stepper motors. (http://www.flightillusion.com/index.php?page=shop.product_details&flypage=ilvm_fly_admirable.tpl&product_id=45&category_id=14&option=com_virtuemart&Itemid=58&vmcchk=1&Itemid=58)


            So the attitude indicator can move vertical and lateral.


            The data sent to the attitude indicator for vertical movement lies between 0-1200.

            The data sent to the attitude indicator for the lateral movement lies between 0-4319.


            this data can't be sent just as it is. No, the data has to be in a certain layout, which is this one:


            Message layout:


               ' Byte 1: Flag byte:&h00

               ' Byte 2: Address: 1-255; address zero forbidden!

               ' Byte 3: Command: Bit 3 always "1": CCCC.1SHL (CCCC= command, H&L = original databits from Data low/high , S=sign of the Data )

               ' Byte 4: Data Low: &h00-&hFF;  bit0 always 1 : XXXX.XXX1 -> XXXX.XXXL. The H and L bits are save in byte3 and forced to "1"

               ' Byte 5: Data High:&h00-&hFF: bit1 always 1 : XXXX.XX1X -> XXXX.XXHX

               ' Byte 6: End byte:&hFF



            To know the value of each byte corresponding to the data value (0-1200, 0-4319), there is an .exe converter: http://www.filedropper.com/flightillusioninterface


            So if I open the .exe and I fill in: Gauge ID: 1, Gauge command: 5, Gauge data (for command 5, lateral movement this is between 0-4319): e.g.: 500.


            I get a serial output made of 6 bytes. These values are Hexadecimal.


            Now my question is:


            How do I bring these variables into the correct message layout as shown above.


            An example code for PC:




            Private Sub cmdOpenPort_Click()

            On Error GoTo comerror

            MSComm1.CommPort = ComPortNr

            MSComm1.Settings = "38400,N,8,2"

            MSComm1.SThreshold = 0

            MSComm1.InputMode = comInputModeText

            MSComm1.RThreshold = 25

            MSComm1.InputLen = 25

            MSComm1.NullDiscard = False

            MSComm1.PortOpen = True

            Exit Sub


            MsgBox ("Commmunicaton port error; check for correct portnumber" + vbCr + vbLf + "Current ComPort does not exist or isn't operational or is already open")

            End Sub





            Private Sub LightOn_Click()

            Call ComposeCmd(CurrentGaugeID, 8, &H40)

            End Sub



            Private Sub LightOff_Click()

            Call ComposeCmd(CurrentGaugeID, 8, &HF)

            End Sub



            Private Sub PollTimer_Timer()

            Dim ProgressChar As String

            Call ComposeCmd(CurrentGaugeID, 7, 0)

            End Sub



            Public Sub ComposeCmd(GaugeID, icmd, ival)

            Dim XferCmd As String

            Dim long1 As Long

            Dim int1 As Integer

            Dim int2 As Integer

            Dim int3 As Integer



            XferCmd = "      "

            Mid$(XferCmd, 2, 1) = Chr$(GaugeID)

            long1 = ival

            If ival < 0 Then long1 = Abs(ival) 'Value is negativ; include sign bit in value

            int2 = Int(long1 / 256)

            Mid$(XferCmd, 4, 1) = Chr$((long1 And &HFF) Or &H1)

            Mid$(XferCmd, 5, 1) = Chr$((int2 And &HFF) Or &H2)

            int3 = icmd * 16

            int3 = int3 Or (long1 And &H1)

            int3 = int3 Or (int2 And &H2)

            If ival < 0 Then      'Set Sign bit

                int3 = int3 Or &HC


                int3 = int3 Or &H8

            End If

            Mid$(XferCmd, 3, 1) = Chr$(int3 And &HFF)

            Mid$(XferCmd, 6, 1) = Chr$(&HFF)

            Mid$(XferCmd, 1, 1) = Chr$(&H0)

            MSComm1.Output = XferCmd

            End Sub



            Public Sub SetNewGaugeID(CurrentID, NewID)

            Dim XferCmd As String

            XferCmd = "       "

            Mid$(XferCmd, 1, 1) = Chr$(&H0)

            Mid$(XferCmd, 2, 1) = Chr$(CurrentID)

            Mid$(XferCmd, 3, 1) = Chr$(&H2C)

            Mid$(XferCmd, 4, 1) = Chr$(NewID)

            Mid$(XferCmd, 5, 1) = Chr$(&HAA)

            Mid$(XferCmd, 6, 1) = Chr$(&HFF)

            MSComm1.Output = XferCmd

            End Sub



            Public Sub MSComm1_OnComm()  'Communication Port Interrupt Routine

            Dim int1 As Integer

            Dim int2 As Integer

            Dim flush As String



            Select Case MSComm1.CommEvent 'Event type


                Case comEventBreak     ' A Break was received.

                    flush = MSComm1.Input

                    MSComm1.InBufferCount = 0

                    ReceivedMessageHexa = " A Break was received."


                Case comEventFrame     ' Framing Error

                    flush = MSComm1.Input

                    MSComm1.InBufferCount = 0

                    ReceivedMessageHexa = " Framing error"


                Case comEvReceive       ' Received RThreshold # of chars.

                    ComBufferRec = MSComm1.Input

                    If Len(ComBufferRec) <> 25 Then

                      ReceivedMessageHexa = " Incorrect reply; length <> 25"

                      Exit Sub

                    End If


                    'Correct message received; handle it


                    ReceivedMessageHexa = ""

                    For int1 = 1 To 25

                      int2 = Asc(Mid$(ComBufferRec, int1, 1))

                       ReceivedMessageHexa = ReceivedMessageHexa + Hex(int2) + "."

                    Next int1

                    Me.BoxID = Asc(Mid$(ComBufferRec, 2, 1))

                    Me.BoxType = Asc(Mid$(ComBufferRec, 3, 1))

                    Me.boxModel = Asc(Mid$(ComBufferRec, 4, 1))

                    Me.boxVersion = Asc(Mid$(ComBufferRec, 5, 1))

                    Me.boxName = " Unknown "

                    For int2 = 0 To 32 Step 2

                      If Val(BoxType) = Gaugenames(int2) Then boxName = Gaugenames(int2 + 1)

                    Next int2


                    Select Case ProgressPntr

                        Case 0

                          Me.ProgressIndicator.Caption = "---"

                        Case 1

                          Me.ProgressIndicator.Caption = " \"

                        Case 2

                          Me.ProgressIndicator.Caption = " |"

                        Case 3

                          Me.ProgressIndicator.Caption = " /"

                    End Select

                    ProgressPntr = ProgressPntr + 1

                    ProgressPntr = ProgressPntr And &H3

                    Exit Sub



            End Select



            End Sub


            I really don't know how i even should begin on such a thing


            Thanks in advance!

            • 1,098. Re: Have a question about Arduino? Ask me!

              Hi Jeremy


              I have recently started playing around with arduino and Australias Freetronics boards! I have one goal in mind and that is to develop a network based home thermostat to control heater/airconditioning functions! I have come across this blog http://www.freetronics.com/blogs/news/6305652-build-your-own-arduino-based-home-thermostat.

              Which is almost exactly what i am wanting to duplicate, with a few small changes. I have put all the components together however i am now getting error msgs while trying to load the sketch from the blog above, and that is when my knowledge stops.

              I was wondering if you would be interested in helping me complete this project, would be more than happy to pay you for your time.

              any help would be greatly appreciated.


              Kind regards



              • 1,099. Re: Have a question about Arduino? Ask me!


                I'm total newbie to arduino and electronics.

                For a project I'm trying to control a stepper motor via labview using Arduino micro-controller. I have  a labview-arduino kit and L6470 stepper driver from Sparkfun. (https://www.sparkfun.com/products/11225, https://www.sparkfun.com/products/10859). Now I"m clueless as to how I should wire the arduino to the driver and the motor. (I've got a bipolar motor from Pololu http://www.pololu.com/catalog/product/1478) and a 12 V power supply. Could you please give me any kind of help with this. I really appreciate it.

                Thank you

                • 1,100. Re: Have a question about Arduino? Ask me!

                  There are all kinds of good things to learn from the example sketch provided on Sparkfun.com for the breakout board you bought.

                  For example:

                  12/12/2011- Mike Hord, SparkFun Electronics



                  The breakout board for the dSPIN chip has 7 data lines:

                  BSYN- this line is LOW when the chip is busy; busy generally means things

                     like executing a move command.

                  STBY- drag low to reset the device to default conditions. Also should be

                     performed after power up to ensure a known-good initial state.

                  FLGN- when the dSPIN raises a flag it usually means an error has occurred

                  STCK- used as a step clock input; the direction (and activation of this input

                     is done by setting registers on the chip.

                  SDI- SPI data FROM the uC TO the dSPIN

                  SDO- SPI data TO the uC FROM the dSPIN

                  CSN- active-low slave select for the SPI bus

                  CK- data clock for the SPI bus



                  A note about connecting motors:

                  It's unclear from the datasheet what gets connected to which terminal.

                  Bridge one (terminals 01A and 01B) gets one coil, and bridge two gets

                  the other coil. For our mid-small stepper (ROB-9238), that translates to

                    01A -> RED

                    01B -> GREEN

                    02A -> BLUE

                    02B -> YELLOW



                  ERRATA: IMPORTANT!!! READ THIS!!!

                  There are several errors in the datasheet for the L6470:

                  - the internal oscillator is specified as 16MHz +/- 3%. Experimentally, it

                     seems to be more like a 6% tolerance.

                  - when transitioning from one movement command to another, it may be necessary

                     to include a dSPIN_SoftStop() between the two to ensure proper operation. For

                     example, if dSPIN_Move(FWD, 800) is used to move 800 steps FWD, and

                     immediately after that, with no soft stop between them, a dSPIN_Run(FWD, 200)

                     command is issued, the 'run' command will execute with a speed based on the

                     value in the 'MAX_SPEED' register, the way the 'move' command did, and NOT

                     with the speed passed to it by the function call.


                  Initial release.




                  dSPIN_example.ino - This file. Constant definitions for register names, pin

                     redefinitions, and bit field names.

                  dSPIN_commands.ino - Contains high-level command implementations- movement

                     and configuration commands, for example.

                  dSPIN_support.ino - Contains functions used to implement the high-level commands,

                     as well as utility functions for converting real-world units (eg, steps/s) to

                     values usable by the dsPIN controller. Also contains the specialized configuration

                     function for the dsPIN chip and the onboard peripherals needed to use it.

                  dSPIN_main.ino - Contains the setup() and loop() functions.




                  // include the SPI library:

                  #include <SPI.h>



                  #define SLAVE_SELECT_PIN 10  // Wire this to the CSN pin

                  #define MOSI             11  // Wire this to the SDI pin

                  #define MISO             12  // Wire this to the SDO pin

                  #define SCK              13  // Wire this to the CK pin

                  #define dSPIN_RESET      6   // Wire this to the STBY line

                  #define dSPIN_BUSYN      4   // Wire this to the BSYN line

                  • 1,101. Re: Have a question about Arduino? Ask me!

                    Thank you Billabot !!! This gives me a good start !

                    • 1,102. Re: Have a question about Arduino? Ask me!



                      Can I use an arduino to control things that run on 15 amp 120V US household electricity like a coffee maker or sprinkler valve?

                      • 1,103. Re: Have a question about Arduino? Ask me!

                        Kevin you can with a relay module or relay sheild TE has a number of different choices.

                        • 1,104. Re: Have a question about Arduino? Ask me!

                          It always concerns me to see people wanting to 'play' with mains power.


                          While some get it right, I've seen so many potential disasters/accidents waiting to happen that I cringe....



                          I needed to do a project for an article that was switching mains power, and decided there had to be a way to let people safely switch things on/off and NOT have to do any mains wiring.


                          I found (the NZ/AUS version) of these and decided to use them.



                          Luckily the guys at this forum have saved me hacking into the remote, PLUS given the opportunity have more than 3 devices.



                          Basically you use a 433MHz cheap Tx module and it sends the On or Off code to the remote switch.



                          I wrote it up here for the Digispark, which had the library functions reduced to fit in the limited code space.


                          It also includes a spreadsheet of the codes for more devices (based on the NZ version)




                          You may find this option easier than having wiring running to various places, along with the problem of making it safe.

                          In NZ we have insurance issues if illegal wiring is found to have caused the problem.



                          Most of the relay boards I have seen do NOT have enough isolation between the relay output tracks and the lower voltage tracks that I would consider safe under all conditions.

                          I would suggest using an optocoupler board that drives external relays or simply use SSRs.

                          Care is still needed to ensure isolation.

                          Also remember this forum covers a multitude of countries, which are 230v and referenced to earth, not floating...




                          • 1,105. Re: Have a question about Arduino? Ask me!



                            You are right about the sheilds but there are a number of relays that can handle the load. I forget that not a lot of people know the diffrence between AC/DC and how you need to set things up properly without killing yourself or burning your house down. I'll remember to explain next time about isolation of the DC and the AC mains and how care is needed when working with AC mains.


                            Much Obliged,


                            • 1,106. Re: Have a question about Arduino? Ask me!


                              Sorry wasn't really aimed at you in particular.


                              The relays can handle the load, but sometimes the pcb tracks are not wide enough for that load, or the connector isn't rated for the full load.

                              Unfortunately some of the quality is not up to that loading either, so again you have a fire risk, from a poor connection.


                              Sometimes the physical spacing of the tracks to lower voltages isn't enough either, rising to the comment about isolation.

                              The internal wiring inside that box should have an insulation rating that matches the mains voltage, and most doesn't, so therefore it needs secondary insulation, while inside the box.


                              If anyone is doubting this, imagine if the mains wiring you added to control that coffee maker, is stuffed into the box.

                              Unknown to you the mains wire had a nick or crack in the insulation, and it was resting on the Arduino control wire, that is a piece of ordinary wire.

                              Add some moisture and you have a good chance that when you are holding onto the Arduino or wire, you could get an electric shock, because you have become the path to ground.


                              In theory any wiring requires it to be certified (well here anyway in NZ) so you also have those issues.


                              While I'm happy to indicate an unsafe condition, I'm not prepared to give advice on how to do it, as I have no control of the end product ....

                              .... hence the reason I opted for something that plugs in. ..beside it was cheaper than 3 relays and 3 boxes plus the other bits.


                              Now DC .... below 48v is another thing ....




                              • 1,107. Re: Have a question about Arduino? Ask me!

                                I found (the NZ/AUS version) of these and decided to use them.



                                Basically you use a 433MHz cheap Tx module and it sends the On or Off code to the remote switch.

                                Yeah, those are very nice.  I have one I use to control a 4 tube flourescent fixture to make my living room very bright.

                                • 1,108. Re: Have a question about Arduino? Ask me!

                                  To all the answers above, Thank You!  I appreciate your concern for electrical safety, as well.  Very professional site here.

                                  • 1,109. Re: Have a question about Arduino? Ask me!

                                    Dear Jeremy, I have a question regarding controlling a robotic arm (powered by arduino) via mobile application such as iOS and Android platform.  Moreover, as far as I am concerned there are only 2 possible ways to control the robotic arm, the first method would be to control it via web server(arduino with the ethernet shield connected) whereas the second method would be to purchase a Bluetooth Low Energy module which is avaible via Sparkfun. My ultimate question is that which platform is much more suitable to be used to control the robotic arm? If I were to venture into the iOS platform what kind of limitation will I face? Thank you

                                    1 72 73 74 75 76