<?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>Random notes &#38; other stuff... &#187; electronics</title>
	<atom:link href="http://leucos.lstilde.org/wp/category/electronics/feed/" rel="self" type="application/rss+xml" />
	<link>http://leucos.lstilde.org/wp</link>
	<description>...about Linux, electronics, digital photography, whatever...</description>
	<lastBuildDate>Wed, 16 Dec 2009 00:29:27 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Conditionnement de signal piezo</title>
		<link>http://leucos.lstilde.org/wp/2009/12/conditionnement-de-signal-piezo/</link>
		<comments>http://leucos.lstilde.org/wp/2009/12/conditionnement-de-signal-piezo/#comments</comments>
		<pubDate>Wed, 16 Dec 2009 00:24:37 +0000</pubDate>
		<dc:creator>leucos</dc:creator>
				<category><![CDATA[electronics]]></category>
		<category><![CDATA[french]]></category>
		<category><![CDATA[piezo]]></category>
		<category><![CDATA[sensor]]></category>
		<category><![CDATA[transducer]]></category>

		<guid isPermaLink="false">http://leucos.lstilde.org/wp/?p=542</guid>
		<description><![CDATA[(an english translation for this article is available here)

Les transducteurs Piezo sont très courants, ne coutent rien, et peuvent se révéler d&#8217;excellent capteurs : son, choc, vibrations; tant que quelque chose &#171;&#160;bouge&#160;&#187; suffisamment ou fait du bruit, un capteur piézo peut être intéressant.
En revanche, le signal généré par ces petites bêtes n&#8217;est pas très amical [...]]]></description>
			<content:encoded><![CDATA[<p><em>(an english translation for this article is available <a href="http://leucos.lstilde.org/wp/2009/06/piezo-transducer-signal-conditioning/">here</a>)<br />
</em></p>
<p>Les transducteurs Piezo sont très courants, ne coutent rien, et peuvent se révéler d&#8217;excellent capteurs : son, choc, vibrations; tant que quelque chose &laquo;&nbsp;bouge&nbsp;&raquo; suffisamment ou fait du bruit, un capteur piézo peut être intéressant.</p>
<p>En revanche, le signal généré par ces petites bêtes n&#8217;est pas très amical pour l&#8217;amateur d&#8217;électronique digitale : en gros, c&#8217;est une sinusoïde qui s&#8217;aplatit avec le temps. Par ailleurs, le signal se promène souvent dans les quartiers mal fréquentés des tensions négatives, ce qui n&#8217;est pas très agréable pour la plupart des chips et µcontrolleurs utilisés en électronique digitale. Par exemple, la datasheet de l&#8217;ATMega 168 (et c&#8217;est pareil pour la plupart des µ 8 bits d&#8217;atmel) indique que la tension appliquée à n&#8217;importe quelle patte doit se trouver entre -0.5V et VCC+0.5V. Les transducteurs piézo peuvent allègrement dépasser ces limites.</p>
<p>Dans la capture ci-dessous, la tension lue aux bornes du piézo descend jusqu&#8217;à -52V et monte jusqu&#8217;à 9.2V. Ca fait plus de 60V crête à crête. Si on ne fait rien, le µ peut rapidement en faire une jaunisse&#8230; :</p>
<div id="attachment_236" class="wp-caption aligncenter" style="width: 330px"><a href="http://leucos.lstilde.org/wp/wp-content/uploads/2009/05/newfile_01.png"><img class="size-full wp-image-236" title="PiezoRaw1" src="http://leucos.lstilde.org/wp/wp-content/uploads/2009/05/newfile_01.png" alt="Raw signal from piezo (2)" width="320" height="240" /></a><p class="wp-caption-text">Signal brut du piezo</p></div>
<p>Dans la capture suivante, le signal descend d&#8217;abord à -20V, puis s&#8217;envole au dessus de 35V. Presque 60Vpp (crête à crête) ici aussi :</p>
<div id="attachment_237" class="wp-caption aligncenter" style="width: 330px"><a href="http://leucos.lstilde.org/wp/wp-content/uploads/2009/05/newfile_09.png"><img class="size-full wp-image-237" title="PiezoRaw1" src="http://leucos.lstilde.org/wp/wp-content/uploads/2009/05/newfile_09.png" alt="Raw signal from piezo" width="320" height="240" /></a><p class="wp-caption-text">Signal brut du piezo (bis)</p></div>
<p>Ce ne sont que des exemples. Je n&#8217;ai pas torturé ou frappé au marteau sur le piezo. Tapotez le juste avec un ongle et vous vous retrouverez en général avec des valeurs crête à crête énormes. L&#8217;autre problème c&#8217;est que ces valeurs sont imprévisible (les piézos le sont, mais pas la manière dont on les brutalise) : ça peut commencer par monter, puis descendre, puis monter, qui sait&#8230;</p>
<p>Un petit coup de zoom montre l&#8217;effet &laquo;&nbsp;sinusoïde qui s&#8217;aplatit&nbsp;&raquo; que l&#8217;on observe en général après les plus gros pics de tension :</p>
<div id="attachment_243" class="wp-caption aligncenter" style="width: 330px"><img class="size-full wp-image-243" title="Piezo signal close up" src="http://leucos.lstilde.org/wp/wp-content/uploads/2009/05/newfile_04.png" alt="Piezo signal close up" width="320" height="240" /><p class="wp-caption-text">Agrandissement du signal piezo</p></div>
<p>Le conditionnement de signal est donc une étape obligatoire si l&#8217;on travaille en digital avec des piézos.</p>
<p>Récapitulons ce que nous devons faire au signal pour le dompter :</p>
<ol>
<li>rendre le signal positif : la plupart du temps, les piezos sont lus par des CAN (convertisseurs analogiques/numériques), on veut donc des tensions positives</li>
<li>restreindre son amplitude entre 0 et VCC, pour éviter que la tension n&#8217;affiche des valeurs effrayantes pour des µcontrolleurs et des CAN.</li>
<li>modifier la forme du signal pour éviter les bosses, et le rendre plus propre et prévisible</li>
</ol>
<p>Tout cela n&#8217;est pas très compliqué à obtenir en fait. On va y aller en trois étapes, traitant respectivement les trois points ci-dessus :</p>
<ol>
<li>ajouter un redresseur simple alternance, pour garder la partie positive du signal</li>
<li>ajout d&#8217;une diode zener pour éviter que les valeurs de signal soient supérieure à la tension d&#8217;avalanche de la zener</li>
<li>ajouter un couple RC afin de filtrer les vaguelettes du signal</li>
</ol>
<p><strong>Redresseur simple alternance</strong></p>
<p>En premier lieu, nous voulons rectifier le signal piezo, c&#8217;est à dire le rendre toujours positif. Pour cela, nous allons utiliser des diodes Schottky. Les diodes Schottky sont plus intéressantes car elles ont un seuil de tension directe (Vf) très bas (par comparaison avec des diodes standard), aux alentours de 0.3V.</p>
<div id="attachment_300" class="wp-caption alignleft" style="width: 160px"><a href="http://leucos.lstilde.org/wp/wp-content/uploads/2009/05/piezo_full_bridge.png"><img class="size-thumbnail wp-image-300" title="piezo_full_bridge" src="http://leucos.lstilde.org/wp/wp-content/uploads/2009/05/piezo_full_bridge-150x150.png" alt="Piezo signal as seen after a full-wave rectifier" width="150" height="150" /></a><p class="wp-caption-text">Signal du piezo vu derrière un pont redresseur complet</p></div>
<p>On peut se demander : pourquoi ne pas utiliser un pont redresseur complet à base de Schottky et rendre le signal tout entier positif (comme si l&#8217;on prenait la valeur absolue du signal) au lieu d&#8217;ignorer les tensions négatives ?</p>
<p>Regardons les premières captures de signal brut à l&#8217;oscillo. Lorsque le signal change de signe, il le fait plutôt violemment, et son amplitude peut même être plus importante après le croisement du zéro qu&#8217;avant. Maintenant essayons d&#8217;appliquer la fonction mathématique &#8216;abs&#8217; sur la courbe. On va se retrouver avec une courbe erratique : faible amplitude, plus haute, puis faible, etc&#8230; Même avec un filtrage poussé, ça sera difficile d&#8217;arriver à quelque chose de propre, et on aura toujours une coube sautillante, moins sauve que l&#8217;originale et complètement positive certes, ais difficilement exploitable.</p>
<p>L&#8217;idée consiste donc à sacrifier la partie négative de la courbe pour obtenir un résultat plus lisse (le bug Agilent est offert gracieusement).</p>
<div id="attachment_308" class="wp-caption alignleft" style="width: 160px"><a href="http://leucos.lstilde.org/wp/wp-content/uploads/2009/05/piezo_no_2nd_schottky2.png"><img class="size-thumbnail wp-image-308" title="PiezoNo2ndSchottky" src="http://leucos.lstilde.org/wp/wp-content/uploads/2009/05/piezo_no_2nd_schottky2-150x150.png" alt="Piezo signal rectified by only one Schottky diode" width="150" height="150" /></a><p class="wp-caption-text">Signal du piezo signal rectifié seulement par une diode Schottky</p></div>
<p>En fait, on va faire un peu plus qu&#8217;un redresseur simple alternance. Si on ne met qu&#8217;une diode Schottky en série on se retrouvera avec une courbe ressemblant à elle de gauche. Nous pouvons voir qu&#8217;il reste une partie non négligeable du signal sous 0V, et dans notre circuit, ce n&#8217;est pas censé se produire.<br />
Même dans l&#8217;éventualité ou l&#8217;ADC s&#8217;en accommoderait, il ne ferait pas vraiment d&#8217;étincelles en mesurant une tension négative.</p>
<p>Il y a surement une bonne raison pour que le signal se comporte de la sorte, mais je ne la connais pas. N&#8217;hésitez pas à commenter si vous avez la réponse.</p>
<p>On doit donc se débarrasser de ce reliquat négatif et pour cela, nous allons utiliser une deuxième Schottky entre la masse et le signal. On ne garde que le signal positif, ca sera nettement plus simple comme ça.</p>
<div id="attachment_311" class="wp-caption alignleft" style="width: 160px"><a href="http://leucos.lstilde.org/wp/wp-content/uploads/2009/05/piezo_rectified.png"><img class="size-thumbnail wp-image-311" title="PiezoRecified" src="http://leucos.lstilde.org/wp/wp-content/uploads/2009/05/piezo_rectified-150x150.png" alt="Piezo signal rectified by two Schottky" width="150" height="150" /></a><p class="wp-caption-text">Signal piezo rectifié par deux diodes Schottky</p></div>
<p>Notre signal rectifié par les deux Schottky ressemble à la courbe de gauche (la courbe à éét décalée vers le bas pour des raisons esthétiques). On a encore quelques tensions négatives qui apparaissent, mais c&#8217;est presque négligeable maintenant. On peut se demander si ces -400mV ont un rapport avec le Vf de la diode.</p>
<p>Même si l&#8217;échelle est différente, les vaguelettes semblent avoir disparues. C&#8217;est peut être du à la capacitance de la Schottky (14pF), qui, même si elle est faible, peut impacter les vaguelettes haute fréquence. Je n&#8217;ai pas eu le temps de vérifier.</p>
<p>Maintenant nous devons limiter la tension maximale dans notre circuit, histoire de ne pas martyriser notre CAN.<br />
<strong>Diode Zener<br />
</strong></p>
<p>Comme vu plus haut, l&#8217;amplitude en tension est importante et on peut rapidement atteindre des valeurs inadaptées pour de l&#8217;électronique digitale. On doit donc dompter cette tension générée par le piézo. Les diodes Zener peuvent le faire : elles peuvent limiter la tension dans un circuit à une valeur fixe : quand la tension dans le circuit est supérieure à la tension d&#8217;avalanche de la Zener, elle devient passante, aidant ainsi à maintenant la tension sous ce seuil.</p>
<div id="attachment_327" class="wp-caption alignleft" style="width: 160px"><a href="http://leucos.lstilde.org/wp/wp-content/uploads/2009/05/piezo_zener.png"><img class="size-thumbnail wp-image-327" title="PiezoRectifiedAndZener" src="http://leucos.lstilde.org/wp/wp-content/uploads/2009/05/piezo_zener-150x150.png" alt="Piezo signal, after Schottky rectifiers and Zener" width="150" height="150" /></a><p class="wp-caption-text">Signal du piezo signal, après les redresseurs Schottky et la  Zener</p></div>
<p>En général, on doit ajouter une résistance en série avec la Zener afin de limiter le courant traversant la diode. Mais avec un piezo, ce n&#8217;est pas nécessaire, dans la mesure ou les courants en jeu sont très faibles.</p>
<p>Après avoir ajouté notre Zener de 5.1v dans le circuit, la tension le sur le piézo ressemble à la capture de gauche.</p>
<p>Vous pouvez torturer le piezo autant que vous voulez, vous ne pourrez pas dépasser le tension d&#8217;avalanche de la Zener.</p>
<p>Si l&#8217;on en reste là, on aura pas mal de difficulté à savoir si le pizeo a été actionné une ou plusieurs fois. Nous allons devoir filtrer les pics afin d&#8217;obtenir une courbe plus docile.</p>
<p><strong>Filtrage du signal</strong></p>
<p>Ce signal peut être filtré par une cellule RC. Nous avons juste besoin de savoir combien de temps nous voulons voir la courbe durer afin d&#8217;ajuster les valeurs de R et de C. Pour mon application (batterie électronique), je voulais que le signal s&#8217;estompe en 10ms maximum. Comme l&#8217;on sait que le voltage descend à 10% de sa valeur initiale après <span style="color: red">Error:</span> http://leucos.lstilde.org/wp/wp-content/plugins/wpmathpub/phpmathpublisher/img/ must have write access <a href="http://wordpress.org/extend/plugins/wpmathpub/faq/" title="use 'chmod 755 img' to attempt to manually fix this problem on your server">Read the official wpmathpub plugin FAQ for more details</a>, on peut trouver le bon condensateur en fonction de la résistance ou vice-vesa.</p>
<p>Imaginons que nous utilisons une résistance de 1MΩ, on devra utiliser un condensateur d&#8217;approximativement <span style="color: red">Error:</span> http://leucos.lstilde.org/wp/wp-content/plugins/wpmathpub/phpmathpublisher/img/ must have write access <a href="http://wordpress.org/extend/plugins/wpmathpub/faq/" title="use 'chmod 755 img' to attempt to manually fix this problem on your server">Read the official wpmathpub plugin FAQ for more details</a>.</p>
<p style="text-align: left;">Au final, on se retrouve avec ce circuit plutôt simple :<a href="http://leucos.lstilde.org/wp/wp-content/uploads/2009/05/piezo_circuit.png"><img class="size-full wp-image-403 aligncenter" title="PiezoFinalCircuit" src="http://leucos.lstilde.org/wp/wp-content/uploads/2009/05/piezo_circuit.png" alt="PiezoFinalCircuit" width="504" height="242" /></a></p>
<p style="text-align: left;">Et avec cette ravissante courbe :</p>
<div id="attachment_248" class="wp-caption aligncenter" style="width: 330px"><img class="size-full wp-image-248" title="Resultant signal" src="http://leucos.lstilde.org/wp/wp-content/uploads/2009/05/newfile_00.png" alt="Finaly, a clean, ADC friendly signal" width="320" height="240" /><p class="wp-caption-text">Enfin, un signal propre, agréable en bouche pour le convertisseur analogique/digital</p></div>
<p>J&#8217;espère que ce petit article vous aura aidé à dompter ces petite bêtes sauvages que sont les piézos. Attention toutefois, les piézos sont tous différents, et la taille compte. Alors expérimentez sur ces bases avant de graver en me croyant sur parole.</p>
]]></content:encoded>
			<wfw:commentRss>http://leucos.lstilde.org/wp/2009/12/conditionnement-de-signal-piezo/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Piezo transducer signal conditioning</title>
		<link>http://leucos.lstilde.org/wp/2009/06/piezo-transducer-signal-conditioning/</link>
		<comments>http://leucos.lstilde.org/wp/2009/06/piezo-transducer-signal-conditioning/#comments</comments>
		<pubDate>Sat, 06 Jun 2009 19:31:45 +0000</pubDate>
		<dc:creator>leucos</dc:creator>
				<category><![CDATA[electronics]]></category>
		<category><![CDATA[piezo]]></category>
		<category><![CDATA[sensor]]></category>
		<category><![CDATA[transducer]]></category>

		<guid isPermaLink="false">http://leucos.lstilde.org/wp/?p=229</guid>
		<description><![CDATA[Piezo signal conditioning is a must for piezo discs to get a smooth shape, and filter out spikes. A simple, efficient and cheap way to get nice signal from one of those ubiquitous piezo discs is presented here.]]></description>
			<content:encoded><![CDATA[<p>Piezo transducer are very common, very cheap, and can be very useful as sensors : sound, knock, shock, whenever it &laquo;&nbsp;moves&nbsp;&raquo; or &laquo;&nbsp;makes noise&nbsp;&raquo;, a piezo sensor can help.</p>
<p>However, the signal from those things is very unpleasant for the digital hacker : it&#8217;s roughly a sinewave that dampens over time. Also, the signal often goes negative which is pretty bad for mots digital chips out there. The ATmega168 (and most of the atmel 8 bit microcontrollers), for instance, indicates that voltage on any pin must be between -0.5V to VCC+0.5V. Piezo transducer easily go far beyond those bounds.</p>
<p>In the capture below, voltage from the piezo goes a down as -52V and goes up to 9.2V. This is more than 60V peak to peak. If you don&#8217;t do anything, your poor microcontroller might get sick rather quicly :</p>
<div id="attachment_236" class="wp-caption aligncenter" style="width: 330px"><a href="http://leucos.lstilde.org/wp/wp-content/uploads/2009/05/newfile_01.png"><img class="size-full wp-image-236" title="PiezoRaw1" src="http://leucos.lstilde.org/wp/wp-content/uploads/2009/05/newfile_01.png" alt="Raw signal from piezo (2)" width="320" height="240" /></a><p class="wp-caption-text">Raw signal from piezo</p></div>
<p>In this capture, the signal first drops to -20V, and then flies up to over 35V. Almost 60Vpp here too.</p>
<div id="attachment_237" class="wp-caption aligncenter" style="width: 330px"><a href="http://leucos.lstilde.org/wp/wp-content/uploads/2009/05/newfile_09.png"><img class="size-full wp-image-237" title="PiezoRaw1" src="http://leucos.lstilde.org/wp/wp-content/uploads/2009/05/newfile_09.png" alt="Raw signal from piezo" width="320" height="240" /></a><p class="wp-caption-text">Raw signal from piezo (bis)</p></div>
<p>These are just examples, I didn&#8217;t tweak the piezo or smashed it with a hammer : just a hit with a fingernail, and you almost always end up having huge Vpp values. Also, the behaviour is not predictable (well piezos are, but the way we smack it isn&#8217;t), so it might go up first, then down, then up, who knows&#8230;</p>
<p>A close up shows the &laquo;&nbsp;dampening sine-like signal&nbsp;&raquo; that occurs after the first big spikes :</p>
<div id="attachment_243" class="wp-caption aligncenter" style="width: 330px"><img class="size-full wp-image-243" title="Piezo signal close up" src="http://leucos.lstilde.org/wp/wp-content/uploads/2009/05/newfile_04.png" alt="Piezo signal close up" width="320" height="240" /><p class="wp-caption-text">Piezo signal close up</p></div>
<p>So signal conditioning is a <em>must</em> with those pesky animals if you&#8217;re doing digital.</p>
<p>Let&#8217;s recap what has to be done :</p>
<ol>
<li>make that signal all positive :  most of the time, piezos signals are read by ADC, so we want positive voltages</li>
<li>restrict signal bounds to 0 &#8211; VCC so voltage doesn&#8217;t climb to scary values (scary at least for microcontrollers and ADCs),</li>
<li>shape the signal so it doesn&#8217;t make bumps and stays clean and predictable</li>
</ol>
<p>All these requirements are surprisingly easy to achieve. We will get to this goal in three steps, each spect taking care of one item above. Respectively :</p>
<ol>
<li>add a half-wave rectifier, in order to keep positive part of the waves</li>
<li>add a zener diode, so signal doesn&#8217;t climb over zener&#8217;s breakdown voltage</li>
<li>add a RC pair so ripples get filtered</li>
</ol>
<p><strong>Half bridge rectifier</strong></p>
<p>First, we want to rectify the piezo signal, i.e. make it all positive. We&#8217;ll use Schottky diodes for that. Schottky are more interesting since they have a pretty low (compared to standard rectifier diodes) forward voltage drop (Vf), around 0.3V.</p>
<div id="attachment_300" class="wp-caption alignleft" style="width: 160px"><a href="http://leucos.lstilde.org/wp/wp-content/uploads/2009/05/piezo_full_bridge.png"><img class="size-thumbnail wp-image-300" title="piezo_full_bridge" src="http://leucos.lstilde.org/wp/wp-content/uploads/2009/05/piezo_full_bridge-150x150.png" alt="Piezo signal as seen after a full-wave rectifier" width="150" height="150" /></a><p class="wp-caption-text">Piezo signal as seen after a full-wave rectifier</p></div>
<p>You might ask : why not use a complete Schottky-based bridge rectifier, and make the whole signal positive, instead of filtering negative voltages ?</p>
<p>Well, look back at the first scope shots of raw piezo signals. When signal changes sign, it makes it rather violently, and can even be higher on the new side than it was on the previous side. Now try to make the math abs() operation on the shape, mirroring the negative part of the shape on the other side of the time axis. You&#8217;ll end-up with an erratic plot : low, then high, then low. This means that, even with some filtering, you wont end-up with clean shape, but with a jittering thing that will look like the first signal, but all positive and less wild. This is not what we want, so we are sacrificing the negative part of the signal to get something nicer (the fine Agilent firmware bug is provided free of charge <img src='http://leucos.lstilde.org/wp/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
<div id="attachment_308" class="wp-caption alignleft" style="width: 160px"><a href="http://leucos.lstilde.org/wp/wp-content/uploads/2009/05/piezo_no_2nd_schottky2.png"><img class="size-thumbnail wp-image-308" title="PiezoNo2ndSchottky" src="http://leucos.lstilde.org/wp/wp-content/uploads/2009/05/piezo_no_2nd_schottky2-150x150.png" alt="Piezo signal rectified by only one Schottky diode" width="150" height="150" /></a><p class="wp-caption-text">Piezo signal rectified by only one Schottky diode</p></div>
<p>In fact, well do a bit more than a half wave rectifier. If we just put a Schottky diode in series with the positive we&#8217;ll end up with the kind of signal shape shown on the left. We can see there is a fair amount of signal that is still below 0v, and in our circuit, we&#8217;re not supposed to have negative voltages. Even if the ADC can stand it, it probably won&#8217;t do any interesting measures with a negative signal.</p>
<p>There is probably a good reason for this to happen, but I don&#8217;t have a clue right now. If you do, please leave a comment.</p>
<p>So we have to get rid of this negative leftover, by adding a second Schottky diode, between ground and signal lines. We&#8217;ll just keep the positive signal, but it will be much easier to filter this way.</p>
<div id="attachment_311" class="wp-caption alignleft" style="width: 160px"><a href="http://leucos.lstilde.org/wp/wp-content/uploads/2009/05/piezo_rectified.png"><img class="size-thumbnail wp-image-311" title="PiezoRecified" src="http://leucos.lstilde.org/wp/wp-content/uploads/2009/05/piezo_rectified-150x150.png" alt="Piezo signal rectified by two Schottky" width="150" height="150" /></a><p class="wp-caption-text">Piezo signal rectified by two Schottky</p></div>
<p>Our piezo signal rectified by two Schottky looks like this (the wavefom has been moved to the bottom of the screen for cosmetic reasons). We still have negative voltable building up, but it&#8217;s pretty negligible now. I wonder if that -400mV is linked to the diode&#8217;s forward voltage.</p>
<p>Althought the scale isn&#8217;t the same, the small ripples seem to have disappeared. This might be due to the Schottky diode capacitance (14pF), which, while low, could impact the small ripples with higher frequency. I didn&#8217;t have time to check that though.</p>
<p>Now, we need to cap the maximum voltage in circuit, so we don&#8217;t fry our ADC.<br />
<strong>Zener diode</strong></p>
<p>As seen above, voltage range is pretty high and can climb quickly to unappropriate values for digital purposes. So wee need to tame the voltage created by the piezo. Zeners have this ability, and can limit voltage to a fixed value. Whenever voltage is higher than the Zener&#8217;s rating, the Zeners lets current flow thru and as a side effect, help maintain voltage to a fixed value.</p>
<div id="attachment_327" class="wp-caption alignleft" style="width: 160px"><a href="http://leucos.lstilde.org/wp/wp-content/uploads/2009/05/piezo_zener.png"><img class="size-thumbnail wp-image-327" title="PiezoRectifiedAndZener" src="http://leucos.lstilde.org/wp/wp-content/uploads/2009/05/piezo_zener-150x150.png" alt="Piezo signal, after Schottky rectifiers and Zener" width="150" height="150" /></a><p class="wp-caption-text">Piezo signal, after Schottky rectifiers and Zener</p></div>
<p>We usually have to add a resistor between the Zener and ground, so voltage builds up around it and current is limited thru the Zener. But this is not necessary with piezo, since involved currents are very very low.</p>
<p>After we add a 5.1v Zener in the circuit, the voltage read from a piezo looks like this.</p>
<p>You can smash the piezo as hard as you want, you&#8217;ll never exceed the Zener&#8217;s rated voltage.</p>
<p>If we just use this shape as is, we&#8217;ll have a hard time trying to guess if the piezo has been smashed or not. We have to filter those spikes to get a smoother shape.</p>
<p><strong>Filtering the signal</strong></p>
<p>This signal can be filtered by using a RC cell. Whe just need to know how long we want the shape to last. For my application (drum trigger), I want the signal to fade out in 10ms maximum. Since we know that the voltage drops to 10% of the initial voltage after <span style="color: red">Error:</span> http://leucos.lstilde.org/wp/wp-content/plugins/wpmathpub/phpmathpublisher/img/ must have write access <a href="http://wordpress.org/extend/plugins/wpmathpub/faq/" title="use 'chmod 755 img' to attempt to manually fix this problem on your server">Read the official wpmathpub plugin FAQ for more details</a>, we can find the right resistor knowing the capacitor value, and vice-versa.</p>
<p>Let&#8217;s say we use a 1MΩ resistor, we&#8217;ll have to use a<span style="color: red">Error:</span> http://leucos.lstilde.org/wp/wp-content/plugins/wpmathpub/phpmathpublisher/img/ must have write access <a href="http://wordpress.org/extend/plugins/wpmathpub/faq/" title="use 'chmod 755 img' to attempt to manually fix this problem on your server">Read the official wpmathpub plugin FAQ for more details</a> capacitor.</p>
<p style="text-align: left;">So we end up with this simple little circuit :<a href="http://leucos.lstilde.org/wp/wp-content/uploads/2009/05/piezo_circuit.png"><img class="size-full wp-image-403 aligncenter" title="PiezoFinalCircuit" src="http://leucos.lstilde.org/wp/wp-content/uploads/2009/05/piezo_circuit.png" alt="PiezoFinalCircuit" width="504" height="242" /></a></p>
<p style="text-align: left;">And get this nice little shape :</p>
<div id="attachment_248" class="wp-caption aligncenter" style="width: 330px"><img class="size-full wp-image-248" title="Resultant signal" src="http://leucos.lstilde.org/wp/wp-content/uploads/2009/05/newfile_00.png" alt="Finaly, a clean, ADC friendly signal" width="320" height="240" /><p class="wp-caption-text">Finaly, a clean, ADC friendly signal</p></div>
<p>Hope this can help you using those pesky beasts. Be warned that piezo are all differents, and that size matters&#8230; So experiment with that before engraving the above stuff in copper.</p>
]]></content:encoded>
			<wfw:commentRss>http://leucos.lstilde.org/wp/2009/06/piezo-transducer-signal-conditioning/feed/</wfw:commentRss>
		<slash:comments>23</slash:comments>
		</item>
		<item>
		<title>Maximizing ADC range for decent battery voltage monitoring (with minimum parts)</title>
		<link>http://leucos.lstilde.org/wp/2009/05/maximizing-adc-range-for-decent-battery-voltage-monitoring-with-minimum-parts/</link>
		<comments>http://leucos.lstilde.org/wp/2009/05/maximizing-adc-range-for-decent-battery-voltage-monitoring-with-minimum-parts/#comments</comments>
		<pubDate>Fri, 29 May 2009 00:33:31 +0000</pubDate>
		<dc:creator>leucos</dc:creator>
				<category><![CDATA[electronics]]></category>
		<category><![CDATA[adc]]></category>
		<category><![CDATA[battery]]></category>
		<category><![CDATA[monitoring]]></category>
		<category><![CDATA[zener]]></category>

		<guid isPermaLink="false">http://leucos.lstilde.org/wp/?p=329</guid>
		<description><![CDATA[How to make most of an anag to digital converter (ADC), using it's full bit range to measure circuit's battery voltage with a simple zener, two resistors and and I/O pin.]]></description>
			<content:encoded><![CDATA[<p>Tracking circuit&#8217;s battery voltage can be a nice addition to your project. Knowing what is the battery state can help designing a better, more clever circuit, and take appropriate actions depending on the battery state.</p>
<p><strong>Voltage reference</strong></p>
<p>In some project, I wanted to use my µcontroller ADC to get battery voltage. The first problem you encounter is : how can I measure on my ADC the circuit voltage since the top value of the ADC is the circuit voltage itself ? Yes, indeed, using the ADC this way you&#8217;ll always end up reading the maximum value (256 for 8 bits ones, 1024 for 10 bits ones, &#8230;), since the circuit voltage <strong>is</strong> the reference voltage.</p>
<p>This can be solved most of the time. For instance, in atmel microcontrollers, you just have to use the internal reference (most of the time 1.1v or 2.56v) by changing the ADMUX register bits. Atmel AVRs also let you provide your own reference at the AREF pin. The datasheet gives plenty of details about this.</p>
<p>When using Arduino, you can achieve the same ADMUX control by using the <a title="analogReference reference" href="http://www.arduino.cc/en/Reference/AnalogReference"><em>analogReference(ref)</em></a> command where <em>ref</em> can be one of :</p>
<ul>
<li>DEFAULT: use the circuit&#8217;s supply as reference (5 or 3.3 volts depending on the supply)</li>
<li>INTERNAL: use the built-in reference 1.1 volts on the <span class="wikiword">ATmega168</span> and 2.56 volts on the <span class="wikiword">ATmega8</span>.</li>
<li>EXTERNAL: the voltage applied to the AREF pin is used as the reference.</li>
</ul>
<p>This being said, we can start working, but the real challenges lies ahead.</p>
<p><strong>Gain</strong></p>
<div id="attachment_333" class="wp-caption alignleft" style="width: 101px"><a href="http://leucos.lstilde.org/wp/wp-content/uploads/2009/05/voltagedivider.png"><img class="size-full wp-image-333" title="ADCVoltageDivider" src="http://leucos.lstilde.org/wp/wp-content/uploads/2009/05/voltagedivider.png" alt="Simple voltage divider" width="91" height="239" /></a><p class="wp-caption-text">Simple voltage divider</p></div>
<p>Now that we have our reference, how can we measure that battery (let&#8217;s say LiPo) voltage ? Let&#8217;s suppose the chosen reference is 1.1v. We can not compare the battery voltage directly. LiPo can go as high as 4.25v, much higher than our reference. So we have to scale it down. We can use a voltage divider (a pair of resistors) to make this easily. By doing so, we are applying a gain &lt; 1, to make the battery voltage range seen by the ADC fit below our voltage reference.</p>
<p>Now, what resistors values should we choose ?</p>
<p>We know that :</p>
<p><span style="color: red">Error:</span> http://leucos.lstilde.org/wp/wp-content/plugins/wpmathpub/phpmathpublisher/img/ must have write access <a href="http://wordpress.org/extend/plugins/wpmathpub/faq/" title="use 'chmod 755 img' to attempt to manually fix this problem on your server">Read the official wpmathpub plugin FAQ for more details</a></p>
<p>Since we want V to be 1.1v (same as our voltage reference) when battery is full (thus 4.25v), the equation can be written as :</p>
<p><span style="color: red">Error:</span> http://leucos.lstilde.org/wp/wp-content/plugins/wpmathpub/phpmathpublisher/img/ must have write access <a href="http://wordpress.org/extend/plugins/wpmathpub/faq/" title="use 'chmod 755 img' to attempt to manually fix this problem on your server">Read the official wpmathpub plugin FAQ for more details</a></p>
<p>Ok, we have our R1/R2 ratio. Since we don&#8217;t want this circuit to waste energy (after all, we&#8217;re measuring our own battery), we want R1 and R2 to be as high as reasonably possible so current flowing will be negligeable.</p>
<p>Let&#8217;s say we take 3MΩ for R2, we can use a 1MΩ resistor for R1.</p>
<p>Great, we now lowered the voltage in our circuit, so when the battery is full (4.25v), we read almost exactly the value given by our voltage reference (1.1 in this case), which is the max value that our ADC can report.</p>
<p>But wait, what happens when the battery is depleted ? Depleted batteries never show 0v. LiPos for instance, are depleted at 2.7v. What will 2.7v show in the ADC in our situation ? Remember :</p>
<p><span style="color: red">Error:</span> http://leucos.lstilde.org/wp/wp-content/plugins/wpmathpub/phpmathpublisher/img/ must have write access <a href="http://wordpress.org/extend/plugins/wpmathpub/faq/" title="use 'chmod 755 img' to attempt to manually fix this problem on your server">Read the official wpmathpub plugin FAQ for more details</a> (we&#8217;re basically dividing the battery voltage by 4 with the values choosen for the resistors)</p>
<p>Thus, when our LiPo is empty, we&#8217;ll read 0.675v, and since :</p>
<p><span style="color: red">Error:</span> http://leucos.lstilde.org/wp/wp-content/plugins/wpmathpub/phpmathpublisher/img/ must have write access <a href="http://wordpress.org/extend/plugins/wpmathpub/faq/" title="use 'chmod 755 img' to attempt to manually fix this problem on your server">Read the official wpmathpub plugin FAQ for more details</a></p>
<p>So our 10bits ADC will tell us some number around 628. So, unfortunately, in this configuration, the only range used by our 10bits ADC is [628-1024], approximately 60% of it&#8217;s range. This is pretty bad. Now that we know how to make the voltage range fit below our voltage reference, it could be cool to extend this to the full range of our ADC. We now want our ADC to say 0 when battery is depleted, and not 628.</p>
<p><strong>Offsetting</strong></p>
<p>As you may have guessed, we can achieve that by offsetting. Offsetting means adjusting the range by using an offset value. And in our case, we just want to lower measured signal by the minimum value the battery can have : 2.7v.</p>
<p>Ok, but how can we do that ?</p>
<div id="attachment_351" class="wp-caption alignleft" style="width: 157px"><a href="http://leucos.lstilde.org/wp/wp-content/uploads/2009/05/offsetting_diode.png"><img class="size-full wp-image-351" title="ADCOffsettingDiode" src="http://leucos.lstilde.org/wp/wp-content/uploads/2009/05/offsetting_diode.png" alt="Offsetting the signal with a simple diode" width="147" height="300" /></a><p class="wp-caption-text">Offsetting the signal with a simple diode</p></div>
<p>Well, everybody out there probaby know this way to go already. But being self taught in electronics, I just didn&#8217;t had the iden in the first place. I probably not very good at Googling too, so, I just searched for a way.</p>
<p>My initial idea was to use a rectifier diode. Let&#8217;s say we arrange the circuit on the left, with a diode between Vbat and R2. Voltage between the diode will be <span style="color: red">Error:</span> http://leucos.lstilde.org/wp/wp-content/plugins/wpmathpub/phpmathpublisher/img/ must have write access <a href="http://wordpress.org/extend/plugins/wpmathpub/faq/" title="use 'chmod 755 img' to attempt to manually fix this problem on your server">Read the official wpmathpub plugin FAQ for more details</a>. This is fine, things are starting to take place. Yes we want to drop some voltage thru rectifiers until Vf is 2.7v (the minimum value we are interested in).</p>
<p>Unfortunately, this is not practical. First, Vf varies greatly according to the current in he circuit. Take a diode datasheet, find the <em>Vf vs. I</em> graph, you&#8217;ll get the idea. The other problem is to get the Vf we want. It varies, but it is usualy pretty low. This means that we would have to chain several diodes to get the desired effect, but might get surprised in the real achieved Vf, since it depends on diode bin, current, the way we read the graphs, etc&#8230;</p>
<p>Not very practical. After spending an hour browsing datasheets to find the holy grail having the good Vf, I slammed my head on thedesk : &laquo;&nbsp;<em>Just use a Zener stupid n00b!</em>&laquo;&nbsp;. Yes, Zener, that was the solution.</p>
<p>Instead of chaining diodes, I just had to put a Zener at the same place, reverse biased, with Vr being the lowest value I needed to measure in my circuit !</p>
<p>But there is still a problem : we are interested in the Zener&#8217;s have a reverse breakdown volatge value. But this voltage (usually noted Vr in their datasheets) is given for a certain current. If we use MegaOhm-style resistors, it simply won&#8217;t work : you&#8217;ll end up with a Vr completely different (around 0.7v, the classic N-P junction Vf with the Zener I tried). Again, we have to open the Zener&#8217;s datasheet, and look for the test current.</p>
<p>For instance BZX79 series have an Iztest current of 5mA. This means that we will have to make 5mA flow thru this branch to have the reverse breakdown voltage we are looking for.On the capture below, we can see the ideal situation. Yellow is Vbat, green is Vbat-Vz and purple is Vz (Vz is calculated by the scope, note the different scale).</p>
<div id="attachment_393" class="wp-caption aligncenter" style="width: 330px"><a href="http://leucos.lstilde.org/wp/wp-content/uploads/2009/05/zenerbat.png"><img class="size-full wp-image-393" title="ADCZenerBattery" src="http://leucos.lstilde.org/wp/wp-content/uploads/2009/05/zenerbat.png" alt="Voltages in seen in circuit (yellow is Vbat, green is Vbat-Vz, purple is Vz)" width="320" height="240" /></a><p class="wp-caption-text">Voltages in seen in circuit (yellow is Vbat, green is Vbat-Vz, purple is Vz)</p></div>
<p>But the needed current for the Zener to work is pretty high, given we are running on batteries, and we want to be energy conservative. So, how can we do ?</p>
<p>After some more thoughts, the solution came : instead of plugging this circuitry to ground, we&#8217;ll plug it to a microcontroller pin. When we want to measure the battery voltage (which is something we son&#8217;t have to do very often), we just put the pin in OUTPUT mode, and set it to 0v (low). Despite the name, when a pin is in OUTPUT mode, it will sink current if it&#8217;s low. The rest of the time, the pin will be set to INPUT mode (Hi-z). It&#8217;s as easy as this.</p>
<div id="attachment_355" class="wp-caption alignleft" style="width: 154px"><a href="http://leucos.lstilde.org/wp/wp-content/uploads/2009/05/measure_circuit.png"><img class="size-full wp-image-355" title="ADCFinalMesauringCircuit" src="http://leucos.lstilde.org/wp/wp-content/uploads/2009/05/measure_circuit.png" alt="Final circuit for battery monitoring" width="144" height="302" /></a><p class="wp-caption-text">Final circuit for battery monitoring</p></div>
<p>The circuit now looks like this. With our ADC, we are measuring voltage V, between the &laquo;&nbsp;first&nbsp;&raquo; resistor and the reverse biased Zener.</p>
<p>How can we choose the component values to maximize ADC range now ? We&#8217;ll try to find this out with generic terms, so it can be applied to other power sources.</p>
<p>First, some facts. The maximum value that will be read by the ADC will be Vref when supply voltage is VbatMax &#8211; Vz.<br />
The minimum value read will be VbatMin-Vz, and should be equal to 0.</p>
<p>We already can deduce how we have to choose Vz (and thus, the Zener) :</p>
<p><span style="color: red">Error:</span> http://leucos.lstilde.org/wp/wp-content/plugins/wpmathpub/phpmathpublisher/img/ must have write access <a href="http://wordpress.org/extend/plugins/wpmathpub/faq/" title="use 'chmod 755 img' to attempt to manually fix this problem on your server">Read the official wpmathpub plugin FAQ for more details</a></p>
<p>Ok, the right Zener Vz should be equal to the minimum reading we&#8217;re interested in, just what we guessed above.</p>
<p>Now, let&#8217;s try to find the usual relationship between R1 and R2 in our voltage divider. As stated in the above facts, the maximum value that will be read by the ADC is VbatMax &#8211; Vz. Ideally, in the middle of our voltage divider, this value should be exactly equal (scaled) to Vref (let&#8217;s call it Vmax).</p>
<p>Thus, we can lay down the usual voltage divider equation stuff :</p>
<p><span style="color: red">Error:</span> http://leucos.lstilde.org/wp/wp-content/plugins/wpmathpub/phpmathpublisher/img/ must have write access <a href="http://wordpress.org/extend/plugins/wpmathpub/faq/" title="use 'chmod 755 img' to attempt to manually fix this problem on your server">Read the official wpmathpub plugin FAQ for more details</a></p>
<p><span style="color: red">Error:</span> http://leucos.lstilde.org/wp/wp-content/plugins/wpmathpub/phpmathpublisher/img/ must have write access <a href="http://wordpress.org/extend/plugins/wpmathpub/faq/" title="use 'chmod 755 img' to attempt to manually fix this problem on your server">Read the official wpmathpub plugin FAQ for more details</a></p>
<p>Since all the &laquo;&nbsp;<em>Vsomething</em>&nbsp;&raquo; are <em>known</em> values, we do have a relashionship between R1 and R2 to create our divider. The values used do not matter, only the ratio&#8230; err wait. Let&#8217;s not forgot about the Zener&#8217;s Iztest ! Remember that to get the reverse beakdown voltage we need, we have a constraint : we have to make the Iztest  current flow thru the circuit. So we need to scale R1 and R2 appropriately. Of course, since the battery voltage varies (why would we need to measure it if it wouldn&#8217;t ?), establishing a current based on the resistors values is an approximation. When the battery voltage will be low, the current will low too, and our measurement won&#8217;t be as accurate as with a full battery.</p>
<p>We have several ways to handle this : we can just ignore this, and assume some average voltage. This would be probably fine for LiPos, since most of the time, they hang around 3.7v. We could get the lowest voltage we want to measure, and take it as a base to calculate resistor values to achieve Iztest. But since this voltage is zero, we won&#8217;t go far. The best option is probably to take the microcontroller datasheet, and use the maximum sink current (let&#8217;s call it Isink, watch for typos <img src='http://leucos.lstilde.org/wp/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  ) when Vbat is at maximum. This will suck the battery a bit during the ADC sampling, but again, we don&#8217;t need to check battery voltage every millisecond. Of course, we need Isink to be higher than Iztest. If Isink &gt; Iztest, no problem as long as we don&#8217;t go over the Zener&#8217;s power rating. If Isink &lt; Iztest, dump that crappy microcontroller, turn computer off, and have a walk.</p>
<p>Ok, let&#8217;s use this and calculate resistor values to get a correct current, and a good resistor ratio.</p>
<p><span style="color: red">Error:</span> http://leucos.lstilde.org/wp/wp-content/plugins/wpmathpub/phpmathpublisher/img/ must have write access <a href="http://wordpress.org/extend/plugins/wpmathpub/faq/" title="use 'chmod 755 img' to attempt to manually fix this problem on your server">Read the official wpmathpub plugin FAQ for more details</a></p>
<p>Since VbatMax, Vz and Isink are known values, we know what R1+R2 is. And since we have a relashionship between R1 and R2, we have all we need to get R1 and R2 values. Let&#8217;s try it out.</p>
<p><strong>Pencil and paper test</strong></p>
<p>Let&#8217;s try a real life example. We want to measure our LiPo voltage. So we&#8217;ll use these values :</p>
<p style="text-align: center;"><span style="color: red">Error:</span> http://leucos.lstilde.org/wp/wp-content/plugins/wpmathpub/phpmathpublisher/img/ must have write access <a href="http://wordpress.org/extend/plugins/wpmathpub/faq/" title="use 'chmod 755 img' to attempt to manually fix this problem on your server">Read the official wpmathpub plugin FAQ for more details</a><br />
<span style="color: red">Error:</span> http://leucos.lstilde.org/wp/wp-content/plugins/wpmathpub/phpmathpublisher/img/ must have write access <a href="http://wordpress.org/extend/plugins/wpmathpub/faq/" title="use 'chmod 755 img' to attempt to manually fix this problem on your server">Read the official wpmathpub plugin FAQ for more details</a><br />
<span style="color: red">Error:</span> http://leucos.lstilde.org/wp/wp-content/plugins/wpmathpub/phpmathpublisher/img/ must have write access <a href="http://wordpress.org/extend/plugins/wpmathpub/faq/" title="use 'chmod 755 img' to attempt to manually fix this problem on your server">Read the official wpmathpub plugin FAQ for more details</a><br />
<span style="color: red">Error:</span> http://leucos.lstilde.org/wp/wp-content/plugins/wpmathpub/phpmathpublisher/img/ must have write access <a href="http://wordpress.org/extend/plugins/wpmathpub/faq/" title="use 'chmod 755 img' to attempt to manually fix this problem on your server">Read the official wpmathpub plugin FAQ for more details</a></p>
<p style="text-align: left;">We already know that : <span style="color: red">Error:</span> http://leucos.lstilde.org/wp/wp-content/plugins/wpmathpub/phpmathpublisher/img/ must have write access <a href="http://wordpress.org/extend/plugins/wpmathpub/faq/" title="use 'chmod 755 img' to attempt to manually fix this problem on your server">Read the official wpmathpub plugin FAQ for more details</a></p>
<p style="text-align: left;">Let&#8217;s find the R1+R2 sum first : <span style="color: red">Error:</span> http://leucos.lstilde.org/wp/wp-content/plugins/wpmathpub/phpmathpublisher/img/ must have write access <a href="http://wordpress.org/extend/plugins/wpmathpub/faq/" title="use 'chmod 755 img' to attempt to manually fix this problem on your server">Read the official wpmathpub plugin FAQ for more details</a></p>
<p>Ok, now, we can use the R1-R2 relashionship : <span style="color: red">Error:</span> http://leucos.lstilde.org/wp/wp-content/plugins/wpmathpub/phpmathpublisher/img/ must have write access <a href="http://wordpress.org/extend/plugins/wpmathpub/faq/" title="use 'chmod 755 img' to attempt to manually fix this problem on your server">Read the official wpmathpub plugin FAQ for more details</a></p>
<p>So, reusing the R1+R2 equation above, <span style="color: red">Error:</span> http://leucos.lstilde.org/wp/wp-content/plugins/wpmathpub/phpmathpublisher/img/ must have write access <a href="http://wordpress.org/extend/plugins/wpmathpub/faq/" title="use 'chmod 755 img' to attempt to manually fix this problem on your server">Read the official wpmathpub plugin FAQ for more details</a> (we&#8217;ll use the closest standard value 56Ω).</p>
<p>Finally, <span style="color: red">Error:</span> http://leucos.lstilde.org/wp/wp-content/plugins/wpmathpub/phpmathpublisher/img/ must have write access <a href="http://wordpress.org/extend/plugins/wpmathpub/faq/" title="use 'chmod 755 img' to attempt to manually fix this problem on your server">Read the official wpmathpub plugin FAQ for more details</a> (we&#8217;ll use the closest standard value 22Ω).</p>
<p><strong>Converting ADC reading to real voltage</strong></p>
<p>Now that we&#8217;ve been this far, let&#8217;s not forget what we came here for : get the battery voltage. we have to convert the ADC value back to some human reading.</p>
<p>A <em>n</em> bits ADC reads the voltage at V, and converts it linearly (supposedly) into a value between 0 (meaning 0v in our case) and <span style="color: red">Error:</span> http://leucos.lstilde.org/wp/wp-content/plugins/wpmathpub/phpmathpublisher/img/ must have write access <a href="http://wordpress.org/extend/plugins/wpmathpub/faq/" title="use 'chmod 755 img' to attempt to manually fix this problem on your server">Read the official wpmathpub plugin FAQ for more details</a>  (meaning Vref in our case).</p>
<p>So to convert for an ADC value to battery voltage, we can use :</p>
<p><span style="color: red">Error:</span> http://leucos.lstilde.org/wp/wp-content/plugins/wpmathpub/phpmathpublisher/img/ must have write access <a href="http://wordpress.org/extend/plugins/wpmathpub/faq/" title="use 'chmod 755 img' to attempt to manually fix this problem on your server">Read the official wpmathpub plugin FAQ for more details</a></p>
<p>Finally : <span style="color: red">Error:</span> http://leucos.lstilde.org/wp/wp-content/plugins/wpmathpub/phpmathpublisher/img/ must have write access <a href="http://wordpress.org/extend/plugins/wpmathpub/faq/" title="use 'chmod 755 img' to attempt to manually fix this problem on your server">Read the official wpmathpub plugin FAQ for more details</a></p>
<p><strong>Cheat sheet (a.k.a. fast forward mode)</strong></p>
<p><em>Known stuff :</em><strong><br />
</strong></p>
<ul>
<li>Maximum voltage to be measured : <span style="color: red">Error:</span> http://leucos.lstilde.org/wp/wp-content/plugins/wpmathpub/phpmathpublisher/img/ must have write access <a href="http://wordpress.org/extend/plugins/wpmathpub/faq/" title="use 'chmod 755 img' to attempt to manually fix this problem on your server">Read the official wpmathpub plugin FAQ for more details</a></li>
<li>Minimum voltage to be measured : <span style="color: red">Error:</span> http://leucos.lstilde.org/wp/wp-content/plugins/wpmathpub/phpmathpublisher/img/ must have write access <a href="http://wordpress.org/extend/plugins/wpmathpub/faq/" title="use 'chmod 755 img' to attempt to manually fix this problem on your server">Read the official wpmathpub plugin FAQ for more details</a></li>
<li>Voltage reference : <span style="color: red">Error:</span> http://leucos.lstilde.org/wp/wp-content/plugins/wpmathpub/phpmathpublisher/img/ must have write access <a href="http://wordpress.org/extend/plugins/wpmathpub/faq/" title="use 'chmod 755 img' to attempt to manually fix this problem on your server">Read the official wpmathpub plugin FAQ for more details</a></li>
<li>Maximum sink current for µcontroller : <span style="color: red">Error:</span> http://leucos.lstilde.org/wp/wp-content/plugins/wpmathpub/phpmathpublisher/img/ must have write access <a href="http://wordpress.org/extend/plugins/wpmathpub/faq/" title="use 'chmod 755 img' to attempt to manually fix this problem on your server">Read the official wpmathpub plugin FAQ for more details</a></li>
</ul>
<p><em>Stuff to calculate :</em></p>
<ul>
<li>Zener&#8217;s required reverse breakdown voltage :</li>
</ul>
<p style="text-align: center;"><span style="color: red">Error:</span> http://leucos.lstilde.org/wp/wp-content/plugins/wpmathpub/phpmathpublisher/img/ must have write access <a href="http://wordpress.org/extend/plugins/wpmathpub/faq/" title="use 'chmod 755 img' to attempt to manually fix this problem on your server">Read the official wpmathpub plugin FAQ for more details</a></p>
<ul>
<li> Resistor value R1 (low resistor) :</li>
</ul>
<p style="text-align: center;"><span style="color: red">Error:</span> http://leucos.lstilde.org/wp/wp-content/plugins/wpmathpub/phpmathpublisher/img/ must have write access <a href="http://wordpress.org/extend/plugins/wpmathpub/faq/" title="use 'chmod 755 img' to attempt to manually fix this problem on your server">Read the official wpmathpub plugin FAQ for more details</a></p>
<ul>
<li>Resistor value R2 (high resistor) :</li>
</ul>
<p style="text-align: center;"><span style="color: red">Error:</span> http://leucos.lstilde.org/wp/wp-content/plugins/wpmathpub/phpmathpublisher/img/ must have write access <a href="http://wordpress.org/extend/plugins/wpmathpub/faq/" title="use 'chmod 755 img' to attempt to manually fix this problem on your server">Read the official wpmathpub plugin FAQ for more details</a></p>
<ul>
<li><em>n</em> bits ADC to battery voltage conversion :</li>
</ul>
<p style="text-align: center;"><span style="color: red">Error:</span> http://leucos.lstilde.org/wp/wp-content/plugins/wpmathpub/phpmathpublisher/img/ must have write access <a href="http://wordpress.org/extend/plugins/wpmathpub/faq/" title="use 'chmod 755 img' to attempt to manually fix this problem on your server">Read the official wpmathpub plugin FAQ for more details</a></p>
<p style="text-align: left;">Now, I need to test this on the breadboard. Share your experiments if you use the above stuff. And doublecheck the math <img src='http://leucos.lstilde.org/wp/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><a href="?article2pdf=1">PDF version</a></p>
]]></content:encoded>
			<wfw:commentRss>http://leucos.lstilde.org/wp/2009/05/maximizing-adc-range-for-decent-battery-voltage-monitoring-with-minimum-parts/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Bat Detector with adjustable gain</title>
		<link>http://leucos.lstilde.org/wp/2009/05/bat-detector-with-adjustable-gain/</link>
		<comments>http://leucos.lstilde.org/wp/2009/05/bat-detector-with-adjustable-gain/#comments</comments>
		<pubDate>Fri, 22 May 2009 13:51:00 +0000</pubDate>
		<dc:creator>leucos</dc:creator>
				<category><![CDATA[electronics]]></category>
		<category><![CDATA[projects]]></category>
		<category><![CDATA[bat]]></category>
		<category><![CDATA[detector]]></category>
		<category><![CDATA[ultrasonic]]></category>

		<guid isPermaLink="false">http://leucos.lstilde.org/wp/?p=254</guid>
		<description><![CDATA[While I stumbled upon Tony Messina's Simple Bat Detector pages long time ago,I really decided to build one only when I saw that Bre Pettis could :). This ultrasonic bat detector is simple to build, and pretty efficient.]]></description>
			<content:encoded><![CDATA[<div id="attachment_271" class="wp-caption alignleft" style="width: 160px"><a href="http://leucos.lstilde.org/wp/wp-content/uploads/2009/05/image75.jpg"><img class="size-thumbnail wp-image-271" title="BatDetector" src="http://leucos.lstilde.org/wp/wp-content/uploads/2009/05/image75-150x150.jpg" alt="Bat Detector" width="150" height="150" /></a><p class="wp-caption-text">Bat Detector</p></div>
<p>While I stumbled upon Tony Messina&#8217;s <a href="http://home.earthlink.net/~bat-detector/SBD2.html">Simple Bat Detector</a> pages long time ago,I really decided to build one only when I saw that Bre Pettis <a href="http://blog.makezine.com/archive/2006/09/make_podcast_weekend_projects_7.html">could</a> <img src='http://leucos.lstilde.org/wp/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
<p>So I barely used Tony&#8217;s schematics and instructions, but spiced the circuit a bit by adding a gain adjustement potentionmeter, a on/off switch driven by the volume potentiometer, and a LED witness light.</p>
<p>It&#8217;s pretty easy to build : thru-hole components, some wires, &#8230;. You can use the eagle schematics included below to build yours. The latest version is single sided, and doesn&#8217;t need the flying wire on the top side like mine.</p>
<p>The most difficult part is to find the right compononents for the switch capable potentiometer (I choosed a push/push type : push to turn on, push again to turn off) and the box.</p>
<p>The push/push 10kΩ potentiometer used is a tyco Electronics 17PCSA103MC19P. You can grab it at <a href="http://fr.farnell.com/jsp/search/productdetail.jsp?SKU=1174114">Farnell</a>.<br />
The other potentionmeter is just a standard 10kΩ one, like the <a href="http://fr.farnell.com/jsp/search/productdetail.jsp?SKU=350072">Tyco Electronics 23ESA103MMF50NF</a><br />
The enclosure is a Boss Enclosure, model BIM RETEX 551 (Betabox Series), also available at <a href="http://fr.farnell.com/boss-enclosures/bim-retex-551/coffret-portatif/dp/1171601">Farnell</a>.</p>
<p>What I didn&#8217;t find at Farnell is the <a href="http://www.gotronic.fr/catalog/audio/ecouteurs.htm">piezo-ceramic earplug</a>. Unfortunately, I don&#8217;t remember if I got the high (E10P) or low (S83) impedance earplug.</p>

<a href='http://leucos.lstilde.org/wp/2009/05/bat-detector-with-adjustable-gain/image72/' title='BatDetector Circuit'><img width="150" height="150" src="http://leucos.lstilde.org/wp/wp-content/uploads/2009/05/image72-150x150.jpg" class="attachment-thumbnail" alt="Poorly routed initial prototype" title="BatDetector Circuit" /></a>
<a href='http://leucos.lstilde.org/wp/2009/05/bat-detector-with-adjustable-gain/image71/' title='BatDetector Inside'><img width="150" height="150" src="http://leucos.lstilde.org/wp/wp-content/uploads/2009/05/image71-150x150.jpg" class="attachment-thumbnail" alt="Inside view" title="BatDetector Inside" /></a>
<a href='http://leucos.lstilde.org/wp/2009/05/bat-detector-with-adjustable-gain/image74/' title='BatDetector Outside'><img width="150" height="150" src="http://leucos.lstilde.org/wp/wp-content/uploads/2009/05/image74-150x150.jpg" class="attachment-thumbnail" alt="Outside view : volume, gain and LED" title="BatDetector Outside" /></a>

<p>Grab the schematic and board here :</p>
<p><a href="http://leucos.lstilde.org/wp/wp-content/uploads/2009/05/bat_en_1.sch">BatDetector Schematic</a></p>
<p><a href="http://leucos.lstilde.org/wp/wp-content/uploads/2009/05/bat_en_1.brd">BatDetector Board</a></p>
<p>On the board, there is no connector to plug the potentiometer push/push switch. So you&#8217;ll have to wire one pin of the switch to the battery clip, and the other pin to the &#8216;+&#8217; connector on the board. For ground, just wire directly.</p>
<p>To test your detector, if you don&#8217;t have a bat under your hand, just open a water tap and aim the detector at it : it should make lots of noise. If not, try to adjust the gain settings. If nothing works, well&#8230; something is wrong <img src='http://leucos.lstilde.org/wp/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Now, just make it and go out listen for the bats. They&#8217;re pretty easy to find in semi-urban area : bats love city lights (well, they love the insects that love the city lights), especially  mercury vapor bulbs (white lights), which attract more insects. Unfortunately, most towns are now installing high pressure sodium lamps (orange), which insects doesn&#8217;t like as much. The most common bats, <a href="http://en.wikipedia.org/wiki/Common_Pipistrelle">Pipistrelle</a>, emit two kind of calls :</p>
<ul>
<li>echolocation for hunt, around 48KHz, you&#8217;ll hear those with the detector</li>
<li>social calls, around 20KHz; you can hear them without any device if you&#8217;re lucky enough (or young enough)</li>
</ul>
<p>Finally, but you probably already know that : do not wake up hinernating bats. If you do so, they have to fly, waste energy and even if they come back to sleep again, they will get hungry too early in the season. They will have to wake up to hunt, but too early means no insects, and the bat will probably die by waking too early.</p>
<p>Have fun !</p>
]]></content:encoded>
			<wfw:commentRss>http://leucos.lstilde.org/wp/2009/05/bat-detector-with-adjustable-gain/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>High-power TVBGone</title>
		<link>http://leucos.lstilde.org/wp/2009/05/high-power-tvbgone/</link>
		<comments>http://leucos.lstilde.org/wp/2009/05/high-power-tvbgone/#comments</comments>
		<pubDate>Sat, 16 May 2009 20:33:14 +0000</pubDate>
		<dc:creator>leucos</dc:creator>
				<category><![CDATA[electronics]]></category>
		<category><![CDATA[projects]]></category>
		<category><![CDATA[gadgets]]></category>
		<category><![CDATA[infrared]]></category>
		<category><![CDATA[tvbgone]]></category>

		<guid isPermaLink="false">http://leucos.lstilde.org/wp/?p=188</guid>
		<description><![CDATA[High power TVBGone. This infrared device will turn off most TVs out there, from approximately 100ft (30m). ]]></description>
			<content:encoded><![CDATA[<p>This TVBG has been done a long time ago, but I never took time to write about it. It&#8217;s quite powerful : you can easily take off TV&#8217;s at 100ft, and even works thru your pocket (and pretty far if you wear GoreTex). But guess it, with power comes batteries, and the downside is it&#8217;s size, roughly the size of a cigarette pack (all the pictures below are pretty outdated&#8230;).</p>
<div id="attachment_192" class="wp-caption aligncenter" style="width: 250px"><a href="http://leucos.lstilde.org/wp/wp-content/uploads/2009/05/telecommandof.jpg"><img class="size-full wp-image-192" title="TVBGone with it's camouflage package" src="http://leucos.lstilde.org/wp/wp-content/uploads/2009/05/telecommandof.jpg" alt="TVBGone with it's camouflage package" width="240" height="302" /></a><p class="wp-caption-text">TVBGone with it</p></div>
<p>The design is pretty simple : an AtTiny85, 6 TSAL 6100 IR diodes from Vishay (rated 1A for short pulses), 6+1 NPN transistors. Unlike what is show in the picture below, there is no more jumper (it was used to switch between programming mode and run mode). The tantalum capacitor has been scrounged, and not bought. If you know what coltan is, you know that buying tantalum stuff is rather bad.</p>
<div id="attachment_191" class="wp-caption aligncenter" style="width: 277px"><a href="http://leucos.lstilde.org/wp/wp-content/uploads/2009/05/img_0638.jpg"><img class="size-full wp-image-191" title="Bottom view" src="http://leucos.lstilde.org/wp/wp-content/uploads/2009/05/img_0638.jpg" alt="TBGone bottom view" width="267" height="346" /></a><p class="wp-caption-text">TBGone bottom viewTVBGone with it</p></div>
<p>The thing is powered by 3xAA batteries. <strong>There is no current limiter</strong>, the only limit is provided by the batteries internal resistance so take care if you want to change supply for a LiPo or whatever, you&#8217;ll blow the LEDs for sure. In this case, add a resistor along each LED, or better, use some current regulator.</p>
<p>For now, the 6 TSAL LEDs are sucking 2.5 Amps without a current limiter.</p>
<div id="attachment_190" class="wp-caption aligncenter" style="width: 192px"><a href="http://leucos.lstilde.org/wp/wp-content/uploads/2009/05/img_0636.jpg"><img class="size-full wp-image-190" title="Top view" src="http://leucos.lstilde.org/wp/wp-content/uploads/2009/05/img_0636.jpg" alt="TVBGone top view" width="182" height="277" /></a><p class="wp-caption-text">TVBGone top view</p></div>
<p>The AVR code has been found on the net, and is provided here almost unmodified. The original authors are in the <em>main.c</em> header file, among which, of course, Limor (aka Ladyada).</p>
<p>I&#8217;ve changed the IR codes a bit, removing some duplicates, reordered them too so the most used codes comes first (file with modified codes is <em>PERSOcodes.c</em>).</p>
<p>One of the problems is that LG TV can not yet be turned off. This is a pain since LGs are everywhere. I don&#8217;t have time to reverse engineer timings for LG or use convert Lirc codes for now. But for sure, this would be valuable work. If you do it, please drop me a note.</p>
<p>EDIT : CaitSith2 dropped a note saying he has more up to date code for TVBG which turns off LGs too (see <a title="comments" href="#comments">comments</a>). So you&#8217;d better use <a title="CaitSith2 code" href="http://caitsith2.net/projects/tvbgone/">his</a> code than mine. Thanks CaitSith2 !</p>
<p>EDIT2 : It seems that CaitSith2 is more high power : 8 TSAL6100, 4xAA&#8230; nice !</p>
<p>In the <a href="http://leucos.lstilde.org/wp/wp-content/uploads/2009/05/tvbgonetar.gz">schematics</a> (tvbgone2_cms), all the little pads near JP1 are for a very weird slide button (I was too leazy to draw an eagle lib part). So don&#8217;t panic and adjust for your switch.</p>
<p>There is another schematic included : tvbgone_mini.sch, which is a variant intended to be build as jewelry. I plan to use <a title="CR2477 batteries" href="http://export.farnell.com/panasonic/cr2477-1hfe/battery-lithium-2pin-horiz-cr2477/dp/1298248">CR2477 batteries</a> but I never built it. If you make it, please tell me how things turned.</p>
<p>The P &amp; R pins are &laquo;&nbsp;Program&nbsp;&raquo; and &laquo;&nbsp;Run&nbsp;&raquo; respectively. When done programming, just cut the wire going from the central pad to P, and make a solder bridge between the central pad and the R pad. If you need to reprogram again, remove bridge, and bridge between the central pad and P, etc&#8230;</p>
<p>Get the <a href="http://leucos.lstilde.org/wp/wp-content/uploads/2009/05/tvbgonetar.gz">eagle schematics</a>, grab the <a href="http://leucos.lstilde.org/wp/wp-content/uploads/2009/05/tvbgera.tgz">code</a>, turn off those TVs and have fun.</p>
]]></content:encoded>
			<wfw:commentRss>http://leucos.lstilde.org/wp/2009/05/high-power-tvbgone/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>WRT54G/GS/GL Relay Mod</title>
		<link>http://leucos.lstilde.org/wp/2008/09/wrt54ggsgl-relay-mod/</link>
		<comments>http://leucos.lstilde.org/wp/2008/09/wrt54ggsgl-relay-mod/#comments</comments>
		<pubDate>Sat, 27 Sep 2008 18:35:18 +0000</pubDate>
		<dc:creator>leucos</dc:creator>
				<category><![CDATA[electronics]]></category>
		<category><![CDATA[projects]]></category>
		<category><![CDATA[mods]]></category>
		<category><![CDATA[wrt]]></category>

		<guid isPermaLink="false">http://leucos.lstilde.org/wp/?p=50</guid>
		<description><![CDATA[How to hack a WRT54 Linksys routeur to power cycle a remote device.]]></description>
			<content:encoded><![CDATA[<p>Sometimes, it could be handy if your router (in this case, a WRT54G) could restart the device that connects it to the internet. For instance, if your ADSL modem needs some reboot or your cable modem needs a kick, having the WRT to do this would be nice.</p>
<p>This could be especially useful if the modem+router are deployed as an access point somewhere in the wild.</p>
<p>This usage is not limitating : we&#8217;re gonna build a WRT managed relay. What you switch on/off with this relay is your problem. A modem seems a reasonable idea, but you could switch a coffee pot (in this case,  you should go with HTCPCP [<a title="RFC 2324" href="http://www.ietf.org/rfc/rfc2324.txt" target="_blank">http://www.ietf.org/rfc/rfc2324.txt</a>]), lights, etc&#8230;</p>
<p>All this is possible with little modification. The behaviour of the system here is to switch the relay for approx. 14 seconds, but this time is also easy to change. You can even use a trim pot instead to make it fully tunable.</p>
<p><strong>Schematics</strong></p>
<div id="attachment_52" class="wp-caption alignleft" style="width: 160px"><a href="http://leucos.lstilde.org/wp/wp-content/uploads/2008/09/wrm_schem_v3.png"><img class="size-thumbnail wp-image-52" title="Schematic" src="http://leucos.lstilde.org/wp/wp-content/uploads/2008/09/wrm_schem_v3-150x150.png" alt="Relay board schematic" width="150" height="150" /></a><p class="wp-caption-text">Relay board schematic</p></div>
<p>The <a href="http://leucos.lstilde.org/wp/wp-content/uploads/2008/09/wrm_v3.zip">schematic</a> is rather simple. The board is connected to the internal WRT54G serial port (TX pin). This pin uses LV-TLL signals (0, +3.3V), and logic high is 0V. In other words, when nothing is send out to the serial port by the WRT, the level is low and the TX pin show 3.3V. What we want is to activate the relay when voltage on this pins drop. The trick is to feed the TX pin to the Threshold pin of a 555 timer (see those excellent 555 links in <a title="Electronics Club on 555" href="http://www.kpsec.freeuk.com/555timer.htm">Electronics Club</a> and <a title="Mecanno Electronique" href="http://www.ptitrain.com/electronique/meccano/meccano_sommaire.htm">Mecanno Electronique</a> in french). And this is what happens when we the WRT sends data to the serial port : square wave comes out of second serial port TX pin and triggers the 555. For this to work, the 555 is powered at 6V, and thus triggered when TX voltage drops below 2V (approx 1/3 of VCC). The 6V feed is very primitive and comes from WRT power (12V) sliced in half by a voltage divider. It would be wiser to use a voltage regulator (7805 or al.), but we&#8217;re going the easy way here.</p>
<p>The trigger from the 555 is fed at the base of the 2N2222 transistor which in turns feed the coil enough current to switch.</p>
<p>Primitive, as I said.</p>
<p><strong>Assembling it</strong></p>
<p>First, be aware that doing the bad things below will void your WRT warranty, your modem warranty. You also can burn things or yourself in the process, etc&#8230; So do at your own risk. This being said, that stuff has been my first electronics project so it is <em>really</em> easy. <em>&laquo;&nbsp;my first electronics project&nbsp;&raquo;</em> should also be taken as a warning.</p>
<ul>
<li>Open your WRT54G (or GS, or GL) by pulling the blue cover out</li>
</ul>
<ul>
<li>Take the WRT PCB out.</li>
</ul>
<ul>
<li>Solder a wire in the TX pin (pin 3) of the serial port</li>
</ul>
<p><a href="http://leucos.lstilde.org/wp/wp-content/uploads/2008/09/txpin.jpg"><img class="alignright size-thumbnail wp-image-51" title="TX pin location" src="http://leucos.lstilde.org/wp/wp-content/uploads/2008/09/txpin-150x150.jpg" alt="" width="150" height="150" /></a>Soldering this port is really easy, even I did it without breaking anything or melting the router to a shapeless plastic blob. You&#8217;ll find more info and pictures on the <a title="LinkSys WRT5G/GS Dual Port Mod Page" href="http://www.rwhitby.net/wrt54gs/serial.html" target="_blank">LinkSys WRT5G/GS Dual Port Mod Page</a>. You don&#8217;t need IDC headers or high end stuff like this. Just solder in the hole. It will be ok as long as you don&#8217;t pull too much on the wire.</p>
<p>The blue front cover has holes inside. These holes can&#8217;t be seen from the outside because of the stickers. This is a good place to make a complete hole with a hot wire if you plan to put your PCB relay outside the WRT. For recent models, like the GL, the PCB can probably fit inside.</p>
<ul>
<li>Pull the TX cable through the blue cover and assemble the WRT back</li>
</ul>
<ul>
<li>Solder the wires with the DC power jacks on the board<a href="http://leucos.lstilde.org/wp/wp-content/uploads/2008/09/wrt_board.jpg"><img class="alignright size-thumbnail wp-image-54" title="Relay board" src="http://leucos.lstilde.org/wp/wp-content/uploads/2008/09/wrt_board-150x150.jpg" alt="" width="150" height="150" /></a></li>
</ul>
<ul>
<li>Cut power cables from modem and WRT. Be sure to cut it at the right place ! You need enough cable to plug the wall wart and enough cable to plug the modem and WRT.</li>
</ul>
<ul>
<li>Remove some insulating material from the power wires and insert them in the screw clamps. Don&#8217;t mess with polarity or which wire go where. You would burn something for <em>sure</em>.</li>
</ul>
<ul>
<li>Now we need software to get this going. The basic idea is to ping some IP address, and when consecutive failures are detected, the relay is activated and the stuff behind it reboots. You can push the shell script to the WRT running Sveasoft firmware under Administration/Diagnostocs/Run, then paster script and click &laquo;&nbsp;Save Startup&nbsp;&raquo;. You can do the same with OpenWRT and probably with other firmwares.</li>
</ul>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;">#!/bin/sh&lt;/code&gt;</span><br />
<br />
<span style="color: #666666; font-style: italic;">########### Tunable Variables #############</span><br />
<span style="color: #666666; font-style: italic;"># which host to check</span><br />
<span style="color: #007800;">checkhost</span>=<span style="color: #ff0000;">&quot;212.27.48.10&quot;</span><br />
<br />
<span style="color: #666666; font-style: italic;"># how often to check</span><br />
<span style="color: #007800;">checkinterval</span>=<span style="color: #000000;">20</span><br />
<br />
<span style="color: #666666; font-style: italic;"># how many failures to activate relay</span><br />
<span style="color: #007800;">activateafter</span>=<span style="color: #000000;">3</span><br />
<br />
<span style="color: #666666; font-style: italic;"># where is the wrt_relay_mod</span><br />
<span style="color: #666666; font-style: italic;"># serial=/tmp/test</span><br />
<span style="color: #007800;">serial</span>=<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>tts<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">1</span><br />
<br />
<span style="color: #666666; font-style: italic;"># how long should we rest after switching</span><br />
<span style="color: #007800;">rest</span>=<span style="color: #000000;">120</span><br />
<br />
<span style="color: #666666; font-style: italic;"># how many log/debug lines do we keep</span><br />
<span style="color: #007800;">keeplines</span>=<span style="color: #000000;">20</span><br />
<span style="color: #666666; font-style: italic;">########### End Variables #################</span><br />
<br />
<span style="color: #666666; font-style: italic;">#</span><br />
<span style="color: #007800;">pingfail</span>=0<br />
<span style="color: #007800;">logfile</span>=<span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>wrm.log<br />
<span style="color: #007800;">debuglogfile</span>=<span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>wrm_debug.log<br />
<span style="color: #007800;">version</span>=<span style="color: #000000;">1</span><br />
<span style="color: #666666; font-style: italic;">#</span><br />
<br />
log<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span><br />
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-n</span> <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">date</span><span style="color: #000000; font-weight: bold;">`</span> <span style="color: #000000; font-weight: bold;">&amp;</span>gt;<span style="color: #000000; font-weight: bold;">&amp;</span>gt; <span style="color: #007800;">$logfile</span><br />
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot; : &quot;</span><span style="color: #800000;">${1}</span> <span style="color: #000000; font-weight: bold;">&amp;</span>gt;<span style="color: #000000; font-weight: bold;">&amp;</span>gt; <span style="color: #007800;">$logfile</span><br />
<br />
<span style="color: #666666; font-style: italic;"># trim log file</span><br />
<span style="color: #c20cb9; font-weight: bold;">head</span> <span style="color: #660033;">-n</span> 8 <span style="color: #007800;">$logfile</span> <span style="color: #000000; font-weight: bold;">&amp;</span>gt; <span style="color: #007800;">$logfile</span>.tmp<br />
<span style="color: #c20cb9; font-weight: bold;">tail</span> <span style="color: #660033;">-n</span> <span style="color: #007800;">$keeplines</span> <span style="color: #007800;">$logfile</span> <span style="color: #000000; font-weight: bold;">&amp;</span>gt;<span style="color: #000000; font-weight: bold;">&amp;</span>gt; <span style="color: #007800;">$logfile</span>.tmp<br />
<span style="color: #c20cb9; font-weight: bold;">mv</span> <span style="color: #007800;">$logfile</span>.tmp <span style="color: #007800;">$logfile</span><br />
<span style="color: #7a0874; font-weight: bold;">&#125;</span><br />
<br />
debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span><br />
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-n</span> <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">date</span><span style="color: #000000; font-weight: bold;">`</span> <span style="color: #000000; font-weight: bold;">&amp;</span>gt;<span style="color: #000000; font-weight: bold;">&amp;</span>gt; <span style="color: #007800;">$debuglogfile</span><br />
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot; : &quot;</span><span style="color: #800000;">${1}</span> <span style="color: #000000; font-weight: bold;">&amp;</span>gt;<span style="color: #000000; font-weight: bold;">&amp;</span>gt; <span style="color: #007800;">$debuglogfile</span><br />
<br />
<span style="color: #666666; font-style: italic;"># trim debug file</span><br />
<span style="color: #c20cb9; font-weight: bold;">tail</span> <span style="color: #660033;">-n</span> <span style="color: #007800;">$keeplines</span> <span style="color: #007800;">$debuglogfile</span> <span style="color: #000000; font-weight: bold;">&amp;</span>gt; <span style="color: #007800;">$debuglogfile</span>.tmp<br />
<span style="color: #c20cb9; font-weight: bold;">mv</span> <span style="color: #007800;">$debuglogfile</span>.tmp <span style="color: #007800;">$debuglogfile</span><br />
<span style="color: #7a0874; font-weight: bold;">&#125;</span><br />
<br />
check_loop<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span><br />
<span style="color: #666666; font-style: italic;"># we sleep $checkinterval seconds</span><br />
<span style="color: #c20cb9; font-weight: bold;">sleep</span> <span style="color: #007800;">$checkinterval</span><br />
<br />
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #c20cb9; font-weight: bold;">ping</span> <span style="color: #660033;">-qn</span> <span style="color: #660033;">-c</span> 1 <span style="color: #007800;">$checkhost</span> <span style="color: #000000; font-weight: bold;">&amp;</span>gt; <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>null ; <span style="color: #000000; font-weight: bold;">then</span><br />
<span style="color: #666666; font-style: italic;"># network is ok</span><br />
<span style="color: #007800;">pingfail</span>=<span style="color: #000000;">0</span><br />
debug <span style="color: #ff0000;">&quot;/-\ =&amp;gt; ping ok&quot;</span><br />
<span style="color: #c20cb9; font-weight: bold;">sleep</span> <span style="color: #007800;">$checkinterval</span><br />
<span style="color: #000000; font-weight: bold;">else</span><br />
<span style="color: #666666; font-style: italic;"># network seems down</span><br />
<span style="color: #007800;">pingfail</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">expr</span> <span style="color: #007800;">$pingfail</span> + <span style="color: #000000;">1</span><span style="color: #000000; font-weight: bold;">`</span><br />
debug <span style="color: #ff0000;">&quot;/?\ =&amp;gt; <span style="color: #007800;">$pingfail</span> ping failures&quot;</span><br />
<br />
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$pingfail</span> <span style="color: #660033;">-ge</span> <span style="color: #007800;">$activateafter</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span><br />
log <span style="color: #ff0000;">&quot;relay switched&quot;</span><br />
debug <span style="color: #ff0000;">&quot;/!\ =&amp;gt; switching relay...&quot;</span><br />
<span style="color: #7a0874; font-weight: bold;">echo</span> ACTIVATE <span style="color: #000000; font-weight: bold;">&amp;</span>gt; <span style="color: #007800;">$serial</span><br />
debug <span style="color: #ff0000;">&quot;/-\ &amp;gt; resting for <span style="color: #007800;">$rest</span> seconds&quot;</span><br />
<span style="color: #007800;">pingfail</span>=0<br />
<span style="color: #c20cb9; font-weight: bold;">sleep</span> <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">expr</span> <span style="color: #007800;">$rest</span> - <span style="color: #007800;">$checkinterval</span><span style="color: #000000; font-weight: bold;">`</span><br />
<span style="color: #000000; font-weight: bold;">fi</span><br />
<span style="color: #000000; font-weight: bold;">fi</span><br />
<span style="color: #7a0874; font-weight: bold;">&#125;</span><br />
<br />
<span style="color: #666666; font-style: italic;"># log few information at boot</span><br />
log <span style="color: #ff0000;">&quot;######################################&quot;</span><br />
log <span style="color: #ff0000;">&quot;# wrm daemon version <span style="color: #007800;">$version</span> starting&quot;</span><br />
log <span style="color: #ff0000;">&quot;# checkhost=<span style="color: #007800;">$checkhost</span>&quot;</span><br />
log <span style="color: #ff0000;">&quot;# checkinterval=<span style="color: #007800;">$checkinterval</span>&quot;</span><br />
log <span style="color: #ff0000;">&quot;# activateafter=<span style="color: #007800;">$activateafter</span>&quot;</span><br />
log <span style="color: #ff0000;">&quot;# serial=<span style="color: #007800;">$serial</span>&quot;</span><br />
log <span style="color: #ff0000;">&quot;# rest=<span style="color: #007800;">$rest</span>&quot;</span><br />
log <span style="color: #ff0000;">&quot;######################################&quot;</span><br />
<br />
<span style="color: #666666; font-style: italic;"># initial rest</span><br />
<span style="color: #c20cb9; font-weight: bold;">sleep</span> <span style="color: #007800;">$rest</span><br />
<br />
<span style="color: #666666; font-style: italic;"># control loop</span><br />
<span style="color: #000000; font-weight: bold;">while</span> <span style="color: #c20cb9; font-weight: bold;">true</span>; <span style="color: #000000; font-weight: bold;">do</span> check_loop; <span style="color: #000000; font-weight: bold;">done</span></div></div>
<p>Tune variables at your liking. You can see how the relay is software activated : it just writes &#8216;ACTIVATE&#8217; to the device driving the second serial port. What you write is not important. &#8217;saddam&#8217; and &#8216;george&#8217; work equally well for instance. You should also restrain yourself from logging too much. The idel situation for deployment is to disable debug and logging. Space is scarce on the WRT.</p>
<p>Here is the final thing assembler, with the driver modem (a Terayon TJ720). The system works fine but is<a class="imagelink" title="Assembled setup" onclick="doPopup(9);return false;" href="http://misomosi.free.fr/wp-content/assembled.jpg"><img id="image9" title="Assembled setup" src="http://misomosi.free.fr/wp-content/assembled.thumbnail.jpg" alt="Assembled setup" align="right" /></a> quite static sensitive. So discharge yourself somewhere before touching the running circuit, or the relay might activate. Also, proper casing should be done. Putting the circuit inside the WRT is possible with latter models (WRT54GS and WRT54GL). This hasn&#8217;t been tester though, and might put some noise inside.</p>
<p><strong>Bill of materials</strong></p>
<p>Building this stuff shouldn&#8217;t take more than 2 hours and if you wish to buy parts, it will cost less than 4€ (3.0€ each by 20 at <a title="GoTronic" href="http://www.gotronic.fr.">GoTronic</a> in France).</p>
<p>Here is the list of components required :</p>
<table border="0">
<tbody>
<tr bgcolor="#aaaaff">
<th>Component</th>
<th align="center">Quantity</th>
</tr>
<tr>
<td>MINIATURE RELAY 6-12V/12V-2A</td>
<td>1</td>
</tr>
<tr>
<td>TWO WAY TERMINAL BLOCK</td>
<td>2</td>
</tr>
<tr>
<td>1K RESIST. CARBON 1/4-5%</td>
<td>2</td>
</tr>
<tr>
<td>47K RESIST. CARBON 1/4-5%</td>
<td>1</td>
</tr>
<tr>
<td>33K RESIST. CARBON 1/4-5%</td>
<td>1</td>
</tr>
<tr>
<td>TRANSISTOR NPN 50V-0.2A</td>
<td>1</td>
</tr>
<tr>
<td>CAPACITOR 10n</td>
<td>1</td>
</tr>
<tr>
<td>CAPACITOR 220u</td>
<td>1</td>
</tr>
<tr>
<td>CAPACITOR 100u</td>
<td>1</td>
</tr>
<tr>
<td>DIODE 1A 1N4007 or eq.</td>
<td>1</td>
</tr>
<tr>
<td>DIODE 1N4148 or eq.</td>
<td>1</td>
</tr>
<tr>
<td>NE555 TIMER</td>
<td>1</td>
</tr>
<tr>
<td>LED 5MM RED (not in schematics)</td>
<td>1</td>
</tr>
<tr>
<td>LEDS 5MM GREEN (not in schematics)</td>
<td>1</td>
</tr>
<tr>
<td>PROTO BOARD (approx 20 holes x 20 holes) or PCB to etch</td>
<td>1</td>
</tr>
</tbody>
</table>
<p>Besides the board and may be the 555, the rest is easily scavengeable.</p>
]]></content:encoded>
			<wfw:commentRss>http://leucos.lstilde.org/wp/2008/09/wrt54ggsgl-relay-mod/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Cisco serial cable pinout</title>
		<link>http://leucos.lstilde.org/wp/2008/09/cisco-serial-cable-pinout/</link>
		<comments>http://leucos.lstilde.org/wp/2008/09/cisco-serial-cable-pinout/#comments</comments>
		<pubDate>Sat, 27 Sep 2008 16:55:30 +0000</pubDate>
		<dc:creator>leucos</dc:creator>
				<category><![CDATA[electronics]]></category>
		<category><![CDATA[cable]]></category>
		<category><![CDATA[cisco]]></category>
		<category><![CDATA[db9]]></category>
		<category><![CDATA[serial]]></category>

		<guid isPermaLink="false">http://leucos.lstilde.org/wp/?p=42</guid>
		<description><![CDATA[Cisco serial cable pinout détails. So you grab take a bunch of cables in your closet and make something useful out of them.]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;">Here is the pinout for the standard Cisco serial console cable (DB9 &#8211; RJ45) like this one.</p>
<p style="text-align: center;"><a href="http://leucos.lstilde.org/wp/wp-content/uploads/2008/09/cisco_console.jpg"><img class="size-thumbnail wp-image-44 aligncenter" title="Cisco console cable" src="http://leucos.lstilde.org/wp/wp-content/uploads/2008/09/cisco_console.jpg" alt="" width="140" height="140" /></a>Note that DCD(1) and RI(9) are not wired.</p>
<p>This cable is quite handy when doing µcontroller stuff. Just put a RJ45 socket on your PCB our get a breakout board from <a title="RJ45 breakout" href="http://www.sparkfun.com/commerce/product_info.php?products_id=716" target="_blank">Sparkfun</a> and you can plug and unplug at will and securely.</p>
<p style="text-align: center;"><a href="http://leucos.lstilde.org/wp/wp-content/uploads/2008/09/rj45.gif"><img class="size-medium wp-image-45 aligncenter" title="rj45" src="http://leucos.lstilde.org/wp/wp-content/uploads/2008/09/rj45.gif" alt="" width="208" height="177" /></a></p>
<table border="1">
<tbody>
<tr>
<th>DB 9</th>
<th>Serial pin</th>
<th>Color</th>
<th>RJ 45</th>
</tr>
<tr align="center" bgcolor="#000000">
<td><span style="color: #ffffff;">8</span></td>
<td><span style="color: #ffffff;">CTS</span></td>
<td><span style="color: #ffffff;">Black</span></td>
<td><span style="color: #ffffff;">1</span></td>
</tr>
<tr align="center" bgcolor="#a06700">
<td>6</td>
<td>DSR</td>
<td>Brown</td>
<td>2</td>
</tr>
<tr align="center" bgcolor="#ff0000">
<td>2</td>
<td>RX</td>
<td>Red</td>
<td>3</td>
</tr>
<tr align="center" bgcolor="#ff8000">
<td>5</td>
<td>GND</td>
<td>Orange</td>
<td>4</td>
</tr>
<tr align="center" bgcolor="#ffff00">
<td>5</td>
<td>GND</td>
<td>Yellow</td>
<td>5</td>
</tr>
<tr align="center" bgcolor="#00ff00">
<td>3</td>
<td>TX</td>
<td>Green</td>
<td>6</td>
</tr>
<tr align="center" bgcolor="#0080ff">
<td>4</td>
<td>DTR</td>
<td>Blue</td>
<td>7</td>
</tr>
<tr align="center" bgcolor="#c0c0c0">
<td>7</td>
<td>CTS</td>
<td>Grey</td>
<td>8</td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://leucos.lstilde.org/wp/2008/09/cisco-serial-cable-pinout/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nikon D50/D70 IR remote control</title>
		<link>http://leucos.lstilde.org/wp/2008/09/nikon-d50d70-ir-remote-control/</link>
		<comments>http://leucos.lstilde.org/wp/2008/09/nikon-d50d70-ir-remote-control/#comments</comments>
		<pubDate>Sat, 27 Sep 2008 16:45:46 +0000</pubDate>
		<dc:creator>leucos</dc:creator>
				<category><![CDATA[electronics]]></category>
		<category><![CDATA[photo/video]]></category>
		<category><![CDATA[projects]]></category>
		<category><![CDATA[d50]]></category>
		<category><![CDATA[infrared]]></category>
		<category><![CDATA[nikon]]></category>
		<category><![CDATA[remote]]></category>

		<guid isPermaLink="false">http://leucos.lstilde.org/wp/?p=29</guid>
		<description><![CDATA[Nikon infrared remote control with some special features (interval shots, multiples shots, continuous shots, ...).]]></description>
			<content:encoded><![CDATA[<p align="left"><strong>The Project</strong></p>
<p align="left">After chasing the idea of building a remote for my D50, I found <a title="IR Remote Control" href="http://www.bigmike.it/ircontrol/">this</a> really interesting page with all you need (especially the IR timing) to get your remote up and running.</p>
<p align="left">But using a AtTiny2313 for this leaves a lot of room to play with. So I made an enhanced version with a 7-segments display and a menu system. The new firmware let&#8217;s you choose among several shooting modes.</p>
<p align="left">
<p align="left">
<p>The remote is almost identical to the BigMike&#8217;s one except :</p>
<ul>
<li>the firmware is, of course, modified</li>
<li>there is no On/Off button</li>
<li>there are two buttons for the menu (change/select)</li>
<li>there is a 7-segments display for the menu</li>
</ul>
<div id="attachment_32" class="wp-caption aligncenter" style="width: 209px"><a href="http://leucos.lstilde.org/wp/wp-content/uploads/2008/09/d50r_0.jpg"><img class="size-medium wp-image-32" title="Remote control" src="http://leucos.lstilde.org/wp/wp-content/uploads/2008/09/d50r_0-199x300.jpg" alt="Remote control" width="199" height="300" /></a><p class="wp-caption-text">Remote control</p></div>
<p>The firmware sets the Tiny2313 in sleep mode after 5 seconds of inactivity.<br />
In tis mode, the datasheet gives at most 2µA current usage. So, since a CR2032 yields 220 mAh, and if I didn&#8217;t mess up somehere, you should be up and running for 10 years.</p>
<p><strong>Modes description</strong></p>
<p>The remote offers 9 shot modes, which of course can be changed in the firmware.</p>
<p>Whatever the mode, the <em>dp</em> dot blinks everytime a &laquo;&nbsp;take shot&nbsp;&raquo; IR frame is sent.</p>
<ul>
<li>Single shot mode (symbol : reversed lower &#8216;c&#8217;) : one button press makes a single shot</li>
</ul>
<ul>
<li>Double shot mode (symbol : two horizontal dashes ) : one button press makes two shots in a row</li>
</ul>
<ul>
<li>Triple shot mode (symbol : three horizontal dashes ) : one button press makes three shots in a row</li>
</ul>
<ul>
<li>Continuous shot (symbol : lower &#8216;c&#8217;) : one  button press starts continuous shooting as fast as possible until the &#8216;menu&#8217; button is pressed again or the battery is dead <img src='http://leucos.lstilde.org/wp/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </li>
</ul>
<ul>
<li>Continuous shot every second (symbol : number 1) : one  button press starts shooting 1 picture per second until the &#8216;menu&#8217; button is pressed again or the battery is dead</li>
</ul>
<blockquote><p>Numbers 2, 5, 0 and 6 are also continuous shoot mode with 1 picture every 2, 5 10 and 60 seconds respectively.</p></blockquote>
<div id="attachment_33" class="wp-caption aligncenter" style="width: 209px"><a href="http://leucos.lstilde.org/wp/wp-content/uploads/2008/09/d50r_1.jpg"><img class="size-medium wp-image-33" title="Modes selection" src="http://leucos.lstilde.org/wp/wp-content/uploads/2008/09/d50r_1-199x300.jpg" alt="Modes selection" width="199" height="300" /></a><p class="wp-caption-text">Modes selection</p></div>
<p><strong>Files</strong></p>
<p>Wanna build yours ? You&#8217;ll need :</p>
<div id="attachment_35" class="wp-caption aligncenter" style="width: 310px"><a href="http://leucos.lstilde.org/wp/wp-content/uploads/2008/09/d50r_schematics.png"><img class="size-medium wp-image-35" title="Schematic" src="http://leucos.lstilde.org/wp/wp-content/uploads/2008/09/d50r_schematics-300x212.png" alt="Circuit schematic" width="300" height="212" /></a><p class="wp-caption-text">Circuit schematic</p></div>
<div id="attachment_34" class="wp-caption aligncenter" style="width: 223px"><a href="http://leucos.lstilde.org/wp/wp-content/uploads/2008/09/d50r_board.png"><img class="size-medium wp-image-34" title="Board" src="http://leucos.lstilde.org/wp/wp-content/uploads/2008/09/d50r_board-213x300.png" alt="Circuit board layout" width="213" height="300" /></a><p class="wp-caption-text">Circuit board layout</p></div>
<p>The core of the code (IR timing loop) is taken straight from <a title="IR Remote Control" href="http://www.bigmike.it/ircontrol/">BigMike&#8217;s</a> ASM source.</p>
<p><strong>Issues</strong></p>
<p>There are some issues in my version. I am not sure if they are firmware/hardware/ir issues. The problem is the reliability of triggering : sometimes it just doesn&#8217;t work. This does make the remote of reduced usability for continuous shooting modes where timing is critical.</p>
<p>I wonder where this problem comes from : IR receptor low sensitivity ? inaccurate frequency generation ? AF mode induced triggering problems in some situations ?<br />
Since I have relatively few hardware here (no friend with another D50, no oscilloscope, &#8230;) I didn&#8217;t dig it up for now.</p>
<p>And oh, BTW, the usual warnings apply : this remote can brick your MCU, destroy your Nikon, set your house on fire, etc&#8230; You&#8217;ve been warned !</p>
<p><strong>Thanks</strong></p>
<p>Big thanks to <a href="http://www.bigmike.it/ircontrol/" target="_blank">Bighignoli Michele</a>, <a href="http://www.jonas-diemer.de/english/projects/nikon-ir-remote-control.html" target="_blank">Jonas Diemer</a> and <a href="http://www.natemc.com/nikontrigger.php" target="_blank">Nate</a> who pioneered the area.</p>
<p>EDIT : I finally managed to put my hands back on the firmware ! You can grab the <a href="http://leucos.lstilde.org/wp/wp-content/uploads/2008/12/nikon_remote2asm.gz">ASM source</a> or the <a href="http://leucos.lstilde.org/wp/wp-content/uploads/2008/12/nikon_remote-2hex.gz">hex</a> file. Have fun !</p>
]]></content:encoded>
			<wfw:commentRss>http://leucos.lstilde.org/wp/2008/09/nikon-d50d70-ir-remote-control/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Maxim DS1803 Digital Potentiometer</title>
		<link>http://leucos.lstilde.org/wp/2008/09/maxim-ds1803-digital-potentiometer/</link>
		<comments>http://leucos.lstilde.org/wp/2008/09/maxim-ds1803-digital-potentiometer/#comments</comments>
		<pubDate>Sat, 27 Sep 2008 15:13:17 +0000</pubDate>
		<dc:creator>leucos</dc:creator>
				<category><![CDATA[chips]]></category>
		<category><![CDATA[electronics]]></category>
		<category><![CDATA[ds1803]]></category>
		<category><![CDATA[potentiometer]]></category>

		<guid isPermaLink="false">http://leucos.lstilde.org/wp/?p=23</guid>
		<description><![CDATA[I have to use this ADC in some project !]]></description>
			<content:encoded><![CDATA[<p>This is just a note to remember to use this cool chip one day.</p>
<p><a href="http://www.nearfuturelaboratory.com/2008/07/07/ds1803-digital-potentiometer/">http://www.nearfuturelaboratory.com/2008/07/07/ds1803-digital-potentiometer/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://leucos.lstilde.org/wp/2008/09/maxim-ds1803-digital-potentiometer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Texas Instruments TLC2554ID</title>
		<link>http://leucos.lstilde.org/wp/2008/09/texas-instruments-tlc2554id/</link>
		<comments>http://leucos.lstilde.org/wp/2008/09/texas-instruments-tlc2554id/#comments</comments>
		<pubDate>Sat, 27 Sep 2008 15:12:47 +0000</pubDate>
		<dc:creator>leucos</dc:creator>
				<category><![CDATA[chips]]></category>
		<category><![CDATA[electronics]]></category>
		<category><![CDATA[adc]]></category>
		<category><![CDATA[tlc2554]]></category>

		<guid isPermaLink="false">http://leucos.lstilde.org/wp/?p=20</guid>
		<description><![CDATA[I have to use this digital potentiometer in some project !]]></description>
			<content:encoded><![CDATA[<p>This is just a note to remember to use this cool chip one day.</p>
<p><a class="externalLink" title="External link to http://focus.ti.com/docs/prod/folders/print/tlc2554.html" href="http://focus.ti.com/docs/prod/folders/print/tlc2554.html" target="_blank">Product page<br />
</a></p>
]]></content:encoded>
			<wfw:commentRss>http://leucos.lstilde.org/wp/2008/09/texas-instruments-tlc2554id/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
