Site Tools


en:tech:tonohmmeter

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
en:tech:tonohmmeter [2020/10/14 12:13] – created bullaren:tech:tonohmmeter [2026/08/12 14:01] (current) claude
Line 2: Line 2:
  
 ==== Motivation ==== ==== Motivation ====
-{{: tech: tonohmmeter.jpg? direct & 200 | The finished Tonohmeter}}+{{ :media:tech:tonohmmeter:tonohmmeter.jpg?direct&200 |The finished Tonohmeter}}
 Everyone knows the problem that circuits or wiring do not work due to short circuits or interruptions. The domestic multimeter offers a continuity tester that acoustically reveals a low-resistance connection. It only becomes difficult if the location of the short circuit does not reveal itself immediately. A tonohmmeter can be used for such cases. This means that the measured resistance is mapped to the associated pitch. The smaller the resistance, the higher the tone. If the measuring range is sensitive enough, you can get closer to the cause. Everyone knows the problem that circuits or wiring do not work due to short circuits or interruptions. The domestic multimeter offers a continuity tester that acoustically reveals a low-resistance connection. It only becomes difficult if the location of the short circuit does not reveal itself immediately. A tonohmmeter can be used for such cases. This means that the measured resistance is mapped to the associated pitch. The smaller the resistance, the higher the tone. If the measuring range is sensitive enough, you can get closer to the cause.
  
Line 17: Line 17:
  
 ==== Measuring principle ==== ==== Measuring principle ====
-{{: tech: hantek69_1.jpg? direct & 200 | measurement signal}}+{{ :media:tech:tonohmmeter:hantek69_1.jpg?direct&200 |measurement signal}}
 The resistance is measured via the voltage drop. In order to be able to carry out measurements within circuits, a square-wave signal with approx. 340mV (the usual ESD structures of the ICs do not open) is released onto the unknown resistor. The resulting voltage drop is then amplified and rectified via OpAmps. The AVR does the AD conversion and audio output. The resistance is measured via the voltage drop. In order to be able to carry out measurements within circuits, a square-wave signal with approx. 340mV (the usual ESD structures of the ICs do not open) is released onto the unknown resistor. The resulting voltage drop is then amplified and rectified via OpAmps. The AVR does the AD conversion and audio output.
  
 ==== Hardware ==== ==== Hardware ====
-{{: tech: schematic_tonohmmeter.png? direct & 200 | Schematic of the TonOhmMeter}} +{{ :media:tech:tonohmmeter:schematic_tonohmmeter.png?direct&200 |Schematic of the TonOhmMeter}} 
-{{: tech: tonohmmeter_offen.jpg? direct & 200 | The hardware of the tonohmeter}}+{{ :media:tech:tonohmmeter:tonohmmeter_offen.jpg?direct&200 |The hardware of the tonohmeter}}
  
 ==== Power supply ==== ==== Power supply ====
Line 35: Line 35:
 The device is only operated via one key (U1). The hardware debouncing (C8 / R3 / R4) avoids the otherwise necessary software. The measuring range is displayed via three LEDs (LED2-4) and the sound output is performed by a small loudspeaker that is capacitively connected to the digital port. That is enough for simple tones. After all, we don't want to output MP3. The device is only operated via one key (U1). The hardware debouncing (C8 / R3 / R4) avoids the otherwise necessary software. The measuring range is displayed via three LEDs (LED2-4) and the sound output is performed by a small loudspeaker that is capacitively connected to the digital port. That is enough for simple tones. After all, we don't want to output MP3.
 ==== PCB ==== ==== PCB ====
