This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
en:tech:tonohmmeter [2020/10/14 12:13] – created bullar | en:tech:tonohmmeter [2022/09/26 10:00] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 39: | Line 39: | ||
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<< | ||
+ | TCCR1B = 0; // stop timer (no tone signal) | ||
+ | |||
+ | PORTA |= (1<< | ||
+ | DDRA |= (1<< | ||
+ | |||
+ | PORTA &= ~(1<< | ||
+ | |||
+ | // Address AD0..3 (bit15...12) | ||
+ | for (i=3; | ||
+ | PORTA ^= (1<< | ||
+ | if ((addr & (1<< | ||
+ | PORTA &= ~(1<< | ||
+ | else | ||
+ | PORTA |= (1<< | ||
+ | PORTA ^= (1<< | ||
+ | } | ||
+ | |||
+ | // Command C1,C0 (bit11,10) | ||
+ | PORTA ^= (1<< | ||
+ | PORTA &= ~(1<< | ||
+ | _delay_us(5); | ||
+ | PORTA ^= (1<< | ||
+ | _delay_us(5); | ||
+ | PORTA ^= (1<< | ||
+ | _delay_us(5); | ||
+ | PORTA ^= (1<< | ||
+ | |||
+ | // Data D9..0 (bit9..0) | ||
+ | DDRA |= (1<< | ||
+ | for (i=9; | ||
+ | PORTA ^= (1<< | ||
+ | if ((data & (1<< | ||
+ | PORTA |= (1<< | ||
+ | } else { | ||
+ | PORTA &= ~(1<< | ||
+ | } | ||
+ | PORTA ^= (1<< | ||
+ | } | ||
+ | |||
+ | PORTA |= (1<< | ||
+ | DDRA |= (1<< | ||
+ | |||
+ | TIMSK0 |= (1<< | ||
+ | TCCR1B |= (1<< | ||
+ | } | ||
+ | |||
+ | </ | ||
+ | |||
+ | 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, | ||
+ | |||
+ | ==== Downloads ==== | ||
+ | * {{: tech: Tonohmmeter_v11.c.zip | Firmware Source Code}} in C | ||
+ | * {{: tech: TonOhmMeter_HEX.zip | HEX files for fast programming}} | ||
+ | * {{: tech: Tonohmmeter.pdf | drilling template front side}} | ||
+ | * {{: tech: Tonohmmeter_bom.pdf | Equipment list (BOM)}} | ||
+ | * {{: tech: TonOhmMeter_BOTTOM.pdf | assembly plan back side}} | ||
+ | * {{: tech: TonOhmMeter_TOP.pdf | Assembly plan front side}} | ||
+ | |||
+ | ==== Links ==== | ||
+ | * [[http:// | ||
+ | * [[http:// | ||
+ | * [[http:// | ||
+ | * [[http:// | ||
+ | * [[http:// | ||
+ | * [[http:// | ||
+ | |||
+ | 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... | ||
+ | |||
+ | < | ||
+ | |||
+ | <form action=" | ||
+ | <input type=" | ||
+ | <input type=" | ||
+ | <img alt="" | ||
+ | </ | ||
+ | |||
+ | </ | ||