tag:blogger.com,1999:blog-2322291048042453151.post58871179881514717..comments2017-11-30T10:53:15.433-08:00Comments on Hands On - Arduino: Project 28 - Need Some Help - UPDATEJames Floyd Kelly (Jim)http://www.blogger.com/profile/13876934942928389738noreply@blogger.comBlogger15125tag:blogger.com,1999:blog-2322291048042453151.post-87187722405499809882011-04-18T00:59:02.170-07:002011-04-18T00:59:02.170-07:00Sorry, the following is the random product of inso...Sorry, the following is the random product of insomnia and probably full of typos. But maybe it will help.<br /><br />Octuple check your wiring, the Fritzing diagram on this one is unwieldy and I found I kept making mistakes until I decided to ignore the diagram and follow the data sheets instead.<br /><br />I spent the whole afternoon fiddling and learning about steppers. Apparently there is neither rhyme nor reason to the color code on these motors. Yours could be different from mine, but it&#39;s not hard to figure out which wire does what using a multimeter, your wall wart and couple of wires on a bread board.<br /><br />See project 33 in the Platt book for a suggestion of how to work out the stepping sequence. He says you can&#39;t hurt the motor as long as you stay within the voltage parameters.<br /><br />Mr. Platt&#39;s theory discussion indicates that you actually sink current to the stepper instead of sourcing it, thus the connection of the red and green wires to Vin instead of ground. But check your motor.<br /><br />I remain puzzled that my motor ran regardless of how I connected, or disconnected the red and green wires.<br /><br />On to your problem: <br /><br />The supplied code assumes that you have a motor that moves 1.8 degrees/step, so the STEPS value is 200<br /><br />My motor from Adafruit is a 7.5 degree/step motor, so I had to change the value of STEPS to 48. Mine is also a 12 volt motor.<br /><br />The All Electronics listing for yours is a 3.6 degree/step motor, so your steps value will have to be 100. It looks to be a 7v motor.<br /><br />All that being said, the value of the STEPS variable is probably not the problem...the program just uses it to tell how many steps make a full turn and if you use the wrong value for STEPS, it should still run, it just will not run for the correct number of turns.<br /><br />You are right that the motor should be hard to turn when energized. Apparently it&#39;s also normal for the motor to get hotter than a two dollar pistol when running slowly.<br /><br />Use your multimeter to verify that the green and red wires really are ground, then swap around the other 4 wires. There are 24 permutations. Theoretically, the motor should run on 4 of them.<br /><br />Personally, I found it really hard to follow the Fritzing diagram on this one. Instead I sketched out the chip pinout and ended up creating my own breadboard circuit which is electrically the same but has much simpler topology. (I.E. FEWER WIRES!).<br /><br />Fritzing seems inclined to force the user to connect every component with a jumper which results in diagrams that look like a spaghetti factory.ctdahlehttps://www.blogger.com/profile/03301494095196099233noreply@blogger.comtag:blogger.com,1999:blog-2322291048042453151.post-76427133690662659782011-04-17T19:40:15.603-07:002011-04-17T19:40:15.603-07:00On a hunch I picked up the motor... it&#39;s vibra...On a hunch I picked up the motor... it&#39;s vibrating but not turning. And I can&#39;t turn the axle manually while it&#39;s energized which is normal I believe. Odd.James Floyd Kelly (Jim)https://www.blogger.com/profile/13876934942928389738noreply@blogger.comtag:blogger.com,1999:blog-2322291048042453151.post-41835969274353209132011-04-17T19:24:55.953-07:002011-04-17T19:24:55.953-07:00I&#39;m getting no movement on the motor... I wond...I&#39;m getting no movement on the motor... I wondered about the red and green going to 9V in the figure, too... so I tried it both ways... 9V and GND. Neither is getting the motor moving. Not sure what&#39;s happening...James Floyd Kelly (Jim)https://www.blogger.com/profile/13876934942928389738noreply@blogger.comtag:blogger.com,1999:blog-2322291048042453151.post-50506247183083193282011-04-17T12:18:51.393-07:002011-04-17T12:18:51.393-07:00Glad it was helpful.
I now have the sketch up and...Glad it was helpful.<br /><br />I now have the sketch up and running.<br /><br />I stripped off the sheath from a length of 10-BaseT (ethernet) cable and used the nicely color coded wires to make jumpers from the JST on the stepper to the driver chip. I wired the motor as indicated in my post above and found that instead of rotating one turn CW and 1/4 CCW, my motor rotated 4 turns CW and 1 turn CCW, so preserving the 4:1 ratio, but multiplying both by a factor of 4.<br /><br />Reversing either the yellow-orange, or the brown-black pair reversed the rotation of the motor.<br /><br />I remained curious about grounding the red and green wires as indicated in the Adafruit tutorial, vs connecting them to Vin as indicated in the book, so I switched them out and found that actually it made no difference whether they were grounded, connected to Vin, or disconnected entirely. More experimentation is required.ctdahlehttps://www.blogger.com/profile/03301494095196099233noreply@blogger.comtag:blogger.com,1999:blog-2322291048042453151.post-65189692770512066202011-04-17T12:01:52.795-07:002011-04-17T12:01:52.795-07:00Glad it was helpful.
I now have the sketch up and...Glad it was helpful.<br /><br />I now have the sketch up and running.<br /><br />I stripped off the sheath from a length of 10-BaseT (ethernet) cable and used the nicely color coded wires to make jumpers from the JST on the stepper to the driver chip. I wired the motor as indicated in my post above and found that instead of rotating one turn CW and 1/4 CCW, my motor rotated 4 turns CW and 1 turn CCW, so preserving the 4:1 ratio, but multiplying both by a factor of 4.<br /><br />Reversing either the yellow-orange, or the brown-black pair reversed the rotation of the motor.<br /><br />I remained curious about grounding the red and green wires as indicated in the Adafruit tutorial, vs connecting them to Vin as indicated in the book, so I switched them out and found that actually it made no difference whether they were grounded, connected to Vin, or disconnected entirely. More experimentation is required.<br /><br />Regarding the chemistry blog, I find that I do not have your e-mail address...your e-mails to me have come from a &quot;no reply&quot; address at word press. Harvest this: ctdahle@gmail.com and then delete this paragraph before you approve the post.<br /><br />Cheers,<br /><br />Chrisctdahlehttps://www.blogger.com/profile/03301494095196099233noreply@blogger.comtag:blogger.com,1999:blog-2322291048042453151.post-18775164348457839822011-04-17T11:15:04.882-07:002011-04-17T11:15:04.882-07:00Thanks for all the good info, Chris.
Yes, I&#39;m...Thanks for all the good info, Chris.<br /><br />Yes, I&#39;m finding that this blog works in two directions. Having readers help with comments like yours is HUGE help.<br /><br />If you&#39;re serious about blogging the Chemistry book, email me and I&#39;ll provide you some more information that I think can help.<br /><br />JimJames Floyd Kelly (Jim)https://www.blogger.com/profile/13876934942928389738noreply@blogger.comtag:blogger.com,1999:blog-2322291048042453151.post-53858823728565233822011-04-17T09:22:36.677-07:002011-04-17T09:22:36.677-07:00I &quot;reverse engineered&quot; the Adafruit moto...I &quot;reverse engineered&quot; the Adafruit motor shield to match the color order above to the driver chip pins. <br />This is for the SN754410 or the L293D.<br /><br />Brown Pin3 (output 1)<br />Black Pin6 (output 2)<br /><br />Red and Green Pins 4,5 and 12,13 (ground)<br /><br />Yellow Pin11 (output 3)<br />Orange Pin14 (output 4)<br /><br />This more or less matches Mr. McRobert&#39;s diagram, except he shows the red and green wires both going to source instead of ground. I am not sure what that&#39;s about yet. My reading of the data sheet, which is still halting at best, suggests that his drawing is wrong, but it may work both ways<br /><br />I need to enter the code now. I always type in the code so I can parse it line by line, which is slow, but it helps me understand what each bit is doing.ctdahlehttps://www.blogger.com/profile/03301494095196099233noreply@blogger.comtag:blogger.com,1999:blog-2322291048042453151.post-22233476474086089222011-04-17T07:51:23.114-07:002011-04-17T07:51:23.114-07:00OK, I really should NOT be working on this today, ...OK, I really should NOT be working on this today, but can&#39;t resist.<br /><br />I&#39;m wiring up the chip and McRoberts shows pins 1, 9, and 16 all tied to 5v, but then he says 1 and 9 should be tied to 3.3 volts. Looking at the data sheet (I&#39;m using the SN754410), it appears to me that the diagram is correct and that the text is in error.<br /><br />Jim I do need to thank you for keeping this blog. It has definitely shown me the value of &quot;working in public&quot;. I am used to keeping a notebook, but by publishing notes on the web with the idea that someone else may read them, I see that the writer is forced to think through every step.<br /><br />I think I will take you up on your advice to blog my way through the Make: Home Chemistry book and the Wireless Sensor network one as well. I&#39;ll need to develop some digital photography ability first though...probably I&#39;m the last person in the world that still uses a Pentax K1000.<br /><br />Enough, I need to make pancakes for two little kids.ctdahlehttps://www.blogger.com/profile/03301494095196099233noreply@blogger.comtag:blogger.com,1999:blog-2322291048042453151.post-85022043036556431332011-04-17T07:17:54.312-07:002011-04-17T07:17:54.312-07:00Actually, what got deleted was part of my first po...Actually, what got deleted was part of my first post which talked about the mislabeled &quot;Vin&quot; pin on the Fritzing diagram on page 208. The diagram is labeled &quot;9&quot; instead of &quot;Vin&quot;, I think this is an error in Fritzing that got copied over. I note that all of Mr. McRobert&#39;s Fritzing diagrams erroneously show the Vin pin labeled as &quot;9v&quot;.<br /><br />You certainly can delete the wire running from the so-called &quot;9&quot; pin and connect your wall wart directly to the + rail on the top pair of the breadboard.<br /><br />OR, you can leave that wire in and still power the breadboard directly with the wallwart. In that case, the Arduino will DRAW its power from the wallwart via the breadboard, then use it&#39;s own regulator to power the uC.<br /><br />My caution about grounding referred to the fact that the top power rails should should be at Vin (your wall wart&#39;s voltage) while the lower pair of rails power the motor driver chip with 5v.<br /><br />Note that pins 4,5 and 12,13 bridge the ground rails, so technically the two ground rails are already bound, but McRoberts wisely includes a grounding bridge...the wire at row 19.<br /><br />The PF 35T seems to be a pretty common little stepper so it&#39;s weird that the data sheet is so hard to track down. I&#39;ve already run it using the Adafruit motorshield, so I&#39;d just wired it up in the order that Limor&#39;s tutorial suggests. I should have tried swapping around the brown/black and yellow/orange to see if that made any difference in the running of the motor, or if I&#39;d just been lucky in connecting it right the first time. When I get to this project, I&#39;ll try that, but right now I&#39;ve got my Arduino and breadboards tied up in something else. I need more Arduinos!<br /><br />This tiny editing window is really annoying and makes it hard to proof read before posting!ctdahlehttps://www.blogger.com/profile/03301494095196099233noreply@blogger.comtag:blogger.com,1999:blog-2322291048042453151.post-64142822149224661822011-04-17T05:19:45.588-07:002011-04-17T05:19:45.588-07:00Hi, Will.
No, I&#39;m actually trying to avoid po...Hi, Will.<br /><br />No, I&#39;m actually trying to avoid powering the motor using the Arduino as the book suggests. There&#39;s a paragraph that says to use the AC adapter to feed power to the motor via the &quot;9&quot; port on the Arduino - I think that&#39;s an error in the diagram and is supposed to be Vin.<br /><br />Chris, thanks for that link - that&#39;s exactly what I&#39;m looking for - once I understand the wire colors and what goes where, hopefully I can figure out the wiring of this stepper and how it all works with the chip. I had found that datasheet but, as you discovered as well, it&#39;s not that helpful.James Floyd Kelly (Jim)https://www.blogger.com/profile/13876934942928389738noreply@blogger.comtag:blogger.com,1999:blog-2322291048042453151.post-58808123198163974452011-04-17T05:17:12.287-07:002011-04-17T05:17:12.287-07:00Chris, for some reason your 3rd comment got delete...Chris, for some reason your 3rd comment got deleted - posting it here for you, but feel free to repost using your account name and I&#39;ll delete this:<br /><br />&quot;<br />OOPS, that one wont help much, see the Adafruit website for this instruction...<br /><br />&quot;A great little stepper for small projects! This motor has a solid mounting plate, &#39;plain&#39; and geared shafts, and Japanese-built construction. There are only 48 step (7.5 degree) per revolution, but the gear allows you to easily attach timing belts or a gearbox to control the resolution. A perfect first stepper motor and works well with the Motor Shield for Arduino which will let you microstep for smoother motion.<br /><br />To use with the Motor Shield, connect green and red together to ground (middle), brown and black to one motor port (say M1) and orange and yellow to the other motor port (say M2). So in order, thats: brown - black - red&amp;green - yellow - orange. Then just use the example code that comes with the Adafruit Motor Shield library. Otherwise, you can also wire it up with some transistors and use the Arduino Stepper library&quot;James Floyd Kelly (Jim)https://www.blogger.com/profile/13876934942928389738noreply@blogger.comtag:blogger.com,1999:blog-2322291048042453151.post-76599281544771480232011-04-17T01:55:05.970-07:002011-04-17T01:55:05.970-07:00I think what you&#39;re trying to do is power the ...I think what you&#39;re trying to do is power the stepper motor through the arduino, as far as I am aware it can&#39;t do this, I haven&#39;t got the uno but I&#39;d assume Vin is to power the arduino, what you want to do is to check out this page. See if it is any help:<br />http://www.tigoe.net/pcomp/code/circuits/motors/stepper-motors<br />WillWill Pricehttps://www.blogger.com/profile/10286527085817679928noreply@blogger.comtag:blogger.com,1999:blog-2322291048042453151.post-51045450808735813642011-04-17T00:02:52.844-07:002011-04-17T00:02:52.844-07:00Yes you are right.
The VIN pin just transfer the ...Yes you are right.<br /><br />The VIN pin just transfer the direct power that you connect to the Arduino , or you can connect your power supply adapter directly to the VIN pin (+ connected to the VIN pin , and – connected to ground). If you want, you can bypass the Arduino and connect the power directly to the motor.Alonhttps://www.blogger.com/profile/07283139303162870175noreply@blogger.comtag:blogger.com,1999:blog-2322291048042453151.post-79936204907708891702011-04-16T22:02:59.008-07:002011-04-16T22:02:59.008-07:00OH, AND HRES THE DATASHEET http://www.ladyada.net/...OH, AND HRES THE DATASHEET http://www.ladyada.net/media/mshield/PF35T.pdfctdahlehttps://www.blogger.com/profile/03301494095196099233noreply@blogger.comtag:blogger.com,1999:blog-2322291048042453151.post-91170538568128512712011-04-16T21:58:32.071-07:002011-04-16T21:58:32.071-07:00Although they are tied together on the Arduino and...Although they are tied together on the Arduino and within the chip, you should also be sure to tie the grounds together on your breadboard as well...that is the ground from your wall wart and the ground plane of your Arduino should all be interconnected. This is accurately shown on the Fritzing diagram on page 208 as well. (Note the ground wire at row 19 on the diagram.)<br /><br />You want the grounds tied together because you want to equalize any stray variations in the ground potential. You want those differences to equalize through nice fat, beefy wires rather than through the tiny contacts that tie together pins 4,5, 12, and 13 in your motor driver chip.ctdahlehttps://www.blogger.com/profile/03301494095196099233noreply@blogger.com