Mar 15

Bitlash: Arduino interpreter language shell

I love having a shell. When I want to know what a single line of code will do, I don't want to add print statements to code just to see what's going to happen. Bitlash is an arduino interpreter, so you can send individual commands to your arduino. I haven't used it yet, but once I get back into arduino development, it will be on my to learn list. It may be helpful for students to be able to run individual lines of code. Or I'll just have them write extensive test benches to test their code. Maybe both?

Mar 15

RFM12B Wireless Modules

Over the months, I've ran across a number of wireless modules, each telling me different things about their capabilities. There's the XBee, a great module that has books written to teach people how to use it. They come in many flavors and have a lot of breakout boards. They are also $17 for the low power version or $28 for the Xbee Pro, according to digi.com. Then there's the Nordic nRF24L01, which is a low cost module with an arduino library. They cost $4.75 (on sale now at yourduino.com for $2.75. Nice) Lower cost, but more difficult to set up for the beginner (there are code samples, people have used these before).

I recently came across the RFM12B. It's $6.95 at Sparkfun, but I doubt that's as cheap as one can find them, since Sparkfun usually is a bit more expensive than other suppliers (I have nothing against them. They were one of the first suppliers to carry arduinos, and I appreciate that. I also look for bargains). It also has a library (created by Low Power Lab based on the JeeLabs RFM12B library), which is completely open source (MIT license, so the code that uses it must also be open source, but since my project is open source too, that doesn't matter). Not sure whether or not it will be easier to use than the nRF24L01, but it's worth looking into if I make all the laser tag modules use RF to communicate hits to a central hub. That'll happen later in the process, after the core functionality is ironed out. Potentially, IR communication could be all I use for my open source laser tag project (note, OpenTag is a  DASH7 protocol stack, which is an open source wireless network standard. Damn. Can't use that name), so I won't need to have a wireless module on the units.

Note: the guy over at Low Power Lab is manufacturing an arduino clone with a RFM12B wireless module called the Moteino. He has some videos about soldering the Moteinos  (along with the stencil he uses to apply the solder paste) along with the iTeadStudio PCB's that he's using. Check out his blog at lowpowerlab.com.

You can also build a DIY laser cutter that can cut stencils. The tutorial is here.

Mar 13

Color of light Changes Alertness

NASA has planned an experiment to attempt to help astronauts get sleep on the international space station. According to research, blue light helps wake people up while red light helps people fall asleep. This apparently means that staring at my computer screen before going to bed apparently doesn't help me fall asleep. But it does mean that my alarm clock should be heavy on the blue light to wake me up in the morning, and it could also have RGB LED's that go heavy on the red light as I'm getting ready for bed. That could help mimic the sunrise and sunset and give me a sleep pattern that is either more stable (because it's easier for me to fall asleep and wake up) or that is more easily tuned because I can give my body the necessary light cues to tell it to fall asleep when my work lets me. Either way, I'll need to experiment. And for that, I need the clock.

Article on color changing lightbulbs assisting sleep

NASA ISS color test

Mar 13

Example of a Sunrise Alarm Clock

One of the projects that I'm interested in building is an alarm clock with a variety of alarms to wake a person up. I've though of using LEDs to simulate sunlight, a motor to vibrate my pillow, a speaker to play music, a squirt gun, a spring-loaded mechanism to pull off my sheets, etc. I haven't built one yet, but the project has always been in the back of my head. I cam across a series of alarm clocks that simulate sunrise, and I like the one in the link below, particularly for its great bill of materials. I would use an arduino instead of the Arm processor because I have a few ATMega328p's I haven't found projects for. He also uses all open source products to create the project, which I think is awesome. I haven't dabbled in board layout much, and an open source program would be a great place for me to start.

Sunrise Alarm Clock

Dangerous Prototypes has a sunrise alarm clock that uses a PIC32. I've used one for another class, but since I'm focusing on ease of teachability, for now I'm going to stick with the arduino (very beginner friendly). This one plays sounds back, which is nice, but I can do that with an arduino as well.

Mar 12

Do I ask you what you want?

