swan tron dot com

Seiko Solar Watches

I will fully admit that a product that includes ‘solar’ in its name already has my attention. One of my ‘hindsight being what it is’ items involves biting the bullet, being broke, and going full on physics mode after undergrad. Montana State has a great solar physics department…could have been super nerdy. Next level nerd-dom. I guess I’m sort of trapped in this level nerd-dom. Still, solar perks up my ears. This product, then, already has my focus… seiko solar watch That watch, my friends, is a genuine Seiko SNE177 Mens Watch Black Stainless Steel Solar Quartz Link Bracelet Black Dial watch. I have been checking out Seikos for a while, and really like the look of the Seiko Solar Watches. Very cool. Bluedial has the Seiko SNE177 or a hundred and sixteen bucks (and some change) less than the retail value, which is a bonus. A bonus too would be the spec sheet to this device…good to 100m pressures and the whole works. Not too shabby. The time fight between watches and cell phones is still in full force. Watches are going strong still, due in large part to units like the Seiko Solar line. Stylish and practical…the colloquial double threat. I’ll keep you posted if I come across some geekier watch lines. Solar takes the early cake…

Garage Door Hack

Introducing Open-er-o-matic 3000. OOM3K. My finest project to date. I have my Arduino poking around with a PING))) sensor, a servo, some LEDs, and best of all…my garage door opener. End result: some Star Trek-ass shit. hit the vid Check this footage of the OOM3K in action. Here, I had it configured to open the door when the ultrasonic sensor echoes off of something within 8 cm…

Not only is this thing awesome, but you can get all sorts of clear looks at my trusty Ronco Showtime rotisserie oven. Yard bird is a big hit at the old Swanson place.

There is not much to this code…I built it on top of the LED binary project code. Prepare for a bitchin’ snippet.

//Open-er-o-matic 3000

// Joseph Swanson | 2011
// https://swantron.com

// Setup
// LEDs connected to pins 11, 2-5
// Ping))) sensor signal to pin 7
// Servo signal to pin 10
// Ping))) +, servo + to 5V
// Ground the shit out of everything

#include <Servo.h>

Servo myservo;

int pos = 0;

// Pin assignment
const int ledPin1 =  11;
const int ledPin2 =  2;
const int ledPin3 =  3;
const int ledPin4 =  4;
const int ledPin5 =  5;
const int pingPin = 7;

// Create variables to store LED states
int ledState1 = LOW;
int ledState2 = LOW;
int ledState3 = LOW;
int ledState4 = LOW;
int ledState5 = LOW;

void setup() {

myservo.attach(10);

//Define pins 1-5 as output
pinMode(ledPin1, OUTPUT);
pinMode(ledPin2, OUTPUT);
pinMode(ledPin3, OUTPUT);
pinMode(ledPin4, OUTPUT);
pinMode(ledPin5, OUTPUT);
}
void loop()
{
 // Reset LEDs levels to low to begin loop
  ledState1 = LOW;
  ledState2 = LOW;
  ledState3 = LOW;
  ledState4 = LOW;
  ledState5 = LOW;
  pos = 0;

// Set duration variable
  long duration, inches, cm;

// Loop section for ping signal pin...start as output
  pinMode(pingPin, OUTPUT);
  digitalWrite(pingPin, LOW);
  delayMicroseconds(2);
  digitalWrite(pingPin, HIGH);
  delayMicroseconds(5);
  digitalWrite(pingPin, LOW);

// Listen with same pin
  pinMode(pingPin, INPUT);
  duration = pulseIn(pingPin, HIGH);

// Convert time to a distance
  inches = microsecondsToInches(duration);
  cm = microsecondsToCentimeters(duration);

// Configure this for LED sensitivity
  delay(500);

// March through cm values...output LEDs an servo
  if (cm < 80) {
    ledState1 = HIGH;}

  if (cm < 64) {
    ledState2 = HIGH;}

  if (cm < 48) {
    ledState3 = HIGH;}

  if (cm < 32) {
    ledState4 = HIGH;}

  if (cm < 16) {
    ledState5 = HIGH; }

  if (cm < 16) {
    pos =( pos + 14 ); }

// fire all LED values...fire servo
    digitalWrite(ledPin1, ledState1);
    digitalWrite(ledPin2, ledState2);
    digitalWrite(ledPin3, ledState3);
    digitalWrite(ledPin4, ledState4);
    digitalWrite(ledPin5, ledState5);
    myservo.write(pos);

  delay(100);

}
long microsecondsToInches(long microseconds)
{
  // 1130 feet per second...transofrm inches
  return microseconds / 74 / 2;
}
long microsecondsToCentimeters(long microseconds)
{
  // 340 meters per second...transform cm
  return microseconds / 29 / 2;
}

