What could you possibly use 8 relays on a board for?

I’ll be honest, today is payday and, I’ve been thinking about improvements to existing projects, surf’n the web looking to buy!  Then I thought of my binary Christmas tree display.  I remember seeing an 8 relay board on the web a long time ago, and thinking what could I use THAT for?  I had to come up with an excuse to buy it of course.  I convinced myself I could build a holiday light display with a twist.  I decided I’d flash the lights in binary.  Check it out if you have not watched it yet.

Now that was a fun project.  How do I expand on that in the context of “the farm”.  There’s a solar array in the field  – ideas?

I can’t say I bought this one below – but they all look about the same.  When you are just having fun with an Arduino you can afford the 8 pins to drive these things.  I suspect some have a BCD to relay decoder chip built in.  That would reduce the number of pins you need to dedicate.  Or you can use a shift register (those are fun. Look em up if you have not considered them in your project yet).


5V Eight 8 Channel DC 5V Relay Switch Module for Arduino Raspberry Pi Arm AVR | eBay

So now you’ve got a project for yourself to figure out.  The code for an Arduino to do the above binary tree display was fairly simple.  You can get fancy if you want.  Where you’ll want to be careful is how you wire up the high voltage side of the system.  I took a lot of care modifying a power strip.  This had the advantage of 8 sockets ready to plug into.  Go for it – be safe.

The autonomous road

Let’s begin with today and see how full autonomy in vehicles might progress.  Today there are some auto-driving cars, but we know they are still just safety features that help you avoid collision more than anything else.  Soon, however, these features will be able to take full control of the car and you can sit back and be just a passenger.   Once this point is reached there will be rapid changes in where and how driving is done.

Freeways will be split – not like HOV lanes are today, no.  Imagine all the Northbound lanes closed to all cars where a driver is in control.  The southbound lanes will be split down the middle and drivers will be using this as their new north-south lanes.  Those northbound lanes will be only for fully autonomous cars.

But there won’t be any lanes.  Traffic will run swiftly in both directions on any side of the road that works for the flow of traffic.  You may be heading South at a full clip when the car needs to move over to the left (into oncoming traffic) and the cars will make a path – the car will float over to the left and exit as needed.  A bit like the video here but the water is northbound and the car is the swing.

https://youtu.be/p1uwQVtHHOQ

Traffic signs will no longer be needed and perhaps digital markers will replace them.  Easier for the car to know what’s up ahead if there are sudden changes beyond its ability.

Once the freeway is 100% autonomous then all old lanes in both directions will be used (again in any direction) and the median will be removed.  There probably won’t be any lines painted (waste of paint by now).

Autonomy also brings a freedom from congestion.  Your car could pick you up – drop your kids off at school, drop you off at work, go backhome and be available for your spouse all day until it needs to grab you or the kids or both.  Schedule conflict? Uber-like services or your friend’s car will fill in the gap.  With cars always doing work or being there for the person that needs it – you have fewer cars, less need for parking in a city.  If these cars are gas or electric they can go fill themselves up without wasting your time or more importantly encouraging the (now mythical) range anxiety.

Sure there’s trucks and buses and other large vehicles that will need to be developed too.

Old cars will still have a life – where you can use it on country roads and enjoy the top down or whatever.  Not forever, but don’t worry most of us will outlive our nonautonomous car and the nostalgia we have for them.

This is not tomorrow – this is the final destination. Well until these things can fly of course.

Enjoy the future.

— Range anxiety:  I don’t have it.  When all-electric cars have a 200+ mile range and (a big and) people charge their car @ home when they sleep, the anxiety effect will be gone.  Even better the fully autonomous car will always know its limits and will be sure to charge when necessary and keep that in mind for longer trips.  Also lastly; battery swap we know is possible and fully automatic and autonomous battery swap is clearly within reach.

Stop with all the unnecessary lights!

Constellations Everything is turned off but… My fridge glows, my Stove glows, my TV glows, my hard drive glows, my bathroom outlet glows.  Everything glows.  This bombardment of light, from all the different things in my house, I’ve started to call it a constellation – my personal constellation.  It is light pollution people!  These products suck.  When they are OFF they should be invisible and silent in every way.  Sony thank you but a red led light on my TV or PS3 does nothing for me when your devices are supposed to be OFF.  The only godsend I’ve encountered is Tivo’s ability to select how annoying or not you want the LEDs to be (and very much OFF is an option).  All off THANK YOU!  The basic hard drive green flashing light is ill-conceived when you can’t turn it OFF!  Who cares if the hard drive on a computer is doing stuff.  Really.  YOU don’t.

Yes I have a significant investment in BLACK tape to cover these things up.  I question this however from the simple perspective of perfection.  WWSJD!  What Would Steve Jobs Do!

Do you GET IT NOW!  We are subjected to these ever-increasing constellations of light and they are all 100% unnecessary in our lives.  Unless I install a night light in a room – when the lights are off and the Sun is down – it should be DARK.

Do something like post this on FaceBook and ask all your friends to re-post it.  Personal constellations are not the where we need to be headed.

ConstallationsMr. McYork.

The keyboard helper

