What’s new. . .

 A quick update as to what I have been up to before I start to write and edit the individual pages. It seems like it has been forever since I have posted, but it has only been a week or so. 

The weather has been more than a little bipolar in this neck of the woods. 

I making some changes to the site. I have added some new pages and ideas to fill them with. 

Here is my quick list of what I have been up to. . . 

• Drywall and tiling the bathroom. 

• Network clock 

• Neopixel / ESP8266 controlled night light

• The House of Pi’s.

• A list of ATTiny projects I am really looking forward to. 

And I know I will find a couple of more things to add in yet. 

A Test in Time – Updated

A Test in Time

My Clock Making Adventure begins. . . 

IMG 2228

Clocks seem to be one of the good-ole-standbye projects. And why not? They are useful and it is easy to get creative with them. In this post I show you how I have started on my journey of time. 

I have looked at my options for keeping time. Micro controller a yes and then a time source. Micro controllers themselves are terrible timekeepers over long periods of time. A popular option is an Arduino Uno (or other such board) and a RTC (Real Time Clock) such as the DS3231 or DS1307. Once it is configured, it does keep time quite well and over a long period of time. It uses a backup battery to keep time if power is lost. There is some drift in the clocks, but over a year it is fairly small. 

I played around with RTC on a Nano, but lately I have been playing with the ESP-01. It is a fun little chip. It is part of the ESP8266 family. I found my controller and way for time, NTP (Network Time Protocol) to keep accurate time. The ESP requires an active internet connection for it to keep time, which is the con(?) of this project, but the time is kept spot on. 

I have used the LED and OLED displays in the past and like using them. In this project I wanted the display to be simple. My main focus is to learn about time. The packet getting the time, picking the packet apart, and displaying the correct time for where I am at. For that purpose I picked a 4-digit, 7-segment display using a TM1637 chip to drive it. And I had one in my displays drawer. 

IMG 2134

 

From the schematic above the pin to pin table is:

      Display -> ESP-01

  • CLK -> IO2
  • DI0  -> IO0
  • Vcc  -> 3.3v
  • Gnd -> Gnd

As a quick test here, you can plug everything into 3.3volt power and the display should read 0123. Now it is time to move on to the code. 

I am not sure where I found the core time code I am using (if anyone recognizes it let me know and I will give due credit), but I started with a code base that would get a NTP UDP packet from a NTP time server. This method does not use one of the NTP libraries, but relies on decoding the packet and calculating the time. One other feature I added was the WiFiManager library. It is a wonderful addition to any wireless project as it makes setting up wireless a breeze and you don’t have to have people edit the sketch. I like to give away some of my projects and this makes it easy for the people I give the to. All they need is a web browser to set it up and get it running. 

IMG 2332

I stared around the workshop for two nights trying to come up with a clever display for the second attempt at dead bug soldering. This time wasn’t as successful. I do admit there wasn’t much planning involved. I started started bending wires and winging it. Next time I will have to do a little more planning as this example is something I am impressed with. 

deadbugheadphone

I finally found something that is half whimsical and half just sad, but it will display my little clock until I can (or a family member) come up with something more suitable. 

IMG 2354

 

My code can be found over at my GitHub

Taking a break. I will be back to update this soon. . . 

New Wireless!!! Linksys Velop Review

Home Wireless Upgrade to the Linksys Velop

A confluence of circumstances recently had me upgrade my home wireless. It has been on my plate the past few months as my connection in the basement is up and down like The Beast, there is no connection at the other end of the house, and standing outside; forget about it!

I have been doing my homework while waiting for the right time. In one of my careers as a Network Engineer, I spent a lot of time supporting wireless; enterprise wireless. 2 controllers and over 900 access points, thousands of devices per day, yet at home it was the dark ages. I tried a couple of remedies such as wireless extenders (worthless) and playing with OpenWRT to see if I could tweak the settings to pull out a little more life from the aged Netgear 600. 

I knew from my quick survey out of iStumbler that the airwaves were getting a little crowded.  

OldNetworkPeek

 