-{{: tech: tonohmmeter_pcb.png? direct & 100 | The circuit board of the tonohmeter}}+{{ :media:tech:tonohmmeter:tonohmmeter_pcb.png?direct&100 |The circuit board of the tonohmeter}}
  
 Since I liked the handheld housing from HAMMOND, it was difficult to find a LiPo that was the right size. Unfortunately I only found one for the front, so the board got a bit tight and is populated on both sides. At one end are the two jack sockets for the measuring strips and at the bottom the charging socket with charge indicator. The unused routing area is designed as a ground area. The AVD-ISP connection can be seen on the left, which enables us to do on-board programming. Since I liked the handheld housing from HAMMOND, it was difficult to find a LiPo that was the right size. Unfortunately I only found one for the front, so the board got a bit tight and is populated on both sides. At one end are the two jack sockets for the measuring strips and at the bottom the charging socket with charge indicator. The unused routing area is designed as a ground area. The AVD-ISP connection can be seen on the left, which enables us to do on-board programming.
  
 +==== Software ====
 +The program needs less than 2K which is why an ATTINY24 would be sufficient. Because of that - you never know - I took the ATTINY44 anyway. The program development as usual in C on AVR Studio6 and debugged with AVR-DRAGON.
 +
 +The SPI interface to the programmable resistor (POT) has done a little work. On the one hand, the POT requires a bidirectional data pin (SDI and SDO together) and, on the other hand, I could not abuse the USI because it was on unfavorable ports.
 +The S/W emulation then looks like this:
 +
 +<code C>
 +// SPI write emulation (with SDI/SDO multiplexing)
 +void SPI_write(uint8_t addr, uint16_t data)  {
 + TIMSK0 &= ~(1<<OCIE0B); // Stop 1KHz (PA6)
 + TCCR1B = 0; // stop timer (no tone signal)
 +
 + PORTA |= (1<<PA6) | (1<<PA4); // SCK=SDIO HIGH
 + DDRA |= (1<<PA6) | (1<<PA4); // SCK+SDIO to output
 +
 + PORTA &= ~(1<<PA2); // CS low
 +
 + // Address AD0..3 (bit15...12)
 + for (i=3;i>=0;i--) {
 + PORTA ^= (1<<PA6); // SCK = LOW
 + if ((addr & (1<<i)) == 0)
 + PORTA &= ~(1<<PA4);
 + else
 + PORTA |= (1<<PA4);
 + PORTA ^= (1<<PA6); // SCK = HIGH
 + }
 +
 + // Command C1,C0 (bit11,10)
 + PORTA ^= (1<<PA6); // SCK = LOW
 + PORTA &= ~(1<<PA4); // Data = LOW
 + _delay_us(5);
 + PORTA ^= (1<<PA6); // SCK = HIGH
 + _delay_us(5);
 + PORTA ^= (1<<PA6); // SCK = LOW
 + _delay_us(5);
 + PORTA ^= (1<<PA6); // SCK = HIGH
 +
 + // Data D9..0 (bit9..0)
 + DDRA |= (1<<PA4); // set SDIO to output
 + for (i=9;i>=0;i--) {
 + PORTA ^= (1<<PA6); // SCK = LOW
 + if ((data & (1<<i)) != 0) {
 + PORTA |= (1<<PA4);
 + } else {
 + PORTA &= ~(1<<PA4);
 + }
 + PORTA ^= (1<<PA6); // SCK = HIGH
 + }
 +
 + PORTA |= (1<<PA2); // CS to HIGH
 + DDRA |= (1<<PA4); // SDIO to output
 +
 + TIMSK0 |= (1<<OCIE0B); // Restart 1KHz (PA6)
 + TCCR1B |= (1<<WGM12) | (1<<CS11); // Restart TIMER with CLK/8
 +}
 +
 +</code>
 +
 +The complete program can be found in the download area below.
 +
 +==== Operation ====
 +The device is switched on by pressing the button. For the first two seconds, the charge status of the battery is shown by the three yellow LEDs (3 LEDs at> 75%, 2 LEDs> 50% and one above 25%). If the battery capacity is below 25%, it must first be recharged. The circuit remains in sleep mode. After a successful start, an acknowledgment tone sounds for 2 seconds and the device is ready for use. The measured resistance value is converted into a suitable frequency from 500Hz to 2 KHz - provided it is in the measuring range - output. The measuring range is changed by pressing the button again. If you keep the button pressed for more than 2 seconds, the device switches to sleep mode and switches off.
 +
 +==== Manufacturing ====
 +Although mainly SMD components are used due to the lack of space, the board can be easily soldered. I soldered the back with the SMD components using the pizza pan method of the c't hacks. The front with the controls then hold by hand. In order to fit into the housing, the 2x3 post connector must be shortened by hand.
 +A bit of drilling and filing is required for the case. A drilling template is available in the download area to help you.
 +
 +==== Outlook ====
 +True to the motto: a finished software is outdated, the current S / W version has the basic functions described but can always be improved. Incidentally, the power requirement in operation without sound output is approximately 13 mA, with sound output 23 mA. Stand-by hits with 215uA. So you can get by for half a year without reloading. In continuous operation you probably get 2-3 days. The practical test at home will hopefully confirm this.
 +
 +==== Downloads ====
 +  * {{ :media:tech:tonohmmeter:tonohmmeter_v11.c.zip | Firmware Source Code}} in C
 +  * {{ :media:tech:tonohmmeter:tonohmmeter_hex.zip | HEX files for fast programming}}
 +  * {{ :media:tech:tonohmmeter:tonohmmeter.pdf | drilling template front side}}
 +  * {{ :media:tech:tonohmmeter:tonohmmeter_bom.pdf | Equipment list (BOM)}}
 +  * {{ :media:tech:tonohmmeter:tonohmmeter_bottom.pdf | assembly plan back side}}
 +  * {{ :media:tech:tonohmmeter:tonohmmeter_top.pdf | Assembly plan front side}}
 +
 +==== Links ====
 +  * [[http://www.heise.de/hardware-hacks/artikel/SMD-Loeten-in-der-Pizzapfanne-1276166.html]] SMD soldering with simple means
 +  * [[http://www.reichelt.de]] Almost all components are from there
 +  * [[http://shop.lipopower.de/1050-mAh-Einzelzelle-1C-30mm]] The LiPo of my choice
 +  * [[http://shop.lipopower.de/PCB-2-A-1-Zelle-Lipo-LiFePO-137]] The LiPO protection PCB
 +  * [[http://www.schnepp-neudenau.de/img/katalog.pdf]] The solderable measuring tip
 +  * [[http://www.fischer-leiterplatten.de]] The PCB maker
 +
 +The circuit board can be obtained from me at cost price of EUR 7.00 (as long as the sample stock lasts).
 +
 +==== Donate ====
 +
 +If you like my articles feel to donate a cappuccino or so...
 +
 +<html>
 +
 +<form action="https://www.paypal.com/donate" method="post" target="_top">
 +<input type="hidden" name="hosted_button_id" value="49N24HL36GF9U" />
 +<input type="image" src="https://www.paypalobjects.com/en_US/DK/i/btn/btn_donateCC_LG.gif" border="0" name="submit" title="PayPal - The safer, easier way to pay online!" alt="Donate with PayPal button" />
 +<img alt="" border="0" src="https://www.paypal.com/en_DE/i/scr/pixel.gif" width="1" height="1" />
 +</form>
 +
 +</html>
  
en/tech/tonohmmeter.1602677628.txt.gz · Last modified: (external edit)