I hope you enjoyed this one. I had a fun time with this piece of crap. Plus, it has given me some ideas of how to extend this setup into something more refined. Spoiler: more awesome.

Ultrasonic Distance Sensing

I really should have a running list of these mini-projects I have been cranking out. This one: using a PING))) sensor from Parallax Inc to drive LEDs for a set of values. Sounds boring, but it is sort of cool. Oh cool.

Picture time:

doing work at work, again

Video time:

Snippet time:

//Ping LED Levels

// Joseph Swanson | 2011
// https://swantron.com

// Setup
// LEDs connected to pins 11, 2-6
// Ping))) sensor signal to pin 7
// Ping))) + to 5V, - to ground

// Pin assignment
const int ledPin1 =  11;
const int ledPin2 =  2;
const int ledPin3 =  3;
const int ledPin4 =  4;
const int ledPin5 =  5;
const int ledPin6 =  6;

const int pingPin = 7;

// Create variables to store LED states
int ledState1 = LOW;
int ledState2 = LOW;
int ledState3 = LOW;
int ledState4 = LOW;
int ledState5 = LOW;
int ledState6 = LOW;



void setup() {

// Start serial

  Serial.begin(9600);

//Define pins 1-6 as output
  pinMode(ledPin1, OUTPUT);
  pinMode(ledPin2, OUTPUT);
  pinMode(ledPin3, OUTPUT);
  pinMode(ledPin4, OUTPUT);
  pinMode(ledPin5, OUTPUT);
  pinMode(ledPin6, OUTPUT);


}
void loop()
{


// Reset LEDs levels to low to begin loop

 ledState1 = LOW;
 ledState2 = LOW;
 ledState3 = LOW;
 ledState4 = LOW;
 ledState5 = LOW;
 ledState6 = LOW;

// Set duration variable

 long duration, inches, cm;

// Loop section for ping signal pin...start as output
  pinMode(pingPin, OUTPUT);
  digitalWrite(pingPin, LOW);
  delayMicroseconds(2);
  digitalWrite(pingPin, HIGH);
  delayMicroseconds(5);
  digitalWrite(pingPin, LOW);

// Listen with same pin
   pinMode(pingPin, INPUT);
   duration = pulseIn(pingPin, HIGH);

// Converttime to a distance

  inches = microsecondsToInches(duration);
  cm = microsecondsToCentimeters(duration);

// Write to serial out
  Serial.print(inches);
  Serial.print("in, ");
  Serial.print(cm);
  Serial.print("cm");
  Serial.println();

// Configure this for fine tuning... 50 is noisy
  delay(75);

// March through cm values...output
  if (cm < 128) {

      ledState1 = HIGH;}


  if (cm < 64) {

      ledState2 = HIGH;}


  if (cm < 32) {

      ledState3 = HIGH;}


  if (cm < 16) {

      ledState4 = HIGH;}


  if (cm < 8) {


      ledState5 = HIGH; }


  if (cm < 4) {

      ledState6 = HIGH;}



// fire all LED values
    digitalWrite(ledPin1, ledState1);
    digitalWrite(ledPin2, ledState2);
    digitalWrite(ledPin3, ledState3);
    digitalWrite(ledPin4, ledState4);
    digitalWrite(ledPin5, ledState5);
    digitalWrite(ledPin6, ledState6);

}
long microsecondsToInches(long microseconds)
{
  // 1130 feet per second...transofrm inches

  return microseconds / 74 / 2;
}