Once iStumbler confirmed what I already knew, I brought out Chanalyzer to take a closer look. Yikes, that is some dirty air out there and 2.4GHz is a wasteland. I already knew from my experience that 5GHz was a necessity!! All of my major devices are Apple and ready for 5GHz. Having AC on board the access point would be a nice addition as it is the up and coming next standard. The 5GHz range is looking quite nice in my area right about now, so it is a great time to move in. 

HomeWiFI Analyzer

Knowing I have to cover my whole house and I also want it to bleed outside by the pool and porch, multiple access points would serve my purpose. Part of the enterprise setup I had my hands in also used a series of access points that didn’t use a main controller per say. There was one that acted as the controller for all the others, creating a MESH network. It was pretty cool and kept the cost down for our remote sites; but the price was still out of range for home. Then last fall I started to read about MESH networks for the home. Now this is something I can get on the band wagon about. 

Reading over the specs for all of them I believe that the Linksys Velop it on top of the stack right now. At least for my wireless upgrade it does. It has 2.4/5GHz (some other brands only work with 2.4, yikes) b/g/n/ac. The setup really is, almost as easy as they claim. 

I am still reading up on how the do their backhaul between the APs. My understanding so far is that 2 of the channels are bonded for speeds to the clients and there is a single 5GHz channel for talking between the two. And after seeing my iStumbler chart from above, I have some other questions as well. 

After unboxing them, I placed the new one, right where the old one sat; right next to the cable modem. I wiped out my phone. side note. at work i actually bothered to download the manual and read it. yes it was the simple users guide, but i was able to make sure i was doing everything right to get it working, i can dink later. oh and i also installed the app so i was ready to go. I fired up the Velop app and just like the screen said it took a couple of minutes for it to find the access point and link up. Once I had the first one up I wandered around the house to see how it was. WOW, I was impressed already and there was only one AP up. I had signal in the kitchen and some outside! A small victory. 

Now to place the second one. I already had a place in mind for it. Velop has other plans and they are kind of hit and miss in my opinion. I first started with the AP in one room over, up on a shelf. So it was going through 2 2×4 drywalled walls, about 40-45 feet away. Nope it complain that I need to try closer. It was during this time, setting up the second one that was most frustrating. The progress bar is honest when it says it will be a few minutes. And it also took out my iPhone a couple of times. By 1:30am I gave up on the second one. It was late and I was frustrated. 

The next day I gave it another try after and fresh cup of joe. This time, the last time, I place it with one wall and about 30 feet between the two. Shazam! The two started talking and doing their thing. 

IMG 2053

Wireless, I am now King of the Hill on my end of the street. The drops in the basement are gone. I can surf from the car, through the house, and out to the pool. The speeds are very nice between devices, especially for backups. After having it up and working now for a little over a week, the whole family is very pleased with the results. 

HomeWiFiPeek

My Valentine’s Dead Bug

*** This was a quick copy and paste. I will be back to edit it soon!

 

This was one of those projects were I had a good idea in hand, but by the end it turned out quite different; and I am quite pleased how it turned out.

I wanted to make my Wife something nice this year for putting up with my various projects. Those on the “list”, those in planning, those in progress, those finished, and some abandon.

My original idea was to cut a heart out of wood, mount the 8×8 matrix in a hole in the middle, and mount the ATTiny on a PCB somewhere. I couldn’t make up my mind in front or back. While those ideas where being pondering and experimented with, I started on the hard part of the project.

I looked in my stock as I had both the ATTiny85 and 8×8 matrix handy. Wow, that seemed like a first, I didn’t have to order anything. I hadn’t really used the matrix before so I downloaded the Adafruit libraries and hooked it up to my Uno clone and started to play around. I used both the Adafruit_LEDbackpack and Adafruit_GFX. The animations are pretty straight forward. You have to create your image with 0 & 1’s, then call each of them as you need them. 

Here is an example from my code that shows part of the heart being drawn, it is the center square.

