Friday, May 4, 2018

Internet Safety class

I will continue to update this post as more resources become available.

The slides can be found here: Internet safety slides  great website to get you started.

information about neurotransmitters (oxytocin is not listed here :-( )

Katey Mcpherson is a former educator who speaks all over the country about internet dangers and addiction

Her facebook page is awesome

search for her videos on google

More updates coming check back again soon.

Monday, October 2, 2017

Garage door opener...or what engineers do.

Heidi got an awesome shirt for me:

So here goes:

I was really tired of my garage door openers working sometimes but not others, and I was totally inspired by my dad redoing his garage door openers with some cool arduino stuff so.

I got:
I already had some wires to connect it all, a hot glue gun, some glue, and some solder and a soldering iron.

The goal was:
  • Spin up a webserver on the ESP8266
  • host a web page with a button to trigger the relay
  • detect if the garage was open or closed and display that on the web page.
Here is the basic wiring diagram

Note that this is an AdaFruit Huzza not my beloved NodeMCU but it's what I had in my fritzing library.

Largely this was not a difficult project except that my soldering skills are not up to snuff yet.

I ran into one gotcha...that is that the 0 pin, D3 on the NodeMCU is triggered when A) the board is being programed or B) power is restored after an outage.  The problem with that is, if I used the 0 pin for the relay, it would get triggered every time the power came back on.
Fortunately the 4 and 5 pins do not have multiple uses and therefore do not trigger on boot, or flash, so I switched the relay to pin 5 and all is well.

I used the phone cord between the NodeMCU and the ultrasonic sensor since I wanted to be able to unplug it at will and I needed a fairly long run. I split the coupler, and soldered one end onto the node, and the other to the sensor, then just ran a $1 phone line between them.

I also  put in a quick plug for the relay to the garage door opener so I could pull it down whenever necessary.

Here is the code:

#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <ESP8266WebServer.h>
#include <ESP8266mDNS.h>
#include <Ethernet.h>

MDNSResponder mdns;

// Replace with your network credentials
const char* ssid = "MYSSID";
const char* password = "MYNETWORKPASSWORD";

ESP8266WebServer server(80);

String webPage = "";
String webPageOpen ="";
String webPageClosed = "";

int switch_pin = 5; //D1 on nodeMCU
int echo_pin = 0; //D3 on nodeMCU
int ping_pin = 4; //D2 on nodeMCU
int garageStatus = 0; //closed is zero
int minDistance = 10; //inches from sensor
long duration,distance;

