×

Sparkfun support will be closed from 3:00PM to 4:15PM on April 27th for a company-wide townhall meeting. We will resume regular hours on the 28th.

Member #134773

Member Since: May 19, 2010

Country: United States

Profile

I started playing with electronics in the mid-1960s, and with computers shortly after Neil Armstrong took “one small step”. I got a degree in CS in 1980, and started working then as an engineer.

  • That’s a nifty project! Great combination of art and technology!

    I’ve found that my projects that involve addressable LEDs that it was a good idea to include an ambient light sensor and “scale” the values sent to the LEDs based on that reading. The addressable LEDs can be pretty dazzling at full tilt (and need to be in bright sunlight), but can be obnoxiously so in low-light situations. (Think of a “wearable” that needs to adapt to anything from outdoors during the day to a party in the evening, or, in this case, a room with lots of windows on a bright sunny day down to watching a movie late at night.)

  • Two comments: First, I’d stick some sort of a delay into the loop with the servo, just to keep the CPU’s temperature from rising (assumng, of course, they don’t do delays the “brute force” way of having a tight loop). Second, our friends over at Adafruit seem to have the micro:bit in stock. (One downside is that last I checked, “free shipping” for Adafruit requires a $200 purchase. Another is that Adafruit is further from Phoenix than is SparkFun, so surface shipping can take longer.)

  • I remember my first design involving I2C. I was adding to an existing design, and it ended up with two I2C buses, the first being designed by someone else, and mine. I was very confused when the other bus worked and mine didn’t – finally tracked it down to my having left off the pull-up resistors. When I added those, it worked fine.

    I find two things irksome from the suppliers of I2C compatible chips, both problems with the datasheets. Most irksome is that most “bury” the device address way down in the document, when, IMHO, they should put it (or, if it has a range, the range) up in the “features summary” in the first page or two. The other is that they all seem to be obliged to put a long-winded definition of how this bus works into the datasheet, like it’s 35 days old rather than 35 years old. It seems to me that each manufacturer could put one copy of that onto their website, and just say “for a detailed explanation, see this web page”.

    Tip for SparkFun: When you’re adding a break-out board for an I2C “slave” part, please put the address (or address range) in the “features” list on the web page!

  • My disagreement is with your invoking Earth Day for this. Earth Day is all about saving resources by using them efficiently. If you were to add, say, code that picked the on and off times based on the day of the week, that’s something that the simple mechanical timer can’t do. (A more advanced version, that would do things the electronic timers can’t, would be to have a list of holidays and adjust for those.) Another idea might be to add a motion sensor to only turn on the light when there’s someone to actually see it.

    Along the lines of “conserving resources”, one of the resources that is important to conserve is $. I’d suggest that the Teensy 3.5 might be a better choice than the Uno and a separate RTCC, at less cost than the Uno alone. (Yes, the RTCC you selected has very high accuracy, but it seems to me that this is the proverbial swatting flies with sledgehammers.)

  • Happened to think of another reason for including the extra parentheses that I mentioned earlier: If you have them there, and accidentally put in a single ampersand, it would still work (thanks to the fact that in reality, C represents “true” as 1), but without the parentheses, you would get different results.

  • Thanks for correcting that. FWIW, I’d estimate that probably 20% of the bugs I’ve worked on in 35+ years as a Software (and more) Engineer have been caused by “minor” logic errors like this. Imagine trying to find one buried in 20,000 lines of code… ;-)

  • You still need to change the “||” to “&&”. The way it is now, it’s ALWAYS ON.

  • Oh, yes: you also should include a “wall-wart” in your parts list, unless you are planning on leaving your computer on and attached to the Arduino 24/7.

    I sincerely hope that your actual program is going to be quite a bit more sophisticated than simply “on at 7:00 AM and off at 7:00 PM”. If not, a simple timer, available for less than $15 at places like Target, WalMart, CVS, Walgreens, Home Depot, ad nauseum, is a “more appropriate technology”, as well as being a bit “greener”. Although I haven’t measured the “modern” electronic timers, I have measured one of the slightly older “mechanical” ones, and it only uses about 2W.

  • Ahem… I think you have a couple of typos in your code…

      if(rtc.hour() > 7 || rtc.hour > 19 ){
        digitalWrite(pin, HIGH);
      }else {
        digitalWrite(pin, LOW);
      }
    

    First, you have “rtc.hour()” (with parenthesis) in one place and “rtc.hour” (without parenthesis) in another. The compiler is going to complain about it…

    Second, you have a logic problem… you are making the output high if the hour is greater than 7 OR it’s greater than 19. From what I learned in school (admittedly nearly 50 years ago, so things might have changed) if something is greater than 19, it’s also greater than 7. What I THINK you mean is to ask an “AND” and make it LESS THAN 19. So it should be

      if(rtc.hour() > 7 && rtc.hour() < 19 ){
    

    and I would generally add another couple of pairs of parenthesis, and maybe a few more spaces, just to make it a bit clearer and easier to read:

      if ( (rtc.hour() > 7) && (rtc.hour() < 19)  ){
    
  • Shawn,

    Since Sparkfun is (going to be) carrying the MicroBit, IMHO, it would be wise to include a link to it, maybe with some “disclaimer” like MicroBit, which as of this writing is still Pre-Order. (It cuts down on long searches, which can really put the “cuss” into “customer”. Remember, the most important person in any business is the customer – without customers, you’re not going to be in business very long.)

No public wish lists :(