long microsecondsToCentimeters(long microseconds)
{
  // 340 meters per second...transform cm
  return microseconds / 29 / 2;
}

Synopsis time:

The code fires the ultrasonic sensor via a digital pin, listens via the same pin, does a little math to transform times to distances using the speed of sound, takes the distances and writes to various LEDs depending upon the value returned.

Think of the backup collision sensors that ship with many new vehicles…same deal. Instead of firing a speaker, I have fired 6 lights instead…more accurate, FTW!

I sort of want to mount this bad boy on my Trail-90. Or my Yukon…that would be ghetto goddamn fabulous. For real.

Thanks for reading. Happy Tuesday.

New Prozac Lawsuit

It seems like the interwebs is full of info regarding a prozac lawsuit of some sort. If you don’t believe me, let Google auto-complete “Prozac Lawsu..” and see for yourself…sites are popping up like whack-a-mole moles. Spoiler: they pop up incessantly. Pause for Prozac-bot: prozacic brobot So, what’s up with that? Birth defects. That is what is up with that. There has been a recall of certain antidepressants and anti-seizure drugs, of which Prozac has been included. Joking aside, some of these things, when taken by women during pregnancy may cause increased risks of serious congenital birth defects, heart defects, spina bifida, club feet, and even cleft palates. Scary stuff. If you fit the bill, hit that link at the top of this post. Good luck.

Ping Sensor Project Preview

Parallax Ping))) sensor in the house. Literally. ping ping ping ping ping ping ping ping This dapper-looking little guy can accurately measure distance from a few to a few hundred cm. It is very simple by design…basically just a sonar setup. My sketch sends out a signal and listens for the signal’s signature upon return…calculates time elapsed and interpolates distance using the approximate speed of sound. Slick like Rick. I hugged the sensor on my binary-project-having breadboard, as this is going to be incorporated in some way. My fr1st thought is to turn those LEDs into range holders, and output according to range. Could be awesome. Stay tuned.

Arduino Binary LED Project #3

My LED work-in-progress has manifested itself as a binary counter, with 100 ms accuracy. Like so…

217

Video of a video, for the win.

So, basically I have put together a counter that will gauge time from 0 to 25.5 seconds…i.e. 100 ms to 25600 ms. Cite the snippet:

//LED Sandbox v2

// Joseph Swanson | 2011
// https://swantron.com

// Setup... LEDs connected to digi 1-8, grounded

// Pin assignment
const int ledPin1 =  1;
const int ledPin2 =  2;
const int ledPin3 =  3;
const int ledPin4 =  4;
const int ledPin5 =  5;
const int ledPin6 =  6;
const int ledPin7 =  7;
const int ledPin8 =  8;

// Create variables to store LED states
int ledState1 = LOW;
int ledState2 = LOW;
int ledState3 = LOW;
int ledState4 = LOW;
int ledState5 = LOW;
int ledState6 = LOW;
int ledState7 = LOW;
int ledState8 = LOW;
// Create timestamp holder

long timeStore1 = 0;
long timeStore2 = 0;
long timeStore3 = 0;
long timeStore4 = 0;
long timeStore5 = 0;
long timeStore6 = 0;
long timeStore7 = 0;
long timeStore8 = 0;
// Configure interval for off/on
long interval1 = 100;
long interval2 = 200;
long interval3 = 400;
long interval4 = 800;
long interval5 = 1600;
long interval6 = 3200;
long interval7 = 6400;
long interval8 = 12800;

