A word about open source hardware

Open Source Hardware

So, what is open source hardware and why should I be interested in it? Open source hardware is simply hardware that is released in the wild along with CAD files (PCB layout data), documentation, and hopefully a tutorial on how it is set up and works. The wiki page is located here. The Open Hardware Summit is here.

Now, I was skeptical about this when I first heard about it because I thought,”If I want to sell my stuff, why give away the information I worked on?” I mean after all, aren’t we supposed to design something, then patent, copyright, trademark, and lock it in a safe? Thats the way to keep it ours right? After all, I worked on it, and I should get all the credit and all the profit right? I’m not giving my stuff away! But then I started thinking…

I thought about myself buying hardware and how I yearn to know everything about it. When I found Adafruit Industries and Sparkfun, I thought, “Whoa! Sweet! Cool hardware and full documentation!” Did I first get the urge to download Ladyada’s board designs and have them made myself, cutting the seller out of the loop? Of course not. I mean, sure the option was there, but I would rather just purchase a kit with everything I need. This way, I get something in my hands a lot faster, tested, and documented for my hacking. The cost and time is just not worth me making my own.  Now, wouldn’t I want to offer the same thing to my customers? Of course I would, that’s what attracted me to buying from Adafruit in the first place.

When a maker/hacker buys something, it’s an entirely different attitude that a “regular” consumer. For the most part, a “regular” consumer wants to get the best deal on whatever they are buying, and they want it to “just work”. Yeah sure, us makers/hackers want the device to “just work” also, but we also want to know how and why it works. If we have full documentation, schematics, tutorials, and access to forums, we can fully understand what we own. And then once we understand it, we can fix, modify, hack it to our needs.

With all that said, I’m sold. I want to buy all my gadgets open source (if they are available), and want to offer the same back to the maker/hacker community. I have really learned a lot from good quality open source companies and the communities behind them, and would like to give back what I can.

There is a big move of DIY electronics right now. Some of us have been doing this for years, and others have just begun, but one thing is for sure, making and hacking is growing like mad. There is all kinds of great information available right now, as well as tools like the Arduino to get people started as well as develop new things. So don’t just read this, go make something!

EDIT: I just noticed that Ladyada has a great page on this!

Tic Tac Touch

OK, so I haven’t posted in a while because I have been working on some bigger projects, but yesterday, I took a two hour break and made a 2 player tic tac toe game. I did this with an Arduino and a 2.8″ touchshield from Adafruit.com. It’s pretty basic tic tac toe, and has score tracking, game logic (you can’t go twice in a row, and telling you if you win), and the ability to consume a chunk of time playing tic tac toe with my son. Below is the code, feel free to hack modify etc. If you play against a smart person (or yourself), you will have lots of Mosfet eye games! 🙂

Download the code here. (Arduino 22 .pde file)

 

Multiplexing for a 7 year old

I have been wanting to make a LED clock for sometime and can’t really believe I never have. So I rummaged through some parts and found some nice 4 segment LED displays. I found some code for a simple clock at nootropicdesign, and it did something pretty neat. It slowed down multiplexing so you could see it, then it would get faster until it appeared “on”. It was a good sketch, but I thought, it needs set buttons, a blinking colon, and a way to trigger the multiplex slow down trick with out restarting. (and resetting the clock!) So I made this little clock and it worked great.

This was a great way to show my 7 year old (who wrote his first Arduino sketch the other night) about multiplexing. A picture is worth 1,000 words right? Well, a hands on demo is worth even more than that. After explaining how it works, he totally understood.

Then I noticed I had, sitting on my bench, some Lexan laser cut, for those little Nokia LCD’s I love so much, that had a 4 segment LED display size hole in them. I made the clock and moved some pins around to free up 3 PWM pins for an RGB LED. Because it’s always good to have a full PWM controlled RGB LED, ya know, just in case. Thinking of programming the LED different colors/brightness according to sun position. I also remembered I have a few Dallas 1307’s.. Maybe tomorrow, it’s late right now, and besides I’m busy porting software for a Touch Shield I got. 🙂

If your new to multiplexing, it basically combines pins of LED’s and then through switching on only certain pins at a time, you can light only certain LED’s. If you were to apply power to more than 1 cathode and anode, you would get unwanted LED’s lighting. So how can this work? I have to light 14 LED’s just to display 1:00! What makes this work is you light one segment at a time. With a microcontroller, you can do this in an order and at a rate that’s fast enough that the human eye thinks that they are on solid. Most LED 4 digit displays found in microwaves, stoves, appliances, and VCR/DVD players are multiplexed. Its a great way to light a lot of LED’s with less pins than connecting each directly to the microcontroller. Below is a circuit diagram of the LED display I used. The link for the code is below as well, as always, hack away. 🙂 Detailed pinout for Arduino are in the code comments.

Multiplexing!

Get the code here. (Arduino 22 .pde file)

Schematic (Eagle file)

Schematic (png file)

Dual Boot LED Control, RGB to HEX Converter

OK, so a while ago I fell in live with these Nokia 5110/3310 LCD displays. They use a library from adafruit.com that you can find here. They are small, fast, and don’t gobble up a lot of current. So I needed a project to make so I could use one. The result? A massive overkill of an LED controler with all kinds of options and features.

So I was thinking about a RGB to HEX Color converter that I had made for the 2.8″ TFTLCD, and the fact that I might want to figure out values without erasing my sketch I’m working on. Although it’s nice to see the color displayed on the screen it will end up on, sometimes you just need a quick answer. Thanks to brookware2000 (in the Adafruit forums), there is a nice small program here that will do the trick. But it runs on Windows, and I’m kind of a Mac guy. The answer? Build one into my nifty little box that already has 8 buttons, an RGB LED, and a nice LCD screen! So here it is.

Download the code here. (Arduino 22 .pde file) This is a version of the code that just has the color converter, I’ll do a video sometime of how to do the dual boot/setup thing.

**Notice the line “PCD8544 nokia = PCD8544(13, 12, 8, 7, 5);” This is not the default pin assignments for the Nokia LCD Tutorial. (default pins are 7, 6, 5, 4, 3) You will need to adjust the wiring for this sketch to work. Pay attention to what pins are used for buttons and LED’s. 🙂

JOS – Open Source Menu Interface for Arduino/TFTLCD

***UPDATE*** There is updated code that works with the current Adafruit libraries! New post is here. 🙂

So I ordered a 2.8″ TFTLCD with touchscreen from Adafruit and really wanted to do more than 1 “screenfull” of stuff. So I stayed up all night and wrote this. Now I want to share it. I was waiting to post this until I got my code a little cleaned up and put in a good number of comments. My code might not be as optimal as it could be, so go easy on me, I’m still a newbie..

Here is a video about what this does.

And here is a video about the code.

JOS stands for Jeremy’s Operating System and is open source. I encourage you to use it, hack it, and do what ever you want with it. I know some might say “it’s not an operating system!” I know, but it’s just a name. It is based on Lady Ada’s TFTLCD and TouchScreen libraries. It shares some of the code from Lady Ada’s tftpaint sketch found in the TFTLCD library. It is written in the Arduino IDE and works perfect with the 2.8″ TFTLCD breakout board and the Touch Shield. This version does not support and SD card/bitmap functions as I do not have a touch shield yet. I will write these in when I get a Touch shield some day.

Here is a feature List:

Menu driven button screens

5 different menu screens, 6 buttons per screen for a total of 30 separate functions

Customizable title bar for indicators, custom icons and titles

Easily adjustable dual color signal indicator (for wireless application) for the title bar

Home icon for easy navigation

Dedicated message box for notifications

PWM controlled adjustable backlight

Settings menu with adjustable sleep time and backlight

Sleep and backlight settings saved in EEPROM – retains settings after power down

Sleep mode, for backlight, including fade in from sleep  and fade out to sleep

Template for 3rd adjustable item on settings menu

Dual color battery icon with active and adjustable monitoring

LED output for button press indication – adjustable or removable

2 LED outputs for indication – adjustable or removable

All LED activity used only 2 pins

pins 0 and 1 not used and reserved for for serial communication

pins 11, A0, A1, A4, A5 open for I/O

Code is commented to explain function

Hardware Wiring: The same wiring as found in the Adafruit TFTLCD tutorial here. Continue reading