I was talking with a friend who has a big problem.  His son can’t use a keyboard but loves to play computer games.  He can only use a mouse and only with his right hand.  He has very limited abilities in his left.  It became clear after our conversation that if we put our heads together we could make something that might enable him to play the different computer games with more ease and enjoyment.

New video link added at the end of this posting.

We imagined a joystick that could be used to maybe send different keystrokes to the keyboard via some device.  I took this problem home and below is what became “the keyboard helper”.

KeyHelper1

The Leonardo has a great capability; It can emulate a keyboard and mouse.  Using this as the core of the new device I tested a number of code snippets   I was able to send words and keystrokes to Notepad, what fun!  The next thing was to read analog ports connected to a joystick.  There are a ton of examples on the web, I got this running quickly.  To wire up the joystick I needed to tie in some resistors.  I’ll try to explain why they are on the circuit later.  The last part was to add an LCD display for some visual feedback.  I thought it would be important and we found out after the fact that it ended up having a very different function than what I had first envisioned.  LCD displays can be hooked up in a few different ways the most common are parallel (all pins) or via some type of intermediate device that you to talk to via a serial or i2c interface.  I had an i2c to LCD kit from an old project and decided to re-use this (the link is to a more recent iteration).  The LCD display itself was pulled out of an old PBX phone, it had some odd pinouts but normal LCDs you find on the web will be simple to wire up.

On a 2 hr flight, I crafted most of my notes on how I felt the “system” would work.

KeyHelper5

I’d present a grid on the 2 line display of the characters Q W E R.

________Q__W______

________E__R_______

Something like the above. When you tell the LCD to use a blinking cursor and then move to a position on top of a letter – it looks selected.  By moving the cursor over each letter as the joystick moves – you can see what letter is available to be typed to the computer.  Great visual feedback.  In the above diagram suppose Q is high lighted.  The movement UP or LEFT on the joystick would then send the letter Q to the keyboard.  A movement DOWN would select E but not send E.  Once on E a movement LEFT or DOWN would send E to the keyboard.  Scroll to the letter needed then move -off- the screen to send it to the computer.

KeyHelper6

That’s how the 1.0 version functioned. There was some immediate feedback as the game being played changed.  It would be preferred to hold the key down and not just type one letter.  Selecting the letters became less critical as now it was a matter of just holding down the key and there were only 4 to send.  Here is the resulting logic main loop of the program that shows this modified approach.

void loop()
{
 center = 1; 
 up = map(analogRead(0),0,1023,0,1);    // Q MoveTo(0,9); 
 left = map(analogRead(1),0,1023,0,1);  // E MoveTo(1,9); 
 down = map(analogRead(2),0,1023,0,1);  // R MoveTo(1,11);
 right = map(analogRead(3),0,1023,0,1); // W MoveTo(0,11);

 if (up) {
 Keyboard.press('q');
 MoveTo(0,9);
 center = 0;
 }
 if (left) {
 Keyboard.press('e');
 MoveTo(1,9); 
 center = 0;
 }
 if (down) {
 Keyboard.press('r');
 MoveTo(1,11);
 center = 0;
 }
 if (right) {
 Keyboard.press('w');
 MoveTo(0,11);
 center = 0;
 }
 if (center) {
 Keyboard.releaseAll();
 MoveTo(0,0);
 }
}

The letters are now being sent as lower case. What’s nice about this approach is the MAP function.  It has a lot of uses.  Here it converts the range 0 to 1023 into the range 0 to 1.  This enables the code to read both momentary switch type joysticks or analog potentiometer joy sticks (we’ve used both in our prototypes).

Mental Note: if two states are on at the same time does the keyboard function send both or does the last one sent win?  Think to move on a diagonal in a game and how the code above may or may not enable this.

I am working on a wiring diagram it is going to be a while until I either build a second version or I can borrow back the one I’ve built for a day to recall the exact details.  Like I said above – examples for each element of this are easy to find on the web – you should not have much trouble.

A working version of the code (assuming you use the right pins with your LCD and such) is here.  As my LCD and I2C are probably different from yours – there will need to be some adjustments in the commands sent to the LCD (maybe).

I liked this project for a number of reasons.

  1. Jerry is a much happier camper now. UPDATE BELOW
  2. I had no idea how great that would make me feel.
  3. Game control is vastly improved.
  4. The project was small in scope and I was clear on the goal.

Thank you for reading.  There is not too much more to say about this project at this time.  It will be a while but the circuit will be doodled up some day.

Go make stuff.

The LCD took on an unexpected use:  It happens that the joystick needs to be positioned just right.  Exactly right.  Such that the limited motion of the left hand can move in the 4 directions.  It takes some time to get this center point just right.  The LCD will be highlighting the direction of the “problem” and my friend can use this as visual feedback until he gets both the joystick and hand centered.

UPDATE. The fine film crew at work put together this video of the project’s impact.

 

 

 

Chip programmer with a twist