void setup() {

  //Define pins 1-6 as output
  pinMode(ledPin1, OUTPUT);
  pinMode(ledPin2, OUTPUT);
  pinMode(ledPin3, OUTPUT);
  pinMode(ledPin4, OUTPUT);
  pinMode(ledPin5, OUTPUT);
  pinMode(ledPin6, OUTPUT);
  pinMode(ledPin7, OUTPUT);
  pinMode(ledPin8, OUTPUT);
}
void loop()
{
  // Loop area...compare config for time to current
  // time...write when config time is reached
  if (millis() - timeStore1 > interval1) {
    // re-write timestore
    timeStore1 = millis();

    // if the LED is off turn it on and vice-versa:
    if (ledState1 == LOW)
      ledState1 = HIGH;
    else
      ledState1 = LOW;}

  if (millis() - timeStore2 > interval2) {
    // re-write timestore
    timeStore2 = millis();

    if (ledState2 == LOW)
      ledState2 = HIGH;
    else
      ledState2 = LOW; }

  if (millis() - timeStore3 > interval3) {
    // re-write timestore
    timeStore3 = millis();

    if (ledState3 == LOW)
      ledState3 = HIGH;
    else
      ledState3 = LOW; }

  if (millis() - timeStore4 > interval4) {
    // re-write timestore
    timeStore4 = millis();

    if (ledState4 == LOW)
      ledState4 = HIGH;
    else
      ledState4 = LOW; }

  if (millis() - timeStore5 > interval5) {
    // re-write timestore
    timeStore5 = millis();

    if (ledState5 == LOW)
      ledState5 = HIGH;
    else
      ledState5 = LOW; }

  if (millis() - timeStore6 > interval6) {
    // re-write timestore
    timeStore6 = millis();

    if (ledState6 == LOW)
      ledState6 = HIGH;
    else
      ledState6 = LOW; }

  if (millis() - timeStore7 > interval7) {
    // re-write timestore
    timeStore7 = millis();

    if (ledState7 == LOW)
      ledState7 = HIGH;
    else
      ledState7 = LOW; }

  if (millis() - timeStore8 > interval8) {
    // re-write timestore
    timeStore8 = millis();

    if (ledState8 == LOW)
      ledState8 = HIGH;
    else
      ledState8 = LOW; }

    // digi-write LED state
    digitalWrite(ledPin1, ledState1);
    digitalWrite(ledPin2, ledState2);
    digitalWrite(ledPin3, ledState3);
    digitalWrite(ledPin4, ledState4);
    digitalWrite(ledPin5, ledState5);
    digitalWrite(ledPin6, ledState6);
    digitalWrite(ledPin7, ledState7);
    digitalWrite(ledPin8, ledState8);
  }

Where to next with this effort? I’m thinking that I need to focus on doing this exact thing with fewer pins, and see if I can make that work. I have a few tactile switches around…perhaps some sort of dual-output. Could be cool…stay tuned.

Spring in Bozeman

First green grass in the Swanson yard. finally Bring it on. I’m ready to pull a rake.

Driving Multiple LEDs with an Arduino

I have had a bunch of white LEDs in my Amazon shopping cart for quite some time. I was tossing around the idea of doing a 5x5 cube a while ago, but ran out of steam on that project. I blame the PowerSwitch Tail…I had relays on the brain, big time. Still drafting out my big project on that front; stay tuned for some sweet garage door action. I rarely find my self with two projects in flight, that may actually turn into something, but I just might have stumbled back into the LED arena.

Long story short, I had my Arduino, Mini 9, some white LEDs, and exactly seven jumper wires in my backpack. I stepped upstairs at work for lunch, and decided to horse around with them…see what it takes to run multiple LEDs. Seems basic, and it is. Fortunately…

Here is he setup…

not much to it

