Wednesday, April 13, 2011

While I Wait...

While I wait for a little cheap-o stepper motor to arrive for the next project, I thought I'd share with you something Arduino-related that I just got my hands on - it's the MintDuino from MakerShed... and it's totally cool... and really fun to build.

Everything you see there on that little breadboard fits in that tin. The breadboard actually folds up - the power/GND columns fold back and then up to snap into place, making it fit nicely in the tin, too. It took me about 20 minutes to assemble using the instructions over at MakerShed, and it's not as "user friendly" as a real Arduino due to the lack of labeling... but that, to me, is where the fun begins.

I took the MintDuino and began comparing it to the Uno... I used the circuit tracing that you can see on the surface (front and back) of the Uno and was able to determine which pins are which on the Atmel chip. If you want to gain a little better understanding of the Uno's circuitboard, build your own MintDuino and things start to click. (Not everything... I'm still learning and figuring things out - there's a lot more I don't know than what I do know...)

Blocked Comments - UPDATE

I've received word that commenting may have been disabled on this Arduino blog... not sure what happened there, but I've made a change to the rules to allow registered users (and OpenID users) to post comments.

The old setting was "Anyone" and one day I woke up to find the same spam comment posted on every post in this blog... that's what forced me to change it to Google account users... that may have been the problem.

I hope this fixes the issue, and I apologize if anyone has posted comments that didn't make it... I'll watch this for a few days, but if a few readers reading this will try to post a simple comment to this post just so I can verify it's working, I'd appreciate it.

UPDATE: I got a lot of comments today so I think it's working again... I'm going to flip it over to accepting comments from EVERYONE (no special accounts needed) but I'm going to turn on moderation so I approve comments first... that way I don't wake up to 50 comments appearing from spammers! Thanks, all, for your understanding and patience as I worked this out.

Thursday, April 7, 2011

Project 27 - Joystick Servo Control Part 2


It didn't take me that long to solder the six wires to the joystick, so I went ahead and plugged it in to the circuit I made in Project 26... pushing the joystick forward or backward causes one of the servo motors to rotate ... pushing the joystick left or right causes the other servo to rotate.

The code is also fairly straightforward and easy to understand... I can totally see how you can create remote control devices using a couple of joysticks and servos. (Notice I said devices, not robots - I'm still in that group that believes any device that is tethered to a remote control is NOT a robot... a debate for another day.)

Now - a question - in the code each potentiometer has a value that is read between 0 and 1023... that's a 10 bit number if I'm correct. This number is then "mapped" to a value between 0 and 180 for the number of degrees to rotate. So... why 1023? Do the potentiometers send a 10bit signal that represents direction and rotation? I'm still trying to understand that little bit of code... any help out there?

Two videos below... first shows a closeup of the joystick I soldered up... second shows Project 27 in action.



Project 27 - Joystick Servo Control

I purchased two of the COM-09032 joysticks from Sparkfun for Project 27... they were only $4.00 each and looked like they'd be fun for a future project so I grabbed them. (I just hope they work - reading through the feedback on Sparkfun seems to indicate a lot of folks are finding them to be broken.)

Here's a data sheet for the joystick. But it's really quite simple if you examine the undersides... the two I bought have a pushbutton switch which is easy to find and easy to figure out which pins belong to it... that leaves six other pins (2 pairs of 3) - and knowing these things work like potentiometers, it's also easy to see how the 3 pins for each potentiometer (each pot is an axis for a joystick) work. Of course, I now need to solder some lead wires onto the ends so I can make them work with the breadboard... so I'll do that tonight and try to get to Project 27 tomorrow.

Wednesday, April 6, 2011

Project 26 - Dual Servo Control

This is an extremely simple project to put together - and I love it. I've had this idea in my head for a while to build my own humanoid robot with servo motors and now that I see what's involved in terms of programming I'm not so worried... I think now I'll be able to focus on the design and how the servo's are mounted and interact.

One thing I like about all these servo motors I'm seeing is how much standardization there is with wiring and mounting options (screw sizes and such).

I've got another project I'm working on right now - co-authoring a book titled "Printing in Plastic: Build Your Own 3D Printer" with Patrick Hood-Daniel. The book should be out in mid-May (just in time for Maker Faire in California where Patrick and I will be demo'ing the 3DP and showing off copies of the book... maybe selling copies if MFaire lets us) and I can't wait to start using it to prototype mounting brackets for my own robot...

Anyway... Project 26 worked - the video will show you how you use the Serial Monitor to send L and R (left and right motors) values, 0 to 180, to rotate the servos. Fun stuff.

Monday, April 4, 2011

Half Way!

Well... I just finished Project 25 which puts me at the halfway mark. Plenty more left to do, but I'm happy to say that I'm learning a lot, especially when it comes to programming. I certainly don't expect this book to teach me every aspect of coding with this language, but I'm amazed at what I'm picking up from the author's explanations of the code - I have to give the author large praises for taking the time to really go over the code - so many books (not just Arduino ones) that I've used in the past simply give you the code and you're just to trust that it works and not get curious about diving into it.

Project 25 is an interesting halfway point for me, as well... I like humanoid robots like the Robonova-1 and I have this itch to design my own one of these days using servos... I could totally see building a custom robot using an Arduino and servos... could be fun.

So, thumbing through the book I see I have some more interesting projects ahead - the RFID and Ethernet chapters are of interest, too, as I have some ideas for some home monitoring activities that I'd like to investigate.

So... thanks for sticking with me as I continue to work through the book. I haven't heard from very many of you about whether you've got the book and are working your way through the projects... let me know if you are and where you are! If you're ahead of me, I think it might be nice to have some guest commentary for some of the later projects... just a thought.

(And, well... because it's just my way... I'm already hard at work trying to figure out what to do next when I finish this book - what can my next hands-on project be? There are some front-runner ideas, but I'm open to suggestions, too...)

Project 25 - Servo Control

Project 25 was fairly easy to wire up and the code is extremely easy to follow. I'm really beginning to appreciate libraries... they make programming the Arduino so much easier. Calling functions by associating them with an object you've created is starting to sink in...

With the delay set to 15ms, the response of the servo turning is almost simultaneous with the turning of the potentiometer. In a second video I set the delay to 1000ms (1sec) and the delay is noticeable... turning the potentiometer in small increments can cause large jumps in the rotation of the servo... not sure when this would be beneficial, so I understand why the author chose a short delay. (But why not a 0 second delay? Hmmm....)

I have a very small servo that has a see-through plastic case... it has the same size motors I used back in Chapter 5 but it has gears that increase the power (or torque?) substantially... pretty cool to see gearing this small driven by such a small motor.