<span style="box-sizing: border-box;"> heart2_bmp[] = </span><span style="box-sizing: border-box;"> { </span>
<span style="box-sizing: border-box;"><span class="hljs-keyword" style="box-sizing: border-box; color: #f92672; margin-bottom: 0px;">B00000000, </span></span>
<span style="box-sizing: border-box;"><span class="hljs-keyword" style="box-sizing: border-box; color: #f92672; margin-bottom: 0px;">B00000000, </span></span>
<span style="box-sizing: border-box;"><span class="hljs-keyword" style="box-sizing: border-box; color: #f92672; margin-bottom: 0px;">B00000000, </span></span>
<span style="box-sizing: border-box;"><span class="hljs-keyword" style="box-sizing: border-box; color: #f92672; margin-bottom: 0px;">B00011000, </span></span>
<span style="box-sizing: border-box;"><span class="hljs-keyword" style="box-sizing: border-box; color: #f92672; margin-bottom: 0px;">B00011000, </span></span>
<span style="box-sizing: border-box;"><span class="hljs-keyword" style="box-sizing: border-box; color: #f92672; margin-bottom: 0px;">B00000000, </span></span>
<span style="box-sizing: border-box;"><span class="hljs-keyword" style="box-sizing: border-box; color: #f92672; margin-bottom: 0px;">B00000000, </span></span>
<span style="box-sizing: border-box; margin-bottom: 0px;"><span class="hljs-keyword" style="box-sizing: border-box; color: #f92672; margin-bottom: 0px;">B00000000, </span>}, </span>

Text scrolling is straightforward, but for those who are new, lets pick it apart a little bit and see what is going on.