I put together a little sketch. I managed to grab the time-stamp notion from this sketch that is included with the IDE, and run with the rest of it. There will be snippet, but snippet will follow A SWEET VIDEO FTW

SNIPPET ALERT

//LED Sandbox

// Joseph Swanson | 2011
// https://swantron.com

// Setup... LEDs connected to digi 1-6, grounded

// Pin assignment
const int ledPin1 =  1;
const int ledPin2 =  2;
const int ledPin3 =  3;
const int ledPin4 =  4;
const int ledPin5 =  5;
const int ledPin6 =  6;

// Create variables to store LED states
int ledState1 = LOW;
int ledState2 = LOW;
int ledState3 = LOW;
int ledState4 = LOW;
int ledState5 = LOW;
int ledState6 = LOW;

// Create timestamp holder

long timeStore1 = 0;
long timeStore2 = 0;
long timeStore3 = 0;
long timeStore4 = 0;
long timeStore5 = 0;
long timeStore6 = 0;

// Configure interval for off/on
long interval1 = 600;
long interval2 = 800;
long interval3 = 1000;
long interval4 = 600;
long interval5 = 800;
long interval6 = 1000;

void setup() {

  //Define pins 1-6 as output
  pinMode(ledPin1, OUTPUT);
  pinMode(ledPin2, OUTPUT);
  pinMode(ledPin3, OUTPUT);
  pinMode(ledPin4, OUTPUT);
  pinMode(ledPin5, OUTPUT);
  pinMode(ledPin6, OUTPUT);

}

void loop()
{
  // Loop area...compare config for time to current
  // time...write when config time is reached
  if (millis() - timeStore1 > interval1) {
    // re-write timestore
    timeStore1 = millis();

    // if the LED is off turn it on and vice-versa:
    if (ledState1 == LOW)
      ledState1 = HIGH;
    else
      ledState1 = LOW;}

  if (millis() - timeStore2 > interval2) {
    // re-write timestore
    timeStore2 = millis();

    if (ledState2 == LOW)
      ledState2 = HIGH;
    else
      ledState2 = LOW; }

  if (millis() - timeStore3 > interval3) {
    // re-write timestore
    timeStore3 = millis();

    if (ledState3 == LOW)
      ledState3 = HIGH;
    else
      ledState3 = LOW; }

  if (millis() - timeStore4 > interval4) {
    // re-write timestore
    timeStore4 = millis();

    if (ledState4 == LOW)
      ledState4 = HIGH;
    else
      ledState4 = LOW; }

  if (millis() - timeStore5 > interval5) {
    // re-write timestore
    timeStore5 = millis();

    if (ledState5 == LOW)
      ledState5 = HIGH;
    else
      ledState5 = LOW; }

  if (millis() - timeStore6 > interval6) {
    // re-write timestore
    timeStore6 = millis();

    if (ledState6 == LOW)
      ledState6 = HIGH;
    else
      ledState6 = LOW; }


    // digi-write LED state
    digitalWrite(ledPin1, ledState1);
    digitalWrite(ledPin2, ledState2);
    digitalWrite(ledPin3, ledState3);
    digitalWrite(ledPin4, ledState4);
    digitalWrite(ledPin5, ledState5);
    digitalWrite(ledPin6, ledState6);

  }

So, I configured the times to have bulbs one and four blast at 6/10ths of a second, two and five to go at 8/10ths, and three and six to blink every second. Pretty boring, huh. The next plan is to bump that number to 8 LEDs and put together a little binary timer. Then learn how to drive multiple LEDs from the same pin. After that…who knows. I can do whatever I feel like doing, really.

Farmville for Dummies…Sounds about Right

I can question the location of this book, but find the title to be spot-on. boo Zing. I think I won that round. Joe Swanson: 1 // Bozeman Barnes & Noble (and FarmVille) 0

Welp, I Sketched Another Robot

Haven’t done one of these in quite some time. awk sed I’ll file this one with the rest. Happy Monday.