Twitter Updates

    follow me on Twitter
    See all our photos at www.flickr.com/photos/fischco/

    Entries in Arduino (5)

    Saturday
    Apr102010

    UITS Circuit People - It Works!


    UITS Circuit People, originally uploaded by estranged42.

    Well, I populated the circuit board tonight, soldered up all the components, tossed in some batteries, and flipped the switch!

    And nothing happened.

    After ten minutes or so poking at the traces with my multimeter, I discovered that I have one trace out of place leading into the power switch. Fortunately a simple jumper from one pin to another on the switch was able to fix the problem. And it worked!

    I have to admit, this thing looks pretty damn good! Not too shabby for my first PCB layout and project. I think I started toying around with this design over a year ago, so it’s pretty cool to actually hold a real, physical, blinking thing in my hands.

     

    UITS Circuit People EAGLE Schematic Files

     

    Friday
    Apr092010

    First Printed Circuit Board!


    Fitting Parts, originally uploaded by estranged42.

    I got my first printed circuit board (PCB) design in the mail today. This is for a pretty simple blinking LED project.

    When UITS got its new logo, the dancing circuit people just screamed out to be made into a real PCB somehow. This is what I came up with. I realize using a full Arduino ATMega168 is a bit overkill for driving some LEDs, but I decided that I’d rather get a prototype working this year instead of deciphering datasheets for the smaller ATtiny series for the next 6 months.

    The basic idea is to just have the color changing LEDs fade between red and blue in various patterns. Pushing the button will cycle through a couple different blink patterns.

    I got these boards printed at BatchPCB. If you’re only wanting 1 or 2 small boards, they’re hard to beat for price. $45 for two boards, and they ended up sending me 4! Took about 20 days for them to get here, but they look great!

     

    UITS Circuit People EAGLE Schematic Files

    Thursday
    Dec312009

    Starfield


    Starfield, originally uploaded by estranged42.

    After nearly a year, I finally finished up putting LED ‘stars’ onto our bedroom ceiling. See this earlier post where I talk about getting it started.

    After a lot of soldering and taping, I managed to tape 32 white LEDs to the ceiling of our bedroom, and get stars working.  I tried a bunch of different wiring ideas out before settling on simple bare buss wire.  I just put some white electrical tape to keep it in place, and tape over any place where the lines have to cross.  

    The affect is really pretty awesome with the room dark.  There are just enough stars lit at any one time to barely light the room, but not so bright that you can’t fall asleep with them twinkling.

    Nothing like blinking LEDs!

    Code: View or Download 

    LED Control Wire Connections

    Control Wires

    One Star

    Friday
    Apr102009

    Putting stars on our ceiling

    Playing around with silly electronics again. This time the idea is to put twinkling stars on the ceiling of our bedroom. I’m using two TLC5940 chips to drive LEDs. The chips are capable of 16 channels of PWM, so the stars can fade on and off nicely.

    Step 1 was a proof of concept. Could I figure out how to hook up one of these chips to an Arduino, and get it to fade some LEDs on and off? Fortunately, the Arduino community is amazing, and someone has already written a fantastic library for this chip. (Thanks acleone!) The documentation on how to hook the chips up is all defined very nicely in the comments of the example programs in the library.

        Basic Pin setup:
        ARDUINO                                     TLC5940
       ------------                                 ---u----
                 13|                          OUT1 |1     28| OUT channel 0
                 12|                          OUT2 |2     27|-> GND (VPRG)
                 11|                          OUT3 |3     26|-> SIN (pin 7)
                 10|-> BLANK (pin 23)         OUT4 |4     25|-> SCLK (pin 4)
                  9|-> XLAT (pin 24)            .  |5     24|-> XLAT (pin 9)
                  8|                            .  |6     23|-> BLANK (pin 10)
                  7|-> SIN (pin 26)             .  |7     22|-> GND
                  6|                            .  |8     21|-> VCC (+5V)
                  5|                            .  |9     20|-> 2K Resistor -> GND
                  4|-> SCLK (pin 25)            .  |10    19|-> +5V (DCPRG)
                  3|-> GSCLK (pin 18)           .  |11    18|-> GSCLK (pin 3)
                  2|                            .  |12    17|-> SOUT
                  1|                            .  |13    16|-> XERR
                  0|                          OUT14|14    15| OUT channel 15
       ------------                                 --------
    

    Two TLC5940s on a shield

    Once I had a single chip working on a breadboard, it was time to plan out a more permanent board to house two chips.  Two chips gives me 32 stars, which I figured was enough to start with.  In order to fit the chips on the shield, I changed the transfer mode from SPI to bitbang inside of tlc_config.h, this let me just move from pins 11 and 13 over to 4 and 7, and let me squeeze in the TLCs right next to the arduino connector pins.

    I changed the suggested resistor on the chip from 2kΩ to 100kΩ.  The white LEDs I’m using are just way too bright with only 2kΩ of resistance.  100k knocks the brightness down to an acceptable level.

    Next I need to start getting serious about wiring up a bunch of LEDs and start sticking them to my ceiling.  I also have to figure out an elegant way of bringing in 30+ very thin wires and connecting them to their appropriate pins.

    Update: See how this project got finished.

    Monday
    Mar162009

    Arduino Rangefinder 

    I’ve always been a programmer. However, the world of hardware has always intrigued me. I’ve always been somewhat interested in the ability for electronics to actually *do* something in the real world, and not just push pixels around a screen.

    I first heard about the Arduino micro-controller world on an episode of MacBreak Weekly. Andy Ihnatko was talking about it for an upcoming talk he was giving. Basically the Arduino is an open-source micro-controller. It connects to your PC via a USB port. There’s a custom IDE built for it that runs on Macs, Windows and Linux. The basic idea is that you can now easily control simple voltages on pins. Connect them to sensors, motors, LEDs etc, and control the real world from a very easily accessible starting point.

    So I finally got around to ordering the standard Arduino board, some sensors, a breadboard, and started playing.

    An interesting concept with the Arduino world, is the idea of a ‘shield’. Basically a shield is a board that fits on top of the base Arduino, and adds some functionality to the basic setup. A proto-shield is just a shield that gives you a small space for prototyping. The SparkFun shield also gives you a couple of LEDs with resistors in place, and some switches to play with.

    The proto-shield comes as a kit, so I got to practice my soldering skills. I had never really soldered on a board before, but after a few minutes of poking around, I eventually got the hang of it. Shield assembled, I was amazed at how fast and easy it was to start getting readings from the ultrasonic sensor. The following few lines of code were all that was needed to read the sensor value, and send it to a listening serial port:

    int sensorValue = 0;
    int sensorPin = 1;

    void setup() {
      Serial.begin(9600);
    }

    void loop() {
      sensorValue = analogRead(sensorPin);
      Serial.println(sensorValue);
    }

    The input / output pins on the Arduino board are all numbered, so you just pick a pin, hook up your sensors, and you’re off!

    Once I figured out how to get reliable readings from the sensor, I figured a simple thing to build would be a system to see if I was at my desk or not.

    I pulled the parts off the protoshield, and built a more permanent set of boxes. One box for the Arduino, and another for the sensor. This let me position the sensor in an appropriate spot, and allowed me to plug the Arduino box into a USB port.

    Arduino

    Arduino House & Buttons

    Sensor Box

    Assembled Boxes

    The two buttons let me set the range at which the sensor will trigger an “Away” or “Here” message back to the computer. A simple program running on my mac then picks up the signal from the Arduino, and relays it to a web service that then tracks my presence.

    Parts List:

    Arduino Duemilanove
    Maxbotix LV-EZ1 Ultrasonic Range Finder
    Arduino ProtoShield Kit

    Code:

    ProximitySensor v5