void setup(void){
  webPage += "<html><head><title>phatGarage</title>";
  webPage+=".button {";
  webPage+="text-align:center;background-color:#000000;color:#FFFFFF;padding:10px;margin:auto;-moz-border-radius: 10px;-webkit-border-radius: 10px;width:200px;height:100px;";
  webPage+="</head><body><div style=\"max-width:250px\"><a href=\"toggleg\"><div class=\"button\"><h1>Garage Door</h1></div></a><hr/>";
  // if garage is open:
  webPageOpen = webPage;
  webPageOpen += "<h1 style=\"color:red;text-align:center;\">Garage is OPEN</h1><!-- close full page div--></div>";
  webPageOpen += "</body ></html>";
  // if garage is closed:
  webPageClosed += webPage;
  webPageClosed += "<h1 style=\"color:black;text-align:center;\">Garage is Closed</h1><!-- close full page div--></div>";
  webPageClosed += "</body ></html>";

  //Close off clean web page if we need it:
  webPage += "<!-- close full page div--></div></body ></html>";
  // preparing GPIOs
  pinMode(switch_pin, OUTPUT);
  digitalWrite(switch_pin, LOW);
  pinMode(ping_pin, OUTPUT);
  digitalWrite(ping_pin, LOW);
  WiFi.begin(ssid, password);

  // Wait for connection
  while (WiFi.status() != WL_CONNECTED) {
  Serial.print("Connected to ");
  Serial.print("IP address: ");
  if (mdns.begin("esp8266", WiFi.localIP())) {
    Serial.println("MDNS responder started");
  server.on("/", [](){
    if (garageStatus == 0){
      server.send(200, "text/html", webPageClosed);
    }else {
      server.send(200, "text/html", webPageOpen);
  server.on("/toggleg", [](){
    if (garageStatus == 0){
      server.send(200, "text/html", webPageClosed);
    }else {
      server.send(200, "text/html", webPageOpen);
    digitalWrite(switch_pin, HIGH);
    Serial.println("switch on");
    Serial.println("switch off");
    digitalWrite(switch_pin, LOW);
  Serial.println("HTTP server started");
void loop(void){
  //This does a DNS update if necessary

  //Test distance from sensor:
  // The PING))) is triggered by a HIGH pulse of 2 or more microseconds.
  // Give a short LOW pulse beforehand to ensure a clean HIGH pulse:
  pinMode(ping_pin, OUTPUT);
  digitalWrite(ping_pin, LOW);
  digitalWrite(ping_pin, HIGH);
  digitalWrite(ping_pin, LOW);
  // The echo pin is used to read the signal from the PING))): a HIGH
  // pulse whose duration is the time (in microseconds) from the sending
  // of the ping to the reception of its echo off of an object.
  pinMode(echo_pin, INPUT);
  duration = pulseIn(echo_pin, HIGH);
  // convert the time into a distance
  distance = microsecondsToInches(duration);
  //if distance is too close, the garage door is up and being sensed by the sensor, otherwise the sensor is detecting the car or ground which is further away
  //this may need tweaking if the sensor is picking up the suburban as less than 10 inches away.
  if (distance < minDistance){
    garageStatus = 1; //the sensor sees the garage door
    garageStatus = 0; //the sensor does not see the garage door
  //Handle any requests to the webserver

long microsecondsToInches(long microseconds) {
  // According to Parallax's datasheet for the PING))), there are
  // 73.746 microseconds per inch (i.e. sound travels at 1130 feet per
  // second).  This gives the distance travelled by the ping, outbound
  // and return, so we divide by 2 to get the distance of the obstacle.
  // See:
  return microseconds / 74 / 2;

This was a super fun project, although I'm sure Heidi did not love all the time it took this afternoon...

Tuesday, May 30, 2017

More fun ways to "spend" time

So after making an arcade console and getting the kids hooked on great old video games, I saw this set of videos from Bob at
Arcade Cabinet Part 1
Arcade Cabinet Part 2
Arcade Cabinet Part 3

Parts 1 and 2 were informative, but part 3... A human sensor that turns the lights on and off!!! Must have!

So I started playing with an arduino uno board, (really fun) but then I got to playing with this little creature:
  you can learn more here:

It took a bit of fiddling to get it to work so I wanted to capture that on the blog for later use.

First I had to get drivers here:

Once I had the drivers, I plugged it in and got a new terminal device: /dev/tty.SLAB_USBtoUART
So then I had to set up the Arduino IDE:
I opened preferences and added to the Additional Boards manager URLs:
Clearly I did this on my mac, but it is similar in WinDOZE.

At that point I could open the boards manager:

And install the esp8266 boards by clicking the install button next to version 2.3.0:

Finally I could select the NodeMCU in the IDE user interface under tools:
and select the right port:
pushed it to the chip and ran > screen /dev/tty.SLAB_USBtoUART 115200
and lo and behold, a web server with my own custom code that actually turns my led's on and off!

How absolutely amazing!!!
Next up: get my relay working with this board, connect up the sensor, add a few buttons to turn things on and off via this web client...

Good stuff and so fun to learn something new!

Fun ways to waste time

So, for my birthday I got a Raspberry pi 3, with a case, and a power supply, and I had to immediately set it up.

I tried OSMC with Kodi
I tried straight up Raspbian
And then I found RetroPie!!!

I was completely sold. Old school games, Kodi, nice interface,
So I set the whole thing up with XBox 360 USB connectors, it was cool...but playing those old games I wanted the arcade feel: Hearing "Full point" in Karate Champ is not quite as amazing when you had to use the D-Pad and the ABXY buttons.

So I did what any one else would do, I ordered 4 joysticks and 40 buttons and 2 two player PCB boards that attach via USB, and a trackball, oh and 2 more LED joysticks (for Karate Champ!) and an OrangePi PC so I did not have to cannibalize the RPi media center.

I was excited , the OPi is:

  • Slightly faster than RPi 3 at 1.6 ghz vs 1.2
  • Has the same RAM
  • A Mic for Alexa support
  • An IR chip
  • It was only $27 with a case and power cord!


  • OS support is very poor 
  • The video drivers are closed source so no HW acceleration which unexpectedly makes big difference to the emulators.
I built this:
The RPi found its way into this beast.  It took a ton of troubleshooting to get it to recognize both players on the separate joysticks (this post explains why) 
FYI, this is the quirk code for this unit: 


It still needs a little love.  I have the second joysticks for player 1 and 2 (in the middle) to put in (they light up with LED lights!). The usb to PS2 connector for the track ball will be here shortly so it can go in. There are a couple of games that don't work quite right yet, but it is really close to functioning as expected...

Then I have to make it pretty with paint, some hot pink T-molding, and this beautiful vinyl overlay from Metro Styling (mine is that full image, but 16 inches x 5 feet): 

Then for the rest of the cabinet, I think I am going to mount it on top of a mini fridge, then fill it with Cherry Coke so that my love will enjoy it a little more.

The coolest part is seeing the kids totally into Mrs. Packman, or Galaga, or to hear them playing 4 player X-men or Teenage Mutant Ninja Turtles together (I haven't quite got them hooked on Gauntlet yet but there is still time).

Thursday, June 5, 2014

Internet Safety

Giving a class today on internet Safety.
Get the powerpoint here

Sunday, January 20, 2013

I love juice don't you?

The universe has combined to drive me toward a juice fast.  I signed up for RAGNAR. Yes I am a masochist! As a result I have started monitoring my food intake, and exercising (swimming, cycling and yes running). I have also been devouring as much data as I can about how to train, and run endurance races. I am actually having lots of fun with this. Now you are asking yourself, what does this have to do with a juice fast?

Thursday my friends at Audible had a sale on 100 audio books, and in the list I found Finding Ultra by Rich Roll. In it I was impressed by his Vegan diet transformation. I was inspired by a 40 year old man who transformed himself in 2 years into an ultra marathoner, an Iron man and one of two to complete the first Epic 5 Challenge ( I actually started listening to the book after eating at Tucanos. Afterword I did not feel great, and a vegan diet sounded pretty good. So I started considering trying a vegan diet for a while.

Then I bought Scott Jurek's book Eat and Run about him becoming an unlikely ultra marathon powerhouse on a vegan diet.  Haven't finished the book yet but I will write a review in the next week or so.  Vegan push number 2...

Then I got on Face Book last night and read that my cousin Heidi is on day 12 of a Juice Fast after watching the movie Fat Sick and Nearly Dead. I jumped online and thought I would add it to my Netflix queue...but it was already there. Apparently my beautiful wife added it to our queue because her friend and fellow wonder woman is trying the juice fast. Today we watched the movie and I was impressed, first by Joe Cross and his story, but even more with Phillip's story (you'll just have to watch it to find out).  Here was push number 3 for a vegan diet...

So, although I will be baking bread still for the kids, and Heidi (at least for a week or so before I convince her to join me). I am going to embark on the juice fast, no solid food, only juice and water for the next two weeks as a cleansing fast. I expect the first several days to be tough. Then I will evaluate if I want to continue to 30 days. If I make it to 30 days, then I will evaluate if I should continue the 60 days like Joe does in the documentary.  Tuesday morning I am meeting with the Doctor (again, I met with him before I started the first of December...), and will have my blood work done and hopefully a few more tests.

Will I be vegan the rest of my life? Probably not, but I will be for the next few weeks, and possibly a stint after that. I will let you know how it goes. Wish me well!!!!

Thursday, December 6, 2012

I Need No Knead Bread.

Ok, I am a few years late to the party. I realize that this no knead bread thing has been around since 2007. I realize that I bought 2 new dutch ovens to try this in the last 3 years. I realize that most of you have probably already tried this and gotten over the AAAAAHHHHHHH factor. That being said, this is fun so I am writing about it. For those of you who are gluten free, avert your eyes, read no further, I have no interest in torturing you.

Crispy crusty deliciousness with 4 ingredients and 5 min of work.

There is something awesome about your kids waking up in the morning to fresh baked artisan bread. Even better when you have invested a total of 5 min of work to make it... This delicious loaf came out about 5 min ago and will be a large contributor to my breakfast!

Here's the recipe:
  • Measure out 2 parts flour to 1 part water but do not combine them at this point (3 cups to 1.5 cups seems to be the norm). You can use up to 1/2 whole wheat flour with great success but, more whole wheat makes a reaaaaalllly dense loaf.
  • Add about 1t salt per cup of water
  • Add 1/4t yeast per cup of water
  • Stir up the dry ingredients, then add the water (this is critical because you are not going to knead this dough to make sure that all things are well dispersed within the dough)
  • Stir to combine (result is a wet hairy dough ball).
  • Cover with plastic wrap
  • Wait 12-18 hours
  • Flop it onto a lightly floured counter (gently)
  • Lightly stretch into a dough ball
  • Let it rest and raise 30 - 90 min.
  • Put your "cloche" (Dutch oven) in the oven at 450* and let it heat for at least 30 min
  • Drop the dough in the "cloche", close it up, bake 30 min
  • Pull the lid, and let it continue to toast for 10 min until dark and crunchy.
  • Remove loaf, listen to the song it sings to you as the crust crunches and crackles
  • cool 30 min (or as long as your patience allows)
  • cut 
  • enjoy with real butter and honey from the back yard, or home grown jelly!
My red enamel Tramontina has a new primary use.
I've only made 4 loaves, but the first three disappeared as soon as there were kids, and loaf 4 is cooling right now, soon to meet it's demise.

 The key to this method is steam. In commercial bakeries they pipe steam into the oven while the bread bakes to make a really thin crisp crust without sacrificing the integrity of the crumb. The cloche (pronounced \ˈklōsh\) allows sufficient build up of steam and very even heat from all sides much like a commercial oven would.  You could use a cast iron dutch oven, or an enamel Tramontina like I do, even the glased terra cotta cloche would work great (Alton Brown likes big terra cotta pots upside down on a pizza stone or the pot plate).  In the end the temperature outside the cloche is 450 but inside it is a steamy delicious 250 degrees, allowing a nice crust, and plenty of oven spring. 

Observations so far: 
  • I really want to rush this process and that is not good for the bread... so perhaps when kids come home from school is a better time than when they wake up. It takes 2 hrs from the time you pull the dough onto your counter, until it is ready to eat, granted you only work 2 min during that time, but you do have to be awake.
  • This bread would be fabulous with add-ins like calamata olives, basil, whole roasted garlic cloves, rasins and a sprinkle of cinnamon, etc.
  • The crust is super crunchy for an hour or so, but if you let it rest for a couple of hours it gets chewy and delicious in a totally different way.
This is what happens right after it is sliced

I have now made 8 loaves, and all of them have turned out pretty good. 
I did get heavy handed with the salt 1 time, it was ok.
I did not stir it well one time and got all the salt on one side of the bread which made for some good and some REAAAAAALLLLLLY bad bread in the same loaf.  
I tiny splash of water in the Dutch oven, just before you close it, makes the crust even thinner and tastier.

The nice part is that this is just so darn simple, I am not sure why I wasn't doing it before! I love to get the kids involved making the dough because they get so excited about the bread. I love that I can hear a loaf crackling as it cools right now!