Sunday, November 23, 2014

Fannator 1000 v2

The Fannator 1000 is being upgraded from an Adafruit Trinket and Sunfounder relay shield spaghetti mess to a custom PCB featuring an ATtiny85 and dual MOSFET's with JST connectors, programming headers.

Before, Trinket insulated with a sandwich bag.
And here's a side by side of the old and new ...
I liked it so much that I made another one for my office at work. It's connected to an enlobal bearing case fan so it's nice and quiet. Since it's a simple timer, it also acts like a Pomodoro timer of sorts.


Sunday, November 16, 2014

Recovering a "bricked" ATtiny85 from bad clock fuse settings

In my endeavor to add some board selections in the "boards.txt" that offer BOD protection, I managed to burn fuses on an ATtiny85 to run it at 128kHz, aka the watchdog oscillator. Bad idea. At this point the ATtiny became unresponsive and the IDE displayed the error below. Arrggh, just bought these. BTW, I'm using an Arduino Nano v3.0 as an ISP for the ATtiny85.


Error after trying to burn the 128kHz boot loader …
avrdude: Yikes!  Invalid device signature.
         Double check connections and try again, or use -F to override         this check.
Here's how I un-bricked them ...
  1. Checked wiring, checked again.
  2. Downloaded an enhanced ArduinoISP sketch from https://github.com/adafruit/ArduinoISP which essentially allows you to fix bad fuse settings.
  3. I renamed it to ArduinoISP2 so I could differentiate it from the original. 
  4. Before you load this on your programmer (nano in my case), you'll want to un-comment out the line "#define LOW_SPEED" which enables all the wonderful un-bricking goodness packed inside. I also had a 10uF cap on the nano's RST pin and GND (for uploading sketches to the ATtiny85) so I pulled this cap out before uploading.
  5. Now you can upload the ArduinoISP2 sketch.
  6. After the upload, I inserted my 10uF cap back on the nano's RST pin.
  7. Next, I selected a known good board selection for the ATtiny85 at 1 MHz and burned the boot loader set the fuses. You may encounter the following error:

         avrdude: stk500_paged_write(): (a) protocol error, expect=0x14, resp=0x00
         avrdude: stk500_cmd(): programmer is out of sync

    Just keep going, the rest is easy.
  8. Now i went to the original ArduinoISP sketch and uploaded that to the nano, so out with the cap again, upload, cap back in.
  9. Now repeated step 7 with the difference being that the ISP is going regular speed. I got the usual error message ...

         avrdude: please define PAGEL and BS2 signals in the configuration file for part ATtiny85
    which just fine with me.
  10. I tested it out with the Blink sketch (led = 4) to verify everything was peachy. Blink blink blink.
Edit - 20150829 - changed "burned the boot loader" to "set the fuses".
Edit - 20150923 - this only worked with Arduino 1.0x.

Monday, November 10, 2014

CadSoft EAGLE + Random tName Formats + OSH Park = A Mess … Fix included

Using different libraries means dealing with varying artwork. In the end, it's easy to end up with a collection of seemingly random artwork. When I submitted my brd file to OSH Park, I saw a mess in the preview. Anyway, I prefer labeling manually for reasons of consistency and clarity.



The layers tNames and bNames is the culprit here. I took the direct approach, deleted those layers and resubmitted. Everything looked fine in EAGLE. Low and behold, no artwork at all. So deleting them is not an option. I ended up renaming the offending layers to x1 and x2 (or name them whatever you'd like). I then created two new (and blank) layers named tNames and bNames. This time OSH Park's render showed no mess, only the text I put down.



The nice part about renaming is that it can be done right before fab and it's not permanent.

Friday, September 19, 2014

NRF24L01+ Module Range



Working with a pair of NRF24L01+ modules, Arduino Nano's and USB battery packs, I slightly tweaked maniacbug's pingpair sketch to give me a little visual feedback, a green blink for successful packet trip and red blink for everything else. The ping module had the red/green LED's and the pong just had a bright, white LED that I could see as I carried the ping module away in my hand. Range results for line of sight were 250m for solid connection (no timeouts) and 325m for a flaky connection (hold it just right). It's not very scientific, but I've repeated it several times.

Monday, September 1, 2014

NRF24L01+ Module Header Mod




So the typical NRF24L01+ module looks something like this with a not-so-handy 2x4 pin configuration and obligatory jumpers.



Using two 90deg headers makes this a little more breadboard friendly. It's not brain surgery, but it eliminates pig tails and a wireless module flopping around. The one downside is the pinout is a little confusing.