<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>nRF24L01+ &#8211; ABNielsen.com</title>
	<atom:link href="https://abnielsen.com/tag/nrf24l01/feed/" rel="self" type="application/rss+xml" />
	<link>https://abnielsen.com</link>
	<description>Anders Braüner Nielsen</description>
	<lastBuildDate>Sun, 07 Oct 2018 07:57:58 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.1</generator>
	<item>
		<title>ATTiny84 USB-capable business card featuring 2.4Ghz wireless and WS2812B&#8217;s</title>
		<link>https://abnielsen.com/2018/10/02/business-card-rf24-ws2812b-attiny84-usb/</link>
					<comments>https://abnielsen.com/2018/10/02/business-card-rf24-ws2812b-attiny84-usb/#comments</comments>
		
		<dc:creator><![CDATA[Anders]]></dc:creator>
		<pubDate>Tue, 02 Oct 2018 14:04:15 +0000</pubDate>
				<category><![CDATA[ATTiny]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Arduino]]></category>
		<category><![CDATA[ATTiny84]]></category>
		<category><![CDATA[nRF24L01+]]></category>
		<category><![CDATA[V-USB]]></category>
		<category><![CDATA[WS2812b]]></category>
		<guid isPermaLink="false">https://abnielsen.com/?p=52</guid>

					<description><![CDATA[This is my business card. It works as a USB-HID device, takes input from a 2.4Ghz transceiver and it also comes with some flashy RGB LED&#8217;s and a prototyping header. [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><a href="https://abnielsen.com/wp-content/uploads/2018/10/20181001_0077.jpg"><img fetchpriority="high" decoding="async" class="alignright wp-image-31 size-large" src="https://abnielsen.com/wp-content/uploads/2018/10/20181001_0077-1024x576.jpg" alt="" width="640" height="360" srcset="https://abnielsen.com/wp-content/uploads/2018/10/20181001_0077-1024x576.jpg 1024w, https://abnielsen.com/wp-content/uploads/2018/10/20181001_0077-300x169.jpg 300w, https://abnielsen.com/wp-content/uploads/2018/10/20181001_0077-768x432.jpg 768w" sizes="(max-width: 640px) 100vw, 640px" /></a></p>
<p>This is my business card. It works as a USB-HID device, takes input from a 2.4Ghz transceiver and it also comes with some flashy RGB LED&#8217;s and a prototyping header. Oh.. And it has my contact information.</p>
<p>Spoiler: This is also on <a href="https://github.com/AndersBNielsen/v-usb-businesscard">Github</a> if you just want to skip to code and PCB files. If you want to know more, read on.</p>
<h3>Why?</h3>
<p>After seeing a couple of PCB business cards on hackaday.com, I knew I had make my own. But how do I make it stand out? What should it do? How expensive can I get away with?</p>
<p>For this little project I decided to squeeze as much as possible out of a cheap ATTiny84. I chose the T84 because it&#8217;s dirt cheap (&lt;1$), I&#8217;ve been through it&#8217;s datasheet more than just a few times, and I wanted to see exactly how much it&#8217;s possible to squeeze into the 8192 bytes available.</p>
<p>Turns out the answer is: A lot!</p>
<p>I have a lot of individually addressable RGB WS2812B&#8217;s LED&#8217;s &#8211; aka NeoPixels &#8211; spread around my home(and about 850 left on a reel) that I&#8217;ve been controlling with prototypes made up of ATMega32u4&#8217;s and ATMega328p&#8217;s with 2.4Ghz nRF24L01+ tranceivers and a Raspberry Pi with the same tranceiver so I can control it from my phone. To justify spending more than a few cents per business card you need it to actually do something useful. Controlling RGB-LED&#8217;s was a start.</p>
<p>Attiny84 √</p>
<p>WS2812B&#8217;s √</p>
<p>nRF24L01+ √ (though i suspect pretty much everything out of China is actually SI24r1)</p>
<p>&nbsp;</p>
<p><a href="https://abnielsen.com/wp-content/uploads/2018/10/20181001_0085.jpg"><img decoding="async" class="alignleft size-large wp-image-30" src="https://abnielsen.com/wp-content/uploads/2018/10/20181001_0085-1024x576.jpg" alt="" width="640" height="360" srcset="https://abnielsen.com/wp-content/uploads/2018/10/20181001_0085-1024x576.jpg 1024w, https://abnielsen.com/wp-content/uploads/2018/10/20181001_0085-300x169.jpg 300w, https://abnielsen.com/wp-content/uploads/2018/10/20181001_0085-768x432.jpg 768w" sizes="(max-width: 640px) 100vw, 640px" /></a>I also added a 20 pin header that makes it easy to use this board for prototyping with the 14pin ATTiny&#8217;s. Easy access to every pin(and a few extra power pins) means you can easily solder sensors etc. directly onto the pins &#8211; or add male header pins and push it into a breadboard.</p>
<h3>How about USB?</h3>
<p>One of my annoyances when designing prototypes has always been that it&#8217;s really hard to make anything USB-capable(not to speak of compliant) for less than 5$. It is possible though, if you don&#8217;t follow the usual path. OBDev&#8217;s <a href="https://www.obdev.at/products/vusb/index.html">V-USB</a> (with a little bit of help from Adafruit&#8217;s TrinketHidCombo library) made it possible to squeeze some  USB capability into this project without adding much more extra hardware than two zener&#8217;s and three resistors.</p>
<h2>Software</h2>
<p>I have to be honest. I like the Arduino IDE for prototyping. Slapping a couple of libraries together doesn&#8217;t usually result in the most efficient code but when you want to put something together that showcases a lot of features fast &#8211; as in: a few hours &#8211; the vast amount of libraries for interfacing with every popular IC makes it hard no to take the easy route.<br />
Everything didn&#8217;t work straight out of the box though. The RF24 library needed pin definitions changed for the ATTiny84(since the USI&#8217;s DO/DI are reversed compared to MISO and MOSI and this hasn&#8217;t been fixed in the current version) and Adafruit&#8217;s TrinketHidCombo library also needed some tweaking to work with the T84. I also went with the Adafruit NeoPixel library  for controlling the WS2812b&#8217;s, even though it&#8217;s relatively huge for a tiny chip, but somehow I managed to fit the basic functionality into the 8k of flash anyway. It does however, use every single byte available and the debug functions won&#8217;t fit unless something else is disabled.</p>
<p>I thought about using the smaller <a href="https://github.com/sonyhome/FAB_LED">FAB_LED</a> library for driving the LED&#8217;s to leave more space for HID-stuff, but it doesn&#8217;t really play nice with the 10ms USB-polling when controlling more than one LED at a time so I went the easy way with the NeoPixel library and limited the HID capability to just pressing media keys (start/pause, volume up, volume down and stop). I pride myself in making software that&#8217;s good enough for doing the job without too much &#8220;gold plating&#8221;.</p>
<p>So for now, all it does is work as a 2.4Ghz USB-dongle for media keys along with controlling flashy flashy LED&#8217;s. Pretty good for 5$, gold plated board included, though.</p>
<h3>PCB Design</h3>
<p>So h<a href="https://abnielsen.com/wp-content/uploads/2018/10/Skærmbillede-2018-10-06-kl.-12.55.03.png"><img decoding="async" class="alignleft size-large wp-image-79" src="https://abnielsen.com/wp-content/uploads/2018/10/Skærmbillede-2018-10-06-kl.-12.55.03-1024x558.png" alt="" width="640" height="349" srcset="https://abnielsen.com/wp-content/uploads/2018/10/Skærmbillede-2018-10-06-kl.-12.55.03-1024x558.png 1024w, https://abnielsen.com/wp-content/uploads/2018/10/Skærmbillede-2018-10-06-kl.-12.55.03-300x163.png 300w, https://abnielsen.com/wp-content/uploads/2018/10/Skærmbillede-2018-10-06-kl.-12.55.03-768x418.png 768w" sizes="(max-width: 640px) 100vw, 640px" /></a>ow do you make a PCB business card look cool? The easy way to make it would&#8217;ve been some silkscreen text with contact information etc. but to me the typically low resolution silkscreen text wasn&#8217;t good enough so I went with making a big ground plane and putting the text and logo on the solder mask layer. The font in KiCAD isn&#8217;t my favourite either, so I went with making a footprint of the text from a bitmap instead.<br />
For the surface plating I could&#8217;ve gone with the cheaper options but I really believe the immersion gold(ENIG) makes too much of a difference to skip.<br />
I chose 0.8mm board thickness because it&#8217;s enough not to break unintentionally and also fits in a standard credit card slot of a wallet &#8211; without components that is.</p>
<p>&nbsp;</p>
<h3>How do you program it?</h3>
<p>At first I thought I would just skip the programming interface and use a test probe clip(<a href="https://www.pomonaelectronics.com/products/test-clips/soic-clip-14-pin">like this one from Pomona</a>) to program it.</p>
<p><img loading="lazy" decoding="async" class="alignright wp-image-8 size-large" src="https://abnielsen.com/wp-content/uploads/2018/10/20181001_0146-576x1024.jpg" alt="" width="576" height="1024" srcset="https://abnielsen.com/wp-content/uploads/2018/10/20181001_0146-576x1024.jpg 576w, https://abnielsen.com/wp-content/uploads/2018/10/20181001_0146-169x300.jpg 169w, https://abnielsen.com/wp-content/uploads/2018/10/20181001_0146-768x1366.jpg 768w, https://abnielsen.com/wp-content/uploads/2018/10/20181001_0146.jpg 1129w" sizes="auto, (max-width: 576px) 100vw, 576px" /></p>
<p>But since I have a feeling I will be using this as a protoboard many times, I decided to find a better solution. Of course I could just hold down jumper wires to the 20-pin header or solder them on &#8211; but in my opinion that would either be a hassle for fast prototyping or ruin the look.<br />
Instead I decided to experiment a little bit with programming pads(J2 if you take a look at the schematic), since I already had some pogo pins on the way from China when I ordered this. I didn&#8217;t have exact specs for how big the pads needed to be, so I went with a footprint meant for an SMD male header. When I got the pogo pins I soldered them onto female dupont wire terminators and then onto a perfboard. You can see the final result on the right, together with my overused USBasp. This is a solution I can really recommend, but the next time I make an interface like this I will most likely just use tiny pads 2.54mm(.1&#8243; standard header) apart and as small as possible. With the thickness of the solder mask, the pins slide right into place. The only downside is you need to apply a tiny bit of pressure while programming the device, but I prefer this to connecting jumper wires any day.</p>
<p>If you want to read more about this subject, take a look at my post about <a href="https://abnielsen.com/2018/10/02/programming-an-avr-without-taking-up-board-space/">programming an AVR without taking up board space</a>.</p>
<p>&nbsp;</p>
<h3>Want to make your own PCB Business card?</h3>
<p>The point of a business card is to share it with other people, so I&#8217;ve uploaded this whole project to <a href="https://github.com/AndersBNielsen/v-usb-businesscard">Github</a>. Feel free to fork it and put your own spin on it.</p>
<p>Leave a comment if you have any questions, suggestions etc. Any feedback &#8211; good or bad &#8211; is very welcome <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<p>&nbsp;</p>
<p><a href="https://abnielsen.com/wp-content/uploads/2018/10/20181001_0087.jpg"><img loading="lazy" decoding="async" class="aligncenter size-large wp-image-29" src="https://abnielsen.com/wp-content/uploads/2018/10/20181001_0087-1024x576.jpg" alt="" width="640" height="360" srcset="https://abnielsen.com/wp-content/uploads/2018/10/20181001_0087-1024x576.jpg 1024w, https://abnielsen.com/wp-content/uploads/2018/10/20181001_0087-300x169.jpg 300w, https://abnielsen.com/wp-content/uploads/2018/10/20181001_0087-768x432.jpg 768w" sizes="auto, (max-width: 640px) 100vw, 640px" /></a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://abnielsen.com/2018/10/02/business-card-rf24-ws2812b-attiny84-usb/feed/</wfw:commentRss>
			<slash:comments>4</slash:comments>
		
		
			</item>
	</channel>
</rss>