I am working on 1000 projects all the time.  You may already know that of me.  This one will be a fun adventure.  I’ve started by shrimping.it this is a site where they show you how to build a bare-bones Arduino.  I went and ordered the part for 4 kits via the electronics seller http://www.taydaelectronics.com/ it was under $30 for all the parts I needed.  I did not get boards as I plan to design my own at a later phase. Shrimp + SPI to 8 pin chip  Here’s the shrimp built with an 8 pin chip holder where it can be used to program the little chip.  This is an Atmel ATTiny 85 ready to be programmed.

Now the hard part.  Let’s say I want to program a lot of these little chips.  Wouldn’t it be nice if the Arduino held in memory all the code and capabilities to program the chip without an attached USB link to a computer?  That’s goal #2.

random blickers

Here is an ATTiny 85 running code that was pushed through the Arduino in the traditional manner (Goal #1).  What I like about the Tiny line of chips is there is little to no supporting hardware required to have them run.  This makes them a lot of fun for all kinds of little builds.  They will even run off three or 4 AAA batteries and for quite some time.

Engineering Roundtable – Audio Spectrum Analysis and Fire!

In today’s edition of “Engineering Roundtable,” SparkFun Engineer Chris Taylor guides you through the use of a microcontroller to perform audio spectrum analysis. He explains the basics of working with the audio spectrum and ultimately links up his project with a propane torch. Why? Well…why not? Check it out:

You can find the Vimeo version here

Feel free to leave any comments or questions in the comments section below and we’ll do our best to answer them! Thanks for watching and we’ll see you again soon with another edition of “Engineering Roundtable!”

via [SparkFun Electronics – Recent News Posts](http://www.sparkfun.com/news/1051)

Current electric highway

(puns are fun) This is a google map showing the current supercharging stations. From this alone, you should be able to get to any destination within 100 Miles of any of these locations and do so without any range anxiety. If your final destination has charging options then you can be comfortable within 200 miles of any of these locations. If you look into public charging stations you can probably cross the country in any direction. By 2015 the Tesla stations should enable cross-country trips with ease. I am going to get to know California then the country.

If you are listening Tesla – Phoenix next; I have travel plans and a place to stay all ready to execute.

View Larger Map

http://www.teslamotors.com/supercharger


The Tesla Model S charge port, juice er up fella!

Charge It!A mini fact:  So far the average charge time for the car has been about 2 hours for a normal day to work and back.  If I drive more conservatively someday perhaps that time will come down (unlikely anytime soon).  In the photo, the surface that looks like a button is indeed one.  When you push this the little flap, that is part of the running lights, pops open.  Push the plug into the car and the green ring will light up.  Pulsing slowly or quickly depending upon the current battery level.  Press the button again to pull out the plug.  All of that will only work if you have the key fob with you.  I tried to remove the plug when the key fob was in the house and it would not unlock/come out.  Also, the car can detect the plug is in and will not let you drive off.  Good thing for those (not yet fully) caffeinated early morning departures.  I am not keen to look at the PG&E bill but will do so shortly to see how we are doing in that regard.

On a slightly different note today all driving about has been electric.  A gas-free day today.  I’ll maybe start tracking the car and bike usage (all cars and bikes).  When the cars are used to do anything that counts and if the bikes are used to do anything useful other than exercise that will count.  In a gas-free world, I’d take my electric bike to work while the rest of the day’s outings would be in the Tesla.  A fully electric day.  Half and half would be we use 1 gas and one electric.  Full gas would be we used no electric.  There will be the odd day we don’t go any place at all.  I should probably track this on a Google sheet.

Lastly will be doing the daily cash costs of gas vs electric from the simple fueling only perspective.  I am certain if I use all the gas items from the CC bills over the last year and the electric bills there should be some way to see how much money shifted to electric and if there are any savings at this level.  That’s data collection so someday soon again.

Tesla Model S is here.

The Tesla Model S is a thrill to drive.  I love speed and acceleration so it is a good fit.  To say it has all the features of an electric car sells it short.  It has all the features of any car you’d ever really want.  It just happens to be electric.  A few posts will be here over time about the car and when there are interesting developments but otherwise expect the hardware and geekery that’s considered normal.

Today I drive the car to work for the first time.  My impression of the car, dark in the garage, fully charged, was one of latent power.  For an odd reason, I perceive it as asleep and not off.  Odd that I perceived anything of this nature in fact.

First hours of ownership, why not drive the coast for a while.
First hours of ownership, why not drive the coast for a while.

Hi ho hi ho.

Stock Bot to Arduino

The original StockBot was built on the Netduino platform.  I’ve been working on the code for the Arduino platform and have now assembled working code.  I can’t claim it is stable yet but it’s doing the job for now.

I am using the Ethernet Arduino.  As I explore a number of things all the time, I have also made a shield for the Arduino to see if this project could become a kit for others to build.  A little stuck on a source for Numitron tubes so I am trying to make the board generic enough to take a tube or a normal led display (still puzzling that through).

Let me clean up the code – I’ll take a hard look at it over the next month.  Maybe after the skis hit the slopes in Whistler I’ll have something to post and walk everyone through. Early December if you don’t ski or board.

What’s StockBot – here’s the beginning post

Here are the prototype boards I had made.  They have a nasty bug but I learned something (and could fix it so all is good).