Showing posts with label Shields. Show all posts
Showing posts with label Shields. Show all posts

Saturday, November 16, 2013

iRobot Create - Arduino interface cable

This post details the construction of a custom Arduino interface shield and cable for the iRobot Create. See my tutorial series on the iRobot Create. This cable allows the user to easily and cleanly interface with the Create and communicate with it via the Arduino Mega2560's Serial1 port.

Parts List:

Assembly is fairly self explanatory when you see the pictures. Here are a few useful charts.

Arduino Mega PinCreate Cargo Bay Pin
TX1 (pin 18)RXD (pin 1)
RX1 (pin 19)TXD (pin 2)
GNDGND (pin 14)

The chart above shows the connections that must be made. Note that Serial0 on the Arduino cannot be used without additional external hardware.




Cargo Bay Pinout.JPGArduinoMega pinout.png
First things first, assemble the protoshield as per THESE instructions.

Next, solder the ribbon cable to the DB25 connector. I chose to do it in such a way that the pins would be mirrored on both end. Note the way the ribbon cable connectors work, every other wire is connected to the top row. Really, the only important thing is that you include pins 1, 2 and a ground. Crimp the ribbon cable connector on.

Now you need to solder on some male headers to the protoshield. This is where the ribbon cable will connect.

Connect the male header that corresponds to the ground to the ground pin on the Arduino. Use the colored wire to make a jumper that will go from the RXD and TXD pins to the Arduino TX1 and RX1 pins respectively (in the picture below, it is the black and white wire in the bottom center).

Note that Serial1(TX1/RX1) must be used on the Arduino Mega (the Uno will not work without external hardware). The serial port output TXD from the Roomba/Create is too weak to drive the RX serial port (Serial0) input of an Arduino properly. This is because of the USB-Serial converter on the Arduino: it also tries to drive the RX serial port input via a pullup resistor, but the Roomba does not have enough drive to pull the RX down below about 2.5 volts, which is insufficient to be reliably detected as a TTL serial input of 0. Furthermore, using Serial1 still allows for the use of the Arduino Serial Monitor for debugging purposes. Also note that Serial2 or Serial3 could be used if selected in software.

Test your board and see if it works!

I hope this post was somewhat useful. It isn't so much of a how to as it is a description of what I did. There are many ways to do it. Really, the only important thing is that you connect TXD to RX1, RXD to TX1, and GND to GND. When you do that, you'll be ready to head back to my tutorial series!

Matthew

Tuesday, March 5, 2013

LCD Shield: Calculator

     Today I have for you another project I did with my HobbyKing LCD Shield and my Arduino Mega 2560. I made a calculator! One day I decided that my Texas Instruments calculator was simply not enough. Necessity is the mother of invention so..

     Anyway. I did all I was going to do on my toolbox alarm, so I decided I would start on something new. I thought a calculator would be fun. That's what I did.


What it does now:

  • The user selects add, subtract, multiply, or divide
  • The user inputs the first value
  • The user inputs the second value
  • Answer is calculated and printed to screen

Work for the future:

  • Select number by digit (ie. 1000 = 1-0-0-0. Current model would involve 1000 button pushes)
  • Add push and hold to scroll functionality
  • Add other functions: sine, cosine, power, etc.

      Now I realize that much of the way I did things was a bit impractical. Creating a separate function to add two values is kinda useless. However, this was meant to be a learning exercise. The code that runs the LCD is still mostly the example code found HERE. I did create the menu and such, and that was really the focus of the exercise. I knew I could do it; I wanted to prove that to myself.

Stuff you might want:


     If you are using my code, note that I make no guarantees that it is perfect. If you are just buying the shield, note that I have a review that might interest you. If you have questions, comments, or concerns, post a comment or send me an email. 

     If you choose to undertake this project, I hope you find it interesting. I don't know that I learned anything specific while working on this, but I honed my debugging skills and such. I think this may be the last of my LCD shield projects for a while. I have one more in mind, but that may wait. I've got my ATtiny's waiting on me as well as my IMU that I have been playing with. So much to do, so little time. Anyway. I hope you found this interesting.

Until later,
Matthew

Saturday, March 2, 2013

LCD Shield: Toolbox Alarm


Well I’m back. As you all know, I received my new Arduino and have been playing with it. I must admit having it not tied to a little robot is quite nice, so I haven’t put it on the bot yet. Instead I have been playing with my forgotten LCD shield from HobbyKing. Oh yes you say. I remember that one. Well I have been doing some more stuff with that and decided it’s time to share that with the world. Here it is.
            Today I will talk about the first project I embarked on. It is called the toolbox alarm. This project is a copy of a similar project that is used here at Tech in one of the classes. I just stole it and decided that if I’m going to do this stuff, I should be able to do the less interesting things too. Well I was a bit surprised. I actually found this project slightly fun.