I cam across an article today in the helpscout blog (article). It is about Steve Jobs' quote, "It's really hard to design products by focus groups. A lot of times, people don't know what they want until you show it to them." Part of me agrees with this, because I'm trying to design a curriculum for electronics, and I really can't ask fourteen-year-olds what they want to learn about electronics. They would probably tell me that they'd like to make an iPhone, which is way beyond their (and my) scope. They would probably never think that they could make laser tag, which is what I'm trying to show that they can learn. The problem is, they don't know what could exist (or at least, most don't).

If you don't know that something is possible, how can you ask someone to make it for you? That is the essence of Jobs' quote. You don't know if people will like something innovative, something that they haven't thought of, unless you can find out what they want without asking them. The article sites an article about customer feedback, which points out that people are notoriously bad at telling you what they want.

Why should we care? It means that while people can tell you what they want, it is unlikely. If you want to create a new curriculum to promote electronics education by making a fun, engaging and open source set of classes to teach the fundamentals of electronics, computer science and embedded systems (as I do), then you may not be able to just ask a teenager what they want to learn about electronics. Because they won't tell you. I have to learn everything that I can about teaching, get help from the teachers I adored and mimic their teaching styles, generate a set of lectures and labs to demonstrate the principles required to make laser-tag and then test this, refine it, test again.

At the same time, this also has to be taken with a grain of salt. After all, this was Steve Jobs. He was a particular person in a unique industry. Getting feedback on what is working is different then feedback on how to generate something entirely different. And sometimes innovation does come from getting feedback. It can work. This all points to getting feedback from my curriculum and taking it not as dogma, but as a suggestion from a person, because that's what it is. It is information that another person, with all their knowledge, experience and biases, telling me what their mind has computed. It could prove to be useful. Or not. And how will we ever know if we don't try?

Here's an interesting article on customer feedback information. You know, for those who want more.

Mar 11

Arduino Barcode Scanner

I've had an interest in barcodes versus RFID tags for a while now. Barcodes are easy to place on objects and can be printed for the price of printer ink and paper. RFID tags need to be purchased individually, but the RFID reader is pretty cheap (there's one at adafruit for around $40. Link below). Because of my previous knowledge of RFID tags (via learning on the internet), I thought that they would be easier for me to implement than a barcode scanner, since I haven't used one before and wouldn't know where to start. However, I just came upon an article on embedds.com about interfacing a barcode reader with an arduino. This could replace using an RFID system to keep track of objects, or not, depending on the application. At any rate, it's something to look into. Ladyada has a tutorial on how barcode scanners work (link below), but it doesn't include how to interface it with an arduino. It is a good tutorial; adafruit has a great learning system.

Barcode Reader Project: http://www.circuitsathome.com/mcu/connecting-barcode-scanner-arduino-usb-host-shield

Adafruit RFID arduino shield: http://adafruit.com/products/789

Adafruit Barcode Scanner Tutorial: http://learn.adafruit.com/barcode-scanner/overview

Mar 09

USB to Serial Converter

One of the most expensive parts of an arduino is the USB to Serial converter. These typically cost around $15, and considering the fact that the electrical components required to make an arduino compatible (ATMega328p chip, 5V regulator, capacitors, resonator/crystal, resistors) total around $3.48 for 1 or $2.70 when purchased in bulk of 100, the USB to Serial converter is about five times the cost of the other components (not including the PCB, which can vary in price depending on the footprint. a 2"x3" PCB is around $5 per PCB for a quantity of twenty at the time of posting).

Electronics-lab.com's Blog posted about a schematic for a USB to Serial converter (links to blog post and schematic below). A cheaper USB to Serial converter would be invaluable for creating lower cost arduino compatibles. Either that, or I have to use the same USB to Serial converter that the fellows who make the arduino use. They use an ATMega16U2 that has been programmed to convert USB to Serial, which adds another layer of complexity to the board than simply an FTDI chip whose sole purpose is to convert USB to Serial (more info at http://arduino.cc/en/Main/arduinoBoardUno).

The purpose of this search for a cheap arduino is to get it into the hands of as many children as possible to promote electronics education. While a $25 microcontroller (when bought in bulk) isn't prohibitively expensive, if a cheaper alternative is possible and a little research helps towards that end, why not try?

Electronics-lab.com USB to Serial Converter Blog Post: http://www.electronics-lab.com/blog/?p=21327

USB to Serial Schematic: http://www.obddiag.net/usb-2-serial.html

Mar 09

GeoCache Puzzle Box

Picture of the front of the box as it searches for a GPS signal

The front of my GeoCache puzzle box as it searches for a GPS signal

Last summer I built a GeoCache puzzle box as a gift. What is this puzzle box? It is based on Mikal Hart's Reverse GeoCache puzzle box (TM Mikal Hart, original article link is below). I read the article, and being a DIY college student, I decided to build my own puzzle box based on his design, only cheaper.

Mikal Hart's original article is here: http://arduiniana.org/projects/the-reverse-geo-cache-puzzle/

