Wednesday, May 2, 2012

Inertial Measurement Unit

It's been a while since I last posted. Apparently with school and studying it's very difficult to have a life. I found this out the hard way when I had to cancel my membership at the rock climbing gym near my school. Along with the demise of climbing, I had to cut back the amount of time that I can dedicate to working on Arduino code and projects. With the summer quickly approaching I hastily ordered a few items that I could work on during my break and hopefully relax a bit and enjoy some desperately-needing-completed completed projects.

Among other things that I'll post about next week, I ordered an Inertial Measurement Unit from DEsquared. The guy there is great, he is very knowledgeable about he has built and is great at helping you get started with reading the device.

That's a 1" square around the board! This thing is tiny and lightweight!


There are two main reasons I went with this device 1; was the cost and 2; was the I2C interface for reading the sensors. The I2C interface is great because this only ties up two of my inputs on my Arduino board, which we all know can be vital in the success or failure of a project. Another benefit is that I can run multiple I2C boards off of the same 2 ports on the Arduino. I think of this like a USB port on a computer. I can add multiple USB hubs to one port and can essentially plug several devices into the same port without any major loss processing ability.

The only restriction that I noticed (but was made aware to me before I bought it) was that the device can't take more than 3.3V. This is an easy fix where I'll just add a 3.3V regulator along with a capacitor coming off of the 5V power source.

As soon as I setup the sample code that was provided to me, I'll post it here so that others who purchase this board can start reading values right away. The gyroscope measures in degrees/sec and the accelerometer measures in g's. This is pretty convenient for those of us who like to measure things using degrees and g forces, but I'll be editing the code to show the gyroscope as both degrees/sec and radians/sec as well as the normal g forces on the accelerometer.


Thursday, November 24, 2011

Ethernet Controller for Pan/Tilt Webcam with Arduino

During the last summer I found myself with a lot of time on my hands. One thing I really wanted to finish was a Pan/Tilt webcam mount and connect it to my ethernet shield on my Arduino. One day, I went out to the garage and started working on a set of "eyes" for my Rover 5 platform when it struck me that I hadn't finished the pan/tilt mount yet.

Once I finished the "eyes", you'll see a blog post on that build soon but this post is on the pan/tilt webcam.  I had a set of angle brackets left over from a DSLR Shoulder mount that I worked on with my brother-in-law, I might post an article on that someday as well. The brackets just happened to work out almost perfectly when I mounted a couple servos inside them with some double-sided tape.


After a couple days of googling for some example code, and finding something that somewhat resembled what I wanted to do, I decided to use that code and try to alter it for use with the servos. Turns out, this wasn't as difficult to do as I thought. In essence, the code for the Arduino just loops through waiting for a certain signal to come back. Once it receives the signal, it runs the appropriate subroutine. In this case, that subroutine is simply a servo command.

The page can be accessed from the intranet by navigating your web browser to the pre-defined address in the code. This displays a set of buttons that, when pressed, will control the movement of the servo. Originally, like you saw in the above video, the webpage had a set of buttons for moving the servos in step increments or in full movements. By full movements, I mean Full Left would move the servo to the  left completely. Well, as computers often do when we trust them too much, my hard drive crashed and I lost my latest revision that worked completely.

In my videos, I have information posted in the comments of how to contact me if you would like the code. One person wanted the code and I happily sent it to them. Not realizing until later that it was not the full code but rather just some code that had 5 buttons with step movements and a centering button. One thing I like is that the centering button checks to see where the servo is at, then figures out where it needs to go to be in the center position. It also moves slowly so that it doesn't look "jerky" on the video.

One last thing that I would eventually like to do is create a way for the Arduino to host it's own iframed web page so that the camera navigation could be separated from the video feed from the camera. When I attempted to put a uStream link of the video feed into the webpage and move the camera around the web page would refresh every time which meant that it was refreshing the video feed as well.

Currently, the movements are pretty basic and the functions are relatively easy to understand as well.

The current version of the code can be found here. If you have any questions or concerns, please let me know.

Sunday, November 20, 2011

Arduino USB Host Shield with USB HID Device

It's been a while since I last made an update, and for some reason I'm still seeing quite a few hits per month on the website. Along with that, I've been receiving quite a few requests for the code that I worked on to display the pot values of the left and right gimbals, the trim pot, and the numerical value for all the switches on a USB Realflight Controller.



When I set out to decipher these values, I had originally thought that I would use it to control a pan/tilt/roll mount that I'm creating for a friend of mine. I've since decided that I will instead use it to create a wireless controller for my Rover 5 robot that I purchased this summer.

Anyway, here is a link to the github repository where you can download the file. You are also welcome to email me if you have any question or concerns with the code.

When I have more time between my studies, I will update the status on the Rover project. It will hopefully be a lot of fun to play with and to use to terrorize my dog.

Friday, June 3, 2011

The Greenhouse Effect

Stephanie and her brother set out to have a grow-off recently.  They bought several different types of herbs and vegetables and wanted to see who could grow them faster, bigger, tastier, and all around better.  When I finally left Philadelphia and moved back to Missoula during the summer before ending up in Spokane, I saw how their plants were doing.....not great.

They had to bring the plants in every night so the deer didn't eat them while we slept. Also, they would forget to put the plants outside sometimes, or they would just shine some halogen lights on them to keep them warm.  I looked at this and set out to build a better solution for them.

My thought was that if I could help them out by building a place for the plants, I could also create a nice place for the plants to grow and hopefully will also enjoy the harvest once they are finally ready. So off to Home Depot I went.

Greenhouse Sketch
$40 later, one 10' 2x10, one .25" 2'x3' plywood, two 10' .5" PVC pipe, several pipe fittings, and tiny sprinkler heads later I came up with an idea. The goal.....2'x3'x10" box with PVC pipe "house-shaped" frame above it that would connect to the water hose and create a low-maintenance green-house that would keep the plants watered and safe from the deer. Now 20 feet of PVC pipe was waay more than I really needed, actually I only needed about 12 feet, but you can buy the stuff in 10' sections for around $1.50/ea.

With the 2x10 we want to cut four sections. 2 at 36" and 2 at 20.75".  Once they are screwed together, next you can add the 2'x3' plywood by screwing it to the bottom of the 2x10's.

The challenge was getting all the PVC setup so that water could fill the pipes, and utilize the sprinkler heads to water the plants gently and evenly.  Ultimately I used eight 12" pieces,  and one 32" piece.  In the longest one I mounted four tiny sprinkler heads that spray 180 degrees.  Also, I added a water hose connection on the outside of the box and a water valve to allow me to control the water flow through the tubing. Turns out, the sprinkler heads don't require much water flow at all, ultimately I have the valve just barely opened to let a small amount of water through.


Finished Box
The last things that need to be done are:
   1. Add dirt and plant the herbs and veggies
   2. Get some plastic to wrap on the top and sides to keep the heat from the sun inside the box to promote growth
   3. Enjoy the harvest

Once we have plants in the box, I'll add pics to this post.



Tuesday, May 3, 2011

Testing Station

I thought I would share a picture with you what my current testing station looks like.  This is just a picture of the Arduino station.  I wanted to keep it all in one place and do my best to keep it all somewhat easily accessible.

Pretty simple, really. I took a piece of wood and cut it down and screwed the Arduino onto it.  This does two things: 1, it keeps me from shorting the Arduino out on some scrap pieces of metal that may work their ways under it just sitting on my table; 2, it allows me to work on a wiring project and be able to put it aside whenever I want.  When I decide to clean up my table, the project still stays together and organized.

This had changed some since the photo was taken, and I'll try to add to this post when I get a new pic.

Arduino Accessories

Sunday, May 1, 2011

LED Lighting Control for Bookcase

A little while ago, I decided that I wanted to add some lighting control to my bookcase.  Now, this bookcase isn't for books (ironic huh?), instead, it is used for holding our DVDs.  We have a little over 500 DVDs and growing but the problem is that it is difficult to find a movie to watch.  To add to the frustration, the bookcase isn't exactly designed for movies and allows very little light into the cubes.


The case and an exploded view
When I decided to add lighting control to this case, I quickly realized that I didn't just want white lights that I could adjust the brightness on.  I wanted full color lights with the ability to change each color intensity and the light brightness.  After some research, the TLC5940 lighting controller turned up as being the most cost-effective way of controlling so many lights.  The 5940 will control 16 channels through PWM and allow them to be controlled by an Arduino.  For the LED lights, I decided that RGB LEDs would be the way to go this way I could adjust the Red, Green and Blue intensity levels individually to give me a wide range of color options.  If I wanted to theme the case for Halloween, I could adjust the controllers to make an orange glow.  For other holidays I could do other colors as well.  What I'll need, is 3 TLC5940s, and Arduino board, and 3 potentiometers to control the chips.  I don't want the lights to be on all the time, so I'll add a range finder that only turns the lights on when I get close enough to the bookcase.  Additionally, I want to be able to control the lights in each cube when I reach in for a DVD.  I'll be adding motion detectors in each cube. Once the motion detector triggers, that particular cube will turn to a bright white, and the other cubes will fade down to around 30% or so light-intensity.


Now, I have the circuit done for the standard lighting controller and the potentiometers using the Arduino.  I will start working on the motion detection system soon, then adding on the functionality of the range finder.  One thing I'm still up in the air on, is whether I should add some sort of push-button that adds time for the lights to stay on, or if I should just keep the lights on for one minute or so.


Here is what I am thinking that the final controller box will look like.  The top two rows of gold pins will go to each cube's light strip. The next two rows of pins will go to each cube's motion sensor.  The last row (with the five pins) will be for the potentiometer controller.  Also, the TLC5940s will be on the first three shelves inside the controller with the minimum Arduino circuit (think boarduino)  on the bottom shelf.  


The lighting controller (the brains)
I can't forget to give credit to some very smart individuals for helping me along with this project, either directly or indirectly.  First is to Alex Leone. He created the library files for the TLC5940s and also made several example sketches.  He has also been very helpful to me when I emailed him asking for some advice.  Next is jmsaavedra who posted an Instructable on how to make a Perfoard Hackduino.  This is great because it will allow me to build the controller board for my lights much smaller and cheaper than having to buy a pre-built one. Here is the link to his Instructable.

If you would like to see the code that I have already done (the basic lighting control using potentiometers) please feel free to contact me and I will gladly help you out.

Thursday, April 21, 2011

Toy-Tech First Post

Welcome to the first post of my new blog. I started this blog really as a way for me to maintain contact with my friends from different parts of the country. Feel free to repost, contact me, or otherwise just follow my blog.

I plan to post blogs about my different projects involving electronics, woodworking, 3d design, or any other cool stuff I may come across. Over the past year or two, I have been experimenting with robotics and using the Arduino platform as a base. The Arduino (arduino.cc) is a great open-source development platform that lots of "hackers" use to create different types of projects. I'm no expert in, yet, but I can't wait until I have more experience and knowledge on the subject.

Currently, I'm working on several different Arduino-based projects that involve (among other things) home automation, lighting, radio-controlled devices and web-serving. Trust me, this list will continue to grow as I gain more knowledge of what the Arduino platform can handle.

My posts will be short, sweet and to the point. Where/when available, I'll upload the code that I am using, and provide links to the research that was done in gathering information. The great thing about open-source is the code is freely available to whoever wants it. I plan to post all the code that I can, and give credit where available.

Again, if you have any questions please feel free to email me and I will do whatever I can to help.

Expect the next post in about a week or so. I would love to be able to have new posts every week, but we will just have to see how it goes.