Project Description: Create an alarm system for a toolbox. It should prompt for a 4 digit button sequence and then allow you an amount of time to close the lid. Next, a light sensor will read the light level. If the light level changes (ie. the toolbox is opened) the user will have a certain amount of time to re-enter the passcode before a buzzer sounds.

Well I should tell you that I did not do that. My alarm has no light sensor or buzzer. It just gives you a pat on the back if you get it right and an incorrect if you don’t. Basically, mine is completely useless as opposed to just extremely impractical.

Anyway, I really liked working on this. I got more accustomed making functions and such. The more time you spend looking at code and working on it the better.

I guess that’s about all I have for today. If you want the code I created, get it HERE. It’s free and all that jazz. Go forth and do with it what you wish. If you somehow find a way to make lots of money on it, send me a nice gift or something (I’m pretty confident that won’t happen). The video below is of it running.

            If you need the example code it is HERE. If you need to buy the LCD shield it is HERE. If you want my review of the LCD Shield it is HERE. I can’t think of anything else you’d want. You can find info on the LCD library on your own at arduino.cc.

            I have at least one more LCD shield project I will talk about soon as well as the return of the IMU (That is what I was working on when I fried my last board) and all the sonar sensor stuff. I can’t say which will be next. It depends on my mood. I hope you’ll check back in to see that. If you have any questions about this project, post in the comments or send me an email.

Matthew

Monday, February 25, 2013

New Source for Cheap Parts?

Ok. I just found a great website online and had to tell people about it. I have never ordered from there but I no doubt will soon. http://yourduino.com. They have all kinds of cheap started kits and stuff I've been ordering from eBay for about the same prices.

They also have several Arduino Compatible micro controllers that I would look into. Some have built in servo connections and such. If I hadn't just ordered some stuff from elsewhere, I would probably be buying something from there.

Things that caught my eye:

  • Their shields (the motor controller shield)
  • Their micro controllers (YourDuinoRobo1- $17)
  • The pre-made drive platform
  • The cheap stepper motors
  • The various sensors
  • The starter kits.
  • The jumpers, resistors, etc.
Some of the starter kits actually looked pretty good. I didn't look too in depth. I'm sure some stuff is missing, but it might not be a bad place to start. The robot platform doesn't look to shabby either. I didn't check shipping on the heavier stuff, but some of you might want to look into it.

I realize this is a bit out of the blue, but I honestly am not affiliated with them in any way. I just stumbled across their site when looking for cheap stepper motors and then saw the micro controllers  Then I saw the shields. Then I starting going through practically every page.

That's all I have for today If anyone has bought stuff from there please comment. I would personally love to know what kind of service they provide. 

See you later,
Matthew

Saturday, January 19, 2013

Review: HobbyKing Arduino Sensor Shield V4.

Well I'm back. Here comes the last of the promised reviews before we get to the fun stuff.

Today I am reviewing the HobbyKing V4 sensor shield as found HERE. Now, when I ordered this shield this was the only one available. However, I have noticed that they have other versions now too (the V5 and others that are just different colors.. Don't ask me what's up with that. I don't know).
If you prefer these shields they can be found HERE and HERE. I will mention some apparent differences in these later, but be warned, I don't have those boards. 

When I got this shield I didn't really know what I was buying. I was completely new to Arduino, but I saw sensor expansion board and thought, "Yeah, I want to connect sensors." Well shows what I knew. The obvious fact is, you don't need this board to connect sensors. It just makes it more convenient to do so. It gives you nice male pins to plug all your sensors into.

The two things that really attracted me about this board was 
A. It was cheap. $5.20 is pretty good.
B. It appeared to be made to connect standard hobby servos to the Arduino.

Well this is partially true. It is cheap. It is a great price. 5 stars there. But B. Well it does make it more convenient to plug servos into the Arduino, but if you are going to be running more than one servo, you will need to wire in external power. I will go over this in a later blog.

Basically the Arduino can only provide 40mA per io pin. Some people claim more, but don't tempt fate right? Servos can draw considerably more than that depending on the circumstances, size, etc. But let me say this,

This board does NOT allow for an external power source to be hooked up to power the servos.

There. You have been warned. The v5 supposedly does have some such deal that allows you to wire in power to the V pins (look at the picture) preregulator via the added screw terminal. I have no idea if this works well or not. I personally would do it myself and not risk it.

That is about it on this shield. It does do what it says on the box. I will note that it fits on the Mega. It leaves the back half of it open so that you can still access the unused pins. The only issue is that the I2C port is not on the same pins as on the shield(the shield is made for an Uno), so you will have to wire it manually (to pins 20 and 21, but that will come later). For an Uno it should work fine. In case you don't know what I'm talking about, that isn't a reason to get an Uno instead of a Mega. Still get the Mega. Its cooler.

  • Price: I already covered. ~$5.00. Can't really beat that.
  • Documentation: Well there isn't really any, but its kinda self explanatory when you get it. It just wires the io pins, 5V, and gnd to male pins for easy sensor connection.
  • Quality: I have been very happy with it. It has lived on top of my Arduino since I got it. Very sturdy. All the solder connections seem good. I am happy.
  • Durability: It has withstood me tugging at wires and such for several months. I would say it is on par with any other shield out there. I can't see you doing much better.
Overall, it is a nice shield. I would recommend it or the v5 to anyone. If you are trying to decide between the two, its really up to you. I'd get the v4 and save $5, but a valid argument can be made for both sides. I'm just cheap.

"I'm broke. Is this absolutely necessary?"
No. Of course it isn't. Get it anyway. You'll thank me later. I is an extremely useful tool and will make your life easier. Allow me to explain. I didn't buy real hookup wire. I use some extra wire (22awg I think) from when my dad and I replaced the garage door opener at the house. Well at some point I got over zealous with the wire strippers and nicked the wire. I now have a little piece down inside one of the gnd pins on... the shield! Not my Arduino. Yes this is a good thing. I'd rather break a $5 shield plugging and unplugging stuff than a $18 Arduino. It is also completely stackable (though not really functional to do so). Plus, it will fit nicely in a HobbyKing order with the Mega and one other shield. I know. I did this. Just get it. You'll thank me later.

So anyway. This should be the last of the long HobbyKing reviews for a while. Next I'll post some pictures and begin talking a bit more about what I did with these parts. I'll also list some other parts you might want to get (jumpers, resistors, etc.). There are cheaper places than Radio Shack. Trust me. So stick around. 

Until Later,
Matthew

Sunday, January 13, 2013

Review: HobbyKing Arduino LCD Keypad Shield

Welcome back. Today I will be reviewing the HobbyKing Arduino LCD Keypad Shield (this blog won't be all reviews I hope, but this seems fitting).

When I first ordered my Arduino this was one of the two shields that I ordered with it. It is just what it says on the package. It is an Arduino LCD shield with 5 buttons (6 if you count the reset). It fits perfectly onto my Arduino Mega from HK. I would post a picture of this, but my Arduino is busy at the moment. I honestly have not used the shield since maybe a month after I got the board. It does have 5 buttons you can use, but I quickly moved on to greater things.

This board does not use the serial connection like I understand some LCD shields do. This one actually uses a combination of pins. While all of the pins it plugs into are not used, and one could theoretically solder on headers to the blank holes left on the unused pins, I do not recommend this to the beginner. Or really anyone. It just seems like a bit of a waste of time. You have another 30 or so IO pins still open for your use.

Now, I began trying to make this shield work with no programming experience whatsoever. I have been around robotics long enough to have a basic understanding of programming logic, but I lacked any knowledge of syntax, etc. I managed to get it to work with only code examples I stole off the hobbyking website. I did not write this code nor can guarantee its effectiveness, but I have put the code in my Google Drive in case Hobbyking decides to remove it. It can be found HERE. I hope this will help anyone that may need it.

But anyway.. I should cover the major points. First, you can buy it HERE.

  • Price: It is regularly $8.99, but if you leave the page open for a while it will give you an offer to buy it for $8.32. So I would do that. This is very competitively priced. You may be able to buy something for that price on Ebay, but I would far prefer to get it from a company with a face and reputation to maintain. Plus, I trust Hobbyking more. Call it a fools trust, but they've never treated me badly before except out of my own stupidity.
  • Documentation: Again, there isn't much, but a quick Google search is all it takes to get some. Besides, you're of the tech generation. you wouldn't have read the papers anyway. And this is more fun.
  • Quality: I must admit, the quality was not as nice as the Arduino itself. It was a little rough around the edges, but overall I would say good quality. Mine worked perfectly. It came wrapped in nice anti-static packaging. Seemed like grade A stuff (perhaps an A-).
  • Durability: Well its an Arduino shield so.. it ain't great. But mine survived while I used it.
Overall, this is a nice little board. If you want one, I'd say go for it. I don't know how it stacks up with the serial version they sell. I don't have one of those, but this thing does what it says. It gives a cheap display and five buttons to play with. 

Now, I am glad I have it, but I honestly haven't used it in a while. I have moved on to do more robotics oriented stuff, and it just gets in the way. If you are tough on cash, I would not rate this as a must have. But if you are looking to build a well rounded Arduino arsenal, for $12 or so with the shipping added, I don't see how you could go wrong, especially when the other one (HERE)  is over double the price.

Check out these cool projects using this shield HERE and HERE

That is my take on things anyway. Hope you found this useful and will tune in again sometime. 
Until later, 
Matthew