<span style="box-sizing: border-box;"> <span class="hljs-keyword" style="box-sizing: border-box; color: #f92672; margin-bottom: 0px;">matrix</span>.setTextWrap(false); </span>
<span style="box-sizing: border-box;"><span class="hljs-keyword" style="box-sizing: border-box; color: #f92672;">matrix</span>.<span class="hljs-keyword" style="box-sizing: border-box; color: #f92672; margin-bottom: 0px;">clear</span>(); </span>
<span style="box-sizing: border-box;"><span class="hljs-keyword" style="box-sizing: border-box; color: #f92672;">for</span> (int8_t x=<span class="hljs-number" style="box-sizing: border-box; color: #ae81ff;">8</span>; x>=<span class="hljs-number" style="box-sizing: border-box; color: #ae81ff; margin-bottom: 0px;">-100</span>; x--){ </span>
<span style="box-sizing: border-box;"><span class="hljs-keyword" style="box-sizing: border-box; color: #f92672;">matrix</span>.<span class="hljs-keyword" style="box-sizing: border-box; color: #f92672; margin-bottom: 0px;">clear</span>(); </span>
<span style="box-sizing: border-box;"><span class="hljs-keyword" style="box-sizing: border-box; color: #f92672;">matrix</span>.setCursor(x - <span class="hljs-number" style="box-sizing: border-box; color: #ae81ff;">8</span>, <span class="hljs-number" style="box-sizing: border-box; color: #ae81ff; margin-bottom: 0px;">0</span>); </span>
<span style="box-sizing: border-box;"><span class="hljs-keyword" style="box-sizing: border-box; color: #f92672;">matrix</span>.<span class="hljs-keyword" style="box-sizing: border-box; color: #f92672;">print</span>(<span class="hljs-string" style="box-sizing: border-box; color: #e6db74; margin-bottom: 0px;">"1 short text"</span>); </span>
<span style="box-sizing: border-box;"><span class="hljs-keyword" style="box-sizing: border-box; color: #f92672; margin-bottom: 0px;">matrix</span>.writeDisplay(); </span><span style="box-sizing: border-box; margin-bottom: 0px;"> delay(<span class="hljs-number" style="box-sizing: border-box; color: #ae81ff; margin-bottom: 0px;">100</span>); </span>

To start, the text shouldn’t wrap as a message will be scrolling across the matrix. The first variable, x=8 is where the text will start to scroll across. This example starts on the right and moves towards the left. x>=-100 is allowing room for the characters. I took the total number of characters in my text message and multiple it by 9 and the text displayed correctly. If you miscalculate you might not see the whole message. This happened to me as the original message was about 4 characters and the value was 96. My message was much longer, but I hadn’t changed the 96. Once it was bumped higher all worked out well.

I was using my Uno clone to do the testing. It is just much quicker to make a change and upload it quickly. Everything was moving along great, but I noticed one thing, the message wasn’t oriented right, it was a bit upside down.

There is another command that comes in useful.

matrix.setRotation(<span class="hljs-number" style="box-sizing: border-box; color: #ae81ff;">1</span>)<span class="hljs-comment" style="box-sizing: border-box; color: #75715e; margin-bottom: 0px;">;</span> 

With it you can rotate the screen in any of the four directions depending on where you need/want the pins to orient. Setting it to one put 0,0 in the upper, left-hand corner, with the pins pointing downward. Or as in one part of my code I use the rotation to spin the heart.

Now is was time to program the ATTiny. I do like working with these little guys. They work quite well in a lot of my projects and can take up a lot less space than an Uno. There are some great guides out on the net on programming the ATTiny family of processors. The only hiccup I had was dealing with the Wire library.

While libraries might be compatible within the ATMel family of chips, there is the space consideration. And the ATTiny85 doesn’t have the room of its big brother. There is a Wire library that was made just for the ATTinys, it is also from Adafruit. WireTinyM. Once I updated that it worked much better. I left in both for when making changes and updates. Depending on which one I am using I can just comment out the other. 

During all of this I am still pondering how to make the mount for all of my little bits. I start to look at the 8×8 and the Tiny and figure what the hay. There are only 4 pins that need hooked up. And this would probably look way cooler than protoboard as there is no time to get a PCB fabricated and delivered. It seemed to so simple, 4 pins to 4 pins. It took a couple of tries in trying to find what might look best and also work the best.

Well, it struck me. It had earlier, but wasn’t too hip on the idea at first and then it just started to grow on me the more I thought about it. I got myself a length of electrical wiring. I had a length of 3-wire left over from a kitchen project. I pulled out the ground wire and bent it in the shape of a heart. I would then just be able to hang the matrix and Tiny from the top of it. Shazaam!

After that it was a matter of finding a base (a birch log part that was from a wedding center piece and some Lake Superior lake shore rocks).

Oh last but not least, I had to power it. I was going to use USB cable, but no, that would be just too much hassle. AA?? Naw, too many and won’t last too long. Hey, I have one of those lipos at 3.7, I wonder if it would work? I know the ATTiny will work at 3.3V and that data sheet states the lowest power the for the matrix is 2.7. What the heck. I wired up a JST battery connector and plugged it it – DONE!

SCHEMATICS 

Img 1853 3hpmbc0wrk

Doh!

This was meant to be a one-off, lets just have some fun kind of project. I was once told if you don’t learn something new everyday it just wasn’t a day. And I did learn in my eagerness for some quick video gaming gratification. 

I had been trolling through my parts box and thinking of a fun project to work on. Then I remembered two things. First was the ATTiny85 video games. I always have ATTinys laying around so this would be great. I checked the BOM and I had everything save the PCB boards and they are available on OSHPark. I even had a spare OLED screen in my display box. COOL. And, and, a way back I had an online bump in with Drew of OSHPark and he had sent me a gift certificate for boards. Excellent. I quickly put in my order and it was under $4.00 so still plenty left on the coupon to get my first PCB designed board done. 

I placed the order and forgot about it for a while. After all of the slow boat from China orders I tend to forget about things once I order them, I can’t stand being obsessive over something that is just going to take its time. Anyhow, low and behold one day when I get home from work there is a little package from OSHPark. I quickly get into it and see the 3 pretty purple boards and my OSHPark sticker for the collection, just waiting for a quick trim with the Dremmel and then get populated. 

IMG 0922

When I wasn’t waiting for the boards I took the time to program a ATTiny85 and breadboard it up with the screen. I wanted to make sure the big parts were ready and working for when the boards showed up. I almost wired up buttons, but it was about 2:00am and it was time for some slumber. 

IMG 0994

I was giddy at work just itching to get home and put all of the parts together and play some Tetris. And to be honest it has been quite a while since I have played it. Alright already, all of the parts are laid out and the iron is hot. 

IMG 0991

IMG 0992

 

 

 

 

 

 

 

 

 

There I go. It took about an hour to get it all soldered up. I was trying to be extra nice, and neat. While my soldering skills are markedly better than they were a year ago, practice makes perfect and I am still working towards that goal. Once it is done the big moment, time to slide in the battery. I rummage in the battery drawer and pull out a CR2032 and pop it in. And nothing. 

Really, nothing. Take it out and make sure I have positive facing up, yup. One more try and nothing. I pulled out my multimeter and check the battery 2.1V. Doesn’t that figure and I wait another day as it is again about 1:30am’ish (I work second shift so tend to have late hours in the studio). 

I grab a two pack early the next morning and try it again. NOTHING! Well shit and shoved in it Wilbur I am getting a little annoyed by this time. I pull out my meter again and start checking continuity and don’t find any issues. I put the battery back in and start checking my voltages. All the pins have power and reading at the correct levels. WTH?

I sit down and start doing a little web surfing while keeping a picture of the Pocket Tetris on my screen. What could be wrong? Well it is a funny little story about CAREFULLY checking what pins go where and which pins you have there after staring at one’s problem for a good long while. There was a dope slap and a DOH! involved when I saw it. 

IMG 1064

Now this simple, fun, quickie project will have to wait a little while longer. That was my only spare screen and I don’t have a solder sucker (yet). So while another slow boat makes its way here with new screens, with the CORRECT pinouts, and a solder sucker I have other projects to move onto. New high scores will have to wait for another day. 

Bluetooth Speaker – Update

Bluetooth Speaker Project

We need a bluetooth speaker for the outside by the pool and I have also wanted one to use inside the house as well. This one is 90% complete and since I have two speakers I am sure another one will follow. I still need to find what I am going to use for front and back grills. I may settle for some black material on a frame for the front and some aluminum grill for the back. In the meantime at least it is ready to go!

IMG 9806

My bluetooth speaker

IMG 9665

cutting up the sides

I had a long scrap of wood from another project, so with the power miter saw I made quick work of the sides. 

IMG 9669

With the sides and square inner pieces cut it was time for some gluing. I used a couple of brads to help hold it together while the glue dried. 

IMG 9674

A little sanding to smooth things out. I also had to use a little putty to fill in a couple of small gaps. 

IMG 9711

I used my rotary cutter to make the hole for the speaker. It needed a little help to get the speaker ears to fit in just right. I have no idea what that PVC pipe is up there for, save the fact that I was working on the pool at the time. 

IMG 9731

Here I have things wired up. I didn’t have any barrel power connectors or even screw down terminals, but I didn’t have the parts from an old Apple Airport to get 12V power to the amp/USB board. As for the bluetooth/amp board there is no outstanding reason for picking it. I did some research on them as there are quite a few out there. I need something that would obviously deal with Bluetooth, again all of them were pretty much about the same, but I expected that. This board had the TI TPA3110D2 as the amp chip. I dug up the data sheet on it and it seemed to fit the bill for what I was looking for, a good amp chip and being able to deal with up to 20W for the speaker. 

IMG 9735

With a few brass standoffs, I mounted power plug and the board to the back of the speaker. The parts do face out the back of the speaker. In my thinking it makes it easy to replace anything if it were to burn out or I wanted to replace it. And I didn’t want the magnet to interfere with the board. 

Somewhere in here I stopped taking pictures, oops. In leu of pictures I will give you a quick wrap-up. I stained all of the parts with 2 coats. It didn’t come out as quite as dark as hoped, but it still looks good. Then I mounted the speaker on the front wood insert I made. I connected the wires to it and secured the back panel. 

It works well! It is not audiophile quality, but it has a nice sound all around. The Chinese lady’s voice they used to tell you it is on and connecting still makes me giggle a bit every time I use it.