The lamp that wasn’t meant to be

Some time ago, I bought a few WS2812B addressable RGB LED modules. I’m still committed to using them in the next Light Show, whenever I get around to designing and building the next one. In the meantime, I wanted to make a simple project to play around a little more with these LEDs.

I decided to make a makeshift lamp. The lamp would be controlled by at Attiny85 board with a few potentiometers to control the intensity of each color.IMG_20150627_201909 After many thought out cuts, I abandoned the project. It became apparent that it would just look too silly and be too large for my limited desk space. Pictured above is the post and the top that would hang out on the top to hold the LED module.

IMG_20150718_131232I still wanted to test the LED modules out with the Attiny85 to see for myself that they can work on the small microcontroller (in comparison to the Atmega328p/Uno). I used the Adafruit Neopixel library and a USBtinyISP to program it. The code wouldn’t upload unless I burned the bootloader to use the internal 8MHz clock instead of the 1MHz clock. Otherwise, it worked great.

I would still like to make a small project with these LED modules, outside of the Light Show project. I need to brainstorm a little more.

Thanks for reading!

A look at a cheap USBtinyISP board

On my most recent revisions of my breakout boards for the Atmega328p and Attiny85, I added a 6-pin ISP header. ISP stands for In System Programming, which, as the name suggests, means that the header is used to program the microcontroller as it sits in a circuit, which is especially handy for boards without a way to plug directly into your computer’s USB port or a board with a surface-mount microcontroller.

I’ve never actually used these headers since I was used to using my Arduino Uno to program the microcontroller for both of my breakout boards. To make sure I could add the 6-pin ISP header to the boards correctly, I read up on it from different sources to understand how to make the connections.

attiny85pinoutisp

On the pinout of the microcontrollers, there are pins labelled SCK, MISO, and MOSI. These are three of the six pins of the 6-pin ISP header. The other three pins on the header are pins we all know well: Reset, Vcc, and Ground. The asterisk on my boards signify the first pin of the ISP header, which should be the MISO pin. The illustration of mine uses the pinout image in the Attiny datasheet where the six pins are underlined. I also drew up a simple diagram of the header pinout.

I received a cheap USBtinyISP board from China which took quite a while to get here. Thankfully it didn’t take much longer to get up and running.
IMG_20150704_125604The board came with a 6-pin ribbon cable and a USB cable. The USB cable is so short that it’s virtually unusable since the cable isn’t long enough to get the board to my desk from my computer. Thankfully, I have a longer cable I can use instead.

The first thing I did was to check the pinout of the cable so I don’t plug it in the wrong way on my boards. The easiest way the figure out the orientation of the header is to find Vcc and Ground with a multimeter, where you should see 5v across. It’s a 50/50 chance… so of course I got it wrong the first time as I saw the voltage reading fluctuate in the mV range.

Once I got the orientation of the connector right, I plugged it into one of my boards. I marked the first pin with a little sticker, as shown in the picture above.

Surprisingly, the Adafruit USBtinyISP drivers works with this board. I opened up Device Manager and updated the drivers with their files. The seller of this board had their own hosted driver files, though some poking around showed it was just the Adafruit drivers anyway.

IMG_20150704_124751First up was my Attiny85 Breakout Board. It’s not meant to fit into these half-sized breadboards but bending the power pins a little bit got it in. (If you bought one of these boards, don’t do this. This is a test unit, after all.)

I was able to upload the blink sketch directly from the Arduino IDE, with the Attiny85 settings and setting the programmer to “USBtinyISP “. The timing of the blink sketch was weird the first time I tried it, which made me realize I must have previously burnt the bootloader to use the 8MHz internal clock instead of the default 1MHz. I decided to try burning the bootloader so it would go back to using the 1Mhz clock. The USBtinyISP was able to do it and the sketch ran perfectly.IMG_20150704_124905Now for the Atmega328p Breakout Board. To upload through the USBtinyISP and the Arduino IDE, I can’t just click Upload like I did with the Attiny85 board. I have to hold shift when I click the Upload button to Upload Using Programmer. This is supposed to upload the sketch to the microcontroller without needing a bootloader. Once I upload a sketch with the USBtinyISP, I can’t upload a sketch if I place it in an Arduino Uno, so I guess that uploading with a programmer erases the bootloader…? To be able to use the microcontroller on an Arduino Uno again, I have to burn the bootloader with the USBtinyISP board. It’s not a big deal, but it’s something I have to remember to do so I don’t get confused why things aren’t working later on.

So with the FTDI and USBtinyISP programming tools at my disposal, I’m very excited to get the next revision of my Atmega328p Breakout Boards as they have headers for both devices. Stay tuned for news on that! Thanks for reading!

NCP1117 Board Load Test (Part 2)

In my last post, I tested my NCP1117 5v voltage regulator board with a couple of power resistors. In those tests, I used a wall plug rated at 9v 1A. Since then, I received a new variable power supply which I used to see how different voltages and currents would affect the regulator board.
IMG_20150704_181821For these tests, I stuck with the 5-ohm resistor. I set up the power supply to 9v and “unlimited” current so that the board would draw whatever it wanted. It drew roughly 890mA, read at both the input and output of the board. (The multimeter is measuring the output current.) Unlike the previous experiments, the regulator was able to stay steady for the three or so minutes I left it going. Even though it was able to stay on, the board becomes too hot to handle with bare hands. The current seemed to hit a ceiling at 890mA. Going any higher than 9.5v would cause the regulator to quickly hit its thermal limit and the current would start dropping rapidly. I suspect the wall power supply is slightly higher than 9v printed on it which is why it did the same in my tests with that.


 

Calculations

To calculate the power dissipation that the regulator is dealing with:

Power (P) = Voltage (V) * Current (I)

P = (9v – 5v) * 0.890A

P = 3.560W

From the datasheet, the thermal resistors junction-to-ambient, RθJA, and junction-to-case, RθJC, is 67°C/W and 6°C/W, respectively. Together, it’s 73°C/W, which can tell us how hot the regulator should get:

73°C/W * 3.560W = 259.88°C

Yeah… It needs a heatsink, though the current design doesn’t really allow for a proper one that screws into the circuit board.


I’ve used a similar board that uses the AMS1117 regulator on many projects that were running 24/7 for months. I noticed that the regulator did get very warm but I wouldn’t really call it alarmingly hot as this board was during these tests. I didn’t have the bench power supply by then and I didn’t do any current measurements (doh!), but I can estimate that none of those projects ever pulled more than 200mA from the regulator board. They’ll still be good for those types of projects where I can’t get an already regulated wall power supply. However, I was also using them for prototyping but, now that I have the variable bench power supply, I won’t be using them for that anymore.

I hope these experiments were interesting to you. Thanks for reading!