You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

270 lines
12 KiB

4 years ago
  1. \documentclass[11pt]{article}
  2. %Gummi|065|=)
  3. \usepackage{graphicx}
  4. \usepackage{caption}
  5. \usepackage{xcolor}
  6. \usepackage[vcentering,dvips]{geometry}
  7. \geometry{papersize={6in,9in},total={4.5in,6.8in}}
  8. %\title{\textbf{Door Alarm}}
  9. \author{Steak Electronics}
  10. \date{}
  11. \begin{document}
  12. %\maketitle
  13. %\tableofcontents
  14. \textcolor{green!60!blue!70}{
  15. \section{Attiny Solar Energy Harvest Tests}}
  16. I have the following:
  17. \begin{itemize}
  18. \item Solar panels
  19. \item Attiny 10
  20. \end{itemize}
  21. To this list, I will add a supercap, and an energy harvesting IC. The goal being to load the super cap during the day, and to run 24/7. I will need an exceptionally low power micro. The super cap will need to be about 3.3V or 5V.
  22. \textcolor{green!60!blue!70}{
  23. \subsection{Micro Considerations}}
  24. The Arduino Atmega328P is not an option. I'm looking to have a current draw of only 1mA max, (ideally 500uA) when active. Moteino is also not an option for this. Those are made for batteries. I want to be battery free. A super cap, however can be used to store energy. I'll get to that shortly.
  25. For micros, I have some Attiny10 on hand, and these have a reasonably low power pull in active mode. Let's build those up first. What will the micro do? No idea. I haven't a clue.
  26. \textcolor{green!60!blue!70}{
  27. \subsubsection{Micro Notes}}
  28. Must run at 1.8V / 1MHz per front page of data sheet, for 200uA draw in active mode.
  29. \\
  30. \\
  31. \textcolor{green!60!blue!70}{
  32. \subsection{Energy Storage}}
  33. I don't want a battery. Let's go with a super cap. The solar panels will only be active some of the time, so I will want to harvest energy with some kind of IC into the cap when the sun is out.\footnote{Reference: www.analog.com/media/en/technical-documentation/technical-articles/solarenergyharvesting.pdf is a start. I'll need to do more research.}
  34. \textcolor{green!60!blue!70}{ \subsection{Make parts, not scrap}} I will
  35. want to make sure that all parts I build are perf board parts, not
  36. breadboard scrap (to be torn down and rebuilt again). This is an Attiny,
  37. so no need to test much, yet.
  38. \textcolor{green!60!blue!70}{
  39. \subsection{Programming}}
  40. To program the Attiny10, I'll use the Arduino adapter from the Junk + Arduino blog. I built it up\footnote{Had slight error where the Arduino + board wouldn't read - pins too short on headers, then the arduino wouldn't boot - due to bad connection on perf board shield. Thankfully, the USB port didn't try to run. Protection circuitry cut in on the laptop.}, and was able to Read the memory. In order to upload to the board, you will need a compiler setup. You can possibly do it in AVRGCC, but instead I opted for either Arduino IDE (via Attiny10Core which didn't work), and then went to Mplab. In order for mplab 5.25 to work, it will need XC8 compiler, and there is a pack that can be downloaded through the IDE to get Attiny10 support.
  41. It appears the AVR Dragon (which I have) can not be used. However, other programmers can be used. Pickit 4, Mkavrii, stk600, I think.
  42. \textcolor{green!60!blue!70}{ \subsubsection{Testing Arduino Loader}}
  43. Tested this with the blink\_LED.c in code folder. The code is as simple as possible.
  44. It is the following:
  45. \begin{verbatim}
  46. //#include <xc.h>
  47. #include <avr/io.h>
  48. #include <util/delay.h>
  49. int main(void)
  50. {
  51. // PB2 output
  52. DDRB = 1<<2;
  53. while(1)
  54. {
  55. // Toggle PB2
  56. PINB = 1<<2;
  57. _delay_ms(500);
  58. }
  59. }
  60. \end{verbatim}
  61. When programmed in Mplab, with XC8 compiler, and Attiny10 support, I get the following
  62. hex output:
  63. \begin{verbatim}
  64. :100000000AC020C01FC01EC01DC01CC01BC01AC01B
  65. :1000100019C018C017C011271FBFCFE5D0E0DEBF41
  66. :0A002000CDBF03D000C0F894FFCF5D
  67. :10002A0044E041B940B95FE966E871E05150604087
  68. :0A003A007040E1F700C00000F5CFB0
  69. :02004400DDCF0E
  70. :00000001FF
  71. \end{verbatim}
  72. The content of this hex isn't the focus of this passage. Instead, I want you to review the
  73. results of a D for Dump Memory, by the Arduino Loader.
  74. \begin{verbatim}
  75. Current memory state:
  76. registers, SRAM
  77. +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +A +B +C +D +E +F
  78. 0000: 05 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  79. 0010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  80. 0020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  81. 0030: 00 00 00 00 00 00 03 00 00 79 00 03 00 00 00 00
  82. 0040: B7 AD AE FA 58 70 63 6B FB 5A B4 1B FF FF 35 3F
  83. 0050: 67 D7 33 43 DF 5F FB 72 C9 7D FE E9 9D C5 00 12
  84. NVM lock
  85. +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +A +B +C +D +E +F
  86. 3F00: FF FF
  87. configuration
  88. +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +A +B +C +D +E +F
  89. 3F40: FF FF
  90. calibration
  91. +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +A +B +C +D +E +F
  92. 3F80: 79 FF
  93. device ID
  94. +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +A +B +C +D +E +F
  95. 3FC0: 1E 90 03 FF
  96. program
  97. +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +A +B +C +D +E +F
  98. 4000: 0A C0 20 C0 1F C0 1E C0 1D C0 1C C0 1B C0 1A C0
  99. 4010: 19 C0 18 C0 17 C0 11 27 1F BF CF E5 D0 E0 DE BF
  100. 4020: CD BF 03 D0 00 C0 F8 94 FF CF 44 E0 41 B9 40 B9
  101. 4030: 5F E9 66 E8 71 E0 51 50 60 40 70 40 E1 F7 00 C0
  102. 4040: 00 00 F5 CF DD CF FF FF FF FF FF FF FF FF FF FF
  103. 4050: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
  104. 4060: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
  105. (...some memory omitted here for brevity...)
  106. 43E0: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
  107. 43F0: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
  108. \end{verbatim}
  109. Notice that the "AC020C01F" is set. That is from the hex. But the 01000...
  110. before it seems to be missing. Some deciphering of how the Arduino programs
  111. the Attiny is in order here. It also doesn't end the same.
  112. Regardless, when programming, the Arduino reports 70 bytes written, and
  113. likewise in the Mplab project memorymap.xml file, it also notes 70 bytes
  114. for the sketch. This lines up.\footnote{Although for an unknown reason, every command registers twice on the Arduino serial monitor, but this appears to be harmless.}
  115. The blinking LED works. Let's move on.
  116. \textcolor{green!60!blue!70}{\subsubsection{Conclusion on Arduino Programming Attiny10}}
  117. It's possible, but you have to make a dedicated jig (almost), so it might be easier to use the official programming tools. However, based on this https://www.avrfreaks.net/forum/pickit-4-and-avr-mcu I might not have a choice. So I will use the Arduino for now. But will have to devise what on board parts are req'd for programming, and incorporate into proto board layout.
  118. \textcolor{green!60!blue!70}{ \subsubsection{IO Port Switching Speed}}
  119. Using the above code without any delay\_ms, I get the following results from a default clock
  120. speed, and a 128KHz clock speed. This test was done to confirm that I could change the clock with
  121. \begin{verbatim}
  122. //Write CCP
  123. CCP = 0xD8;
  124. //change CLK to 128KHz
  125. CLKMSR = 0b01;
  126. \end{verbatim}
  127. There was no issue.
  128. \begin{verbatim}
  129. Default CLK (8MHz? or 1MHz?): 160KHz IO Switch
  130. 128KHz CLK: 2.5KHz IO Switch
  131. \end{verbatim}
  132. I am going to pursue 128KHz for starters, for lower current dissipation. Note that with the Arduino loader, it is cumbersome to test and change code as you move along. It is
  133. therefore going to be necessary to use a programmer, with a dedicated header on board.
  134. \textcolor{green!60!blue!70}{ \subsubsection{VCC 1.8V}}
  135. The lowest power supported: 1.8V can be applied, without any configuration
  136. needed. It does not affect IO switching speed (although obviously amplitude is affected).
  137. \begin{verbatim}
  138. 128KHz CLK (5.0V): 2.5256 KHz IO switch
  139. 128KHz CLK (3.3V): 2.5477 KHz IO switch
  140. 128KHz CLK (1.8V): 2.5849 KHz IO switch
  141. \end{verbatim}
  142. As voltage drops, IO increases.
  143. \\
  144. \\
  145. \textbf{VCC Dropout voltage:}
  146. \\
  147. From 1.5, it drops out at 1.248V or so. Comes back at about 1.34V
  148. \\
  149. \\
  150. Test size of 1.
  151. \\
  152. \\
  153. Can't run this with one (AA) battery, but you could with 2.
  154. \\
  155. \\
  156. Current Draw: 128KHz - IO test, 1.8V, 0.08mA (~78uA) (tested w/3478A)
  157. \\
  158. \\
  159. \textcolor{green!60!blue!70}{\subsection{Application}}
  160. First, I need a board for these and a programmer, to quickly program. Second, I need an application. I want extremely low power. Hopefully, solar with no batteries, to start. This is extremely low - that is the point. Let's keep this ridiculous.
  161. Given the power requirements put me under 1mA (with my current panels), I'm considering the following: EEPROMs would require SPI protocol. Doable, but overcomplicated for now.
  162. \\
  163. \\
  164. Eink (need to find a small and cheap enough option. So far, they have either too many pins, and/or use too much current. Something like what stores use to display prices would work, but that doesn't get the data out, only makes it readable.),
  165. \\
  166. \\
  167. Third option would be RF. That is a viable path, but not today. Let's skip that for now.
  168. \\
  169. \\
  170. Fourth option that comes to mind is IR. IR diodes, as in TV remotes, would work well here. I am choosing this as the first project. I will have dumb clients, that consist of - Attiny / IR / Sensor powered by solar. I will have a BBB that receives the IR data, and does all intelligent data gathering. To keep things simple, the IR will be binary ADC data, or otherwise sensor numbers. No SPI, no protocol complexity. That would require space on the Attiny.
  171. \\
  172. \\
  173. Let's build some boards based on the above.
  174. \\
  175. \\
  176. For sensors:
  177. While building, I came across an option. Hall effect sensors. I think also capacitive sensors can be used. This may find a use in a gate sensor, for when a driveway gate is opened or closed. With a small battery, it would work for years.
  178. Footprints: I had to make a footprint for this module on board package for one sensor. The solution to get footprints right? copy graphic image and make it into silkscreen on the board. Easy.
  179. The sensor I looked at was a temp and humidity sensor SHT11 (SHT10 is obsolete). It is low power enough. However, it's \$20. So not in my price range. Otherwise, it would work here. Looks like communication is a shift register, or SPI.
  180. \textcolor{green!60!blue!70}{
  181. \subsubsection{Magnetic Current Sensor}}
  182. There is this:
  183. BM14270AMUV-LB
  184. Which is low enough current here (<1mA). But \$7 in qty, and req's I2C. Not today.
  185. \textcolor{green!60!blue!70}{
  186. \subsubsection{Accelerometers}}
  187. These are an option.
  188. Best pinout (for deadbug) is LIS344ALHTR (but lacks vcc down to 1.8)
  189. 2nd Best pinout with full 1.8 -3.6 vcc is ADXL337BCPZ-RL7
  190. (Keep in mind, these are low end options only)
  191. (Analog output only. keep it simple for now.)
  192. Runner up to all above, is KXTC9-2050-FR . But has worse pinout.
  193. Going with AD part. \$5 in single qty.
  194. Digital output Accelmeters are cheaper.
  195. All have tiny package sizes.
  196. Since I am grabbing 1 output only, will need to orient or choose correct output.
  197. \textcolor{green!60!blue!70}{
  198. \subsubsection{Temperature Sensors}}
  199. Temperature can be boring, but why not. Let's throw one of these on: LMT84LP . Pin compatible with LM35. Supply current is maybe 8uA. Extremely low.
  200. LM84 (1.5V starts, to 5.5), LM85 (1.8V to 5.5)
  201. \textcolor{green!60!blue!70}{
  202. \subsubsection{Gas Sensors}}
  203. Lowest is 5mV as of writing on dkey. Skipping. The SHT would work, but its too expensive.
  204. \textcolor{green!60!blue!70}{
  205. \subsubsection{Supercap}}
  206. For now, trying this:
  207. FG0V155ZF
  208. \textcolor{green!60!blue!70}{
  209. \subsubsection{Hall Effect Sensors - Push Pull vs Open Drain Outputs}}
  210. \begin{verbatim}9.1.1OutputTypeTradeoffsThe push-pulloutputallowsfor the lowestsystempowerconsumptionbecausethereis no currentleakagepathwhenthe outputdriveshighor low. The open-drainoutputinvolvesa leakagepaththroughthe externalpullupresistorwhenthe outputdriveslow.The open-drainoutputsof multipledevicescan be tied togetherto forma logicalAND.In this setup,if any sensordriveslow, the voltageon the sharednodebecomeslow. Thiscan allowa singleGPIOto measurean arrayofsensors
  211. \end{verbatim} From DRV5032 data sheet.
  212. \textcolor{green!60!blue!70}{
  213. \subsection{Starting Sensors}}
  214. So as a recap, to start with affordable, low power sensors for my project, I have the following types:
  215. \begin{itemize}
  216. \item Temp sensor (cheapest)
  217. \item Magnetic Sensor (hall effect)
  218. \item Movement Sensor (accellerometer) (analog output) (tiny package)
  219. \item capacitive sensor (azoteq)(may only be short range)
  220. \end{itemize}
  221. And then output is currently IR via diode. Future output would be RF.
  222. \end{document}