I started by doing some research on the parts required. Mikal Hart has a list of components in his article, and now there is even a website where you can go buy either the components or the a completed box (http://www.sundial.com/shop/) or just the electrical components necessary to control the box (except for the arduino and the GPS module, for some reason. Don't know why he didn't include those components). After pricing the components myself, I figured that I could build my own box (and learn about how everything works) for less. So I did.

I began with the GPS unit. Fortunately, Ladyada of Adafruit Industries has wonderful tutorials for GPS units, liquid crystal displays (lcds) and all sorts of other cool stuff. The tutorials that I used are listed below. Basically, I needed to learn how to get my position from a GPS unit, which outputs in a standard format called a NEMA sentence, and use that information to calculate where I am on the planet compared to where I want the box to open (I used the haversine formula to calculate how far the box is from the destination [where I want it to open]. Look it up on wikipedia if you like. It allows you to calculate the distance between two points on a sphere, and the Earth can be approximated as a sphere). Ladyada's tutorial teaches you all that you need to know and provides a library to parse the GPS data stream for you (basically, you don't have to understand how the GPS unit is outputting information. She wrote a library [code that you can use in your code] that checks for, collects and separates the GPS's output so that you can easily use the data it sends in your project. Nifty.) The tutorial also works for the GPS unit that I purchased from Adafruit industries. I chose that one because of the breakout board, which makes it easier to work with when trying to attach it to other circuits, the wonderful tutorial and the library to do the work of taking the data from the GPS for me.

Ladyada's GPS tutorial: http://learn.adafruit.com/adafruit-ultimate-gps

Next, I needed to pick an LCD. Adafruit again has a great selection of parts and a tutorial on how to use them. I chose a blue character (the letters are blue) OLED (organic light emitting diode) that has 16 characters per line and two lines to write on (16x2). It is not compatible with their backpacks, but I liked how it displayed much better than other LCD's. If one was looking for an easier LCD to use, I would go with one of the other LCD's that use I2C to communicate (I2C is a communication protocol that uses 2 wires. Hooking up the blue character OLED to my arduino used 6 wires. You can do it, but it's more wiring). The Adafruit tutorial is listed below.

Ladyada's LCD tutorial: http://learn.adafruit.com/character-lcds/overview

Now that I had a method to get my location and print out information to the user, I had to pick various other components for the actual project. I needed a button to allow the user to turn on the box, so I picked one that looked cool at the Adafruit store (www.adafruit.com). I also needed a servo motor (motor whose position you can control) so that I could precisely move a latch to lock the box. Then I needed to decide how to power it (batteries), what processor to use (an Atmega328p, the brain of an arduino), and if I wanted to put an arduino in the box. I decided against putting an arduino into the box, since I wanted to learn how to build an arduino clone, and I wanted to minimize the cost of the project. Links on how to build arduino clones are provided below. I also found a cheap cigar box on amazon.com and decided to use that as the box. I didn't need anything fancy. Just a box.

Arduino on a Breadboard: http://www.arduino.cc/en/Main/Standalone

Poor Man's Arduino: http://aeturnalus.com/robotics/poor-mans-breadboard-arduino/

So, now I had all the physical pieces that I needed, and now had to write the code to control the darn thing. I based my code on the GPS tutorial that Ladyada posted in her GPS tutorial at Adafruit. I won't go into the details here, but I basically wrote two programs: one to actually control the GeoCache puzzle box and another to test that code and see if it is working correctly. It's always important to test your code, as I didn't want it to fail after giving the box to someone as a present. I also added a backdoor mechanism to open the box in case of power failure or GPS failure. The box can be powered externally using two inputs near the hinge on the back, and after the box tries to shut itself down, if it is powered externally, it will automatically open itself (this kept me from driving to the place where it opened every time I wanted to test it).

After all the coding, testing, and assembling, I had a GeoCache puzzle box. It took around a month and a half to learn, build and test, but all in all I probably didn't spend more than 30 hours on the project. Not that I kept track. That's a rough estimate.

I hope this post is a useful guide to the methodology I used to gather the information required to build my GeoCache puzzle box and has some good resources. I may end up building another one, since I gave this one away as a gift and do not have it anymore. If I do construct another, I'll be sure to post the wiring diagrams and detailed photos of the build so that others can make this if they'd like. I've put a summary of the links below in case you want to click on all of them now.

Mikal Hart's original article is here: http://arduiniana.org/projects/the-reverse-geo-cache-puzzle/

Ladyada's GPS tutorial: http://learn.adafruit.com/adafruit-ultimate-gps

Ladyada's LCD tutorial: http://learn.adafruit.com/character-lcds/overview

Arduino on a Breadboard: http://www.arduino.cc/en/Main/Standalone

Poor Man's Arduino: http://aeturnalus.com/robotics/poor-mans-breadboard-arduino/

These are other pictures of the GeoCache Puzzle box, showing the internal wiring (messy. I'll try to make this less so if I build another) and the place on the back of the box to power it externally.

Internal wiring of the GeoCache Puzzle Box

Internal wiring of the GeoCache Puzzle Box

This is where one would power the box to open it no matter the location

This is where one would power the box to open it no matter the location

 

Mar 08

First Real Post

Hello Blog,

So, I went to an inspiring information session today. What I got from it was that I needed to become the expert in the field that I want to work in and am passionate about. So here I am, documenting my dive into the world of electronics, open source, DIY, education, entrepreneurship, business, etc. I will be documenting what I learn, what I know, and what's going on in the world around me that I'm interested in. Hopefully, this will be a place for me to share what I do and what inspires me.

So that's what I'll do.