├── doc ├── BOM.ods ├── schematic.pdf └── usage.txt ├── etc └── PowerEver_Enclosure_3D_PLA.zip ├── README.md ├── License.txt └── src └── powerever.bas /doc/BOM.ods: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/klui-freiberg/PowerEver/HEAD/doc/BOM.ods -------------------------------------------------------------------------------- /doc/schematic.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/klui-freiberg/PowerEver/HEAD/doc/schematic.pdf -------------------------------------------------------------------------------- /etc/PowerEver_Enclosure_3D_PLA.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/klui-freiberg/PowerEver/HEAD/etc/PowerEver_Enclosure_3D_PLA.zip -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ### What is PowerEver and why we need it 2 | 3 | PowerEver turns your mobile phone power banks into a universal 5 V to use with your electronic circuits and other favorite devices. 4 | -------------------------------------------------------------------------------- /License.txt: -------------------------------------------------------------------------------- 1 | The project is released under the MIT License 2 | 3 | MIT License 4 | 5 | Copyright (c) 2020 Pichanon Suwannathada, Lambda Nu Co. Ltd. 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation 8 | files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, 9 | modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 14 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 15 | BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF 16 | OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 17 | 18 | -------------------------------------------------------------------------------- /doc/usage.txt: -------------------------------------------------------------------------------- 1 | # Using your PowerEver! 2 | 3 | Before start using PowerEver, please make sure that you are using it with a 5V USB port of your power bank 4 | and not 12V port available in some power banks, otherwise the unit will be permanently damaged. 5 | 6 | Connect the unit between a power bank and a target electronic boards to be powered using an appropriate cable 7 | e.g. USB - Micro USB. For a direct electrical wire connection, use a USB to 5p screw terminal adapter by connecting 8 | plus (+) and minus (-) terminal poles. Most of the power banks will now supply a power continuously without shutting down. 9 | 10 | However, if the unit still keep shutting down, shortly press a push button switch on the backside one or more time 11 | (each time about 1 mA more current will be drawn) then re-connect with the power bank again. Repeat this step until 12 | the power bank becomes on permanently. 13 | 14 | Note 15 | 16 | - Pressing the button longer than a few seconds will revert the previous action (status LED blinks 2 times). 17 | - LED will blink 5 times if the lower and upper limits of the adjustment have been reached. 18 | - It is recommended to reduce the unit’s current consumption step by step while keep your system running to minimize 19 | unnecessary power loss. 20 | 21 | Resetting Factory Default 22 | 23 | Remove the unit from the power bank, keep pressing the push button, connect it to the power bank and wait until the LED 24 | is blinking 5 time then release the button. The unit will now in a default factory setup state that should work fine 25 | for a majority of power banks in the market. 26 | 27 | Thank you for choosing and using PowerEver! 28 | 29 | Doc Rev. 1 6/2020 30 | -------------------------------------------------------------------------------- /src/powerever.bas: -------------------------------------------------------------------------------- 1 | 'PowerEver 1.0 (aka LambdaNu PBS-1) leaded by Dr-Ing. Pichanon Suwannathada, Lambda Nu Co. Ltd. 2 | 'Released under the MIT License on 9-JULY-2020 3 | 'Imagine | Invent | Innovate @Lambda Nu Co. Ltd. 4 | 5 | '****** MIT LICENSE ****** 6 | 'Permission is hereby granted , free of charge , to any person obtaining a copy of this software and associated documentation 7 | 'files (the "Software"), to deal in the Software without restriction , including without limitation the rights to use , copy , modify , merge, 8 | 'publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so. 9 | 'The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 10 | 11 | 'THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 'IMPLIED, INCLUDING BUT NOT LIMITED TO 12 | 'THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 13 | 'AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 14 | 'OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | $regfile = "attiny13a.dat" 17 | $crystal = 1200000 18 | 19 | $hwstack = 40 20 | $swstack = 6 21 | $framesize = 6 22 | 23 | config PORTB.0 = input 24 | config PORTB.3 = output 25 | config PORTB.4 = output 26 | 27 | config Timer0 = Timer , prescale = 8 28 | 29 | on timer0 timer0_isr 30 | 31 | bt_learn alias PINB.0 32 | pwm_out alias PORTB.4 33 | led_status alias PORTB.3 34 | 35 | const duty = 15 36 | const PERIOD = 27 37 | const duty_addr = 13 38 | 39 | dim w as word 40 | dim b as word 41 | dim cduty as byte 42 | dim xduty as byte 43 | dim dw as word 44 | dim n as byte 45 | 46 | portb.0 = 1 47 | 48 | if bt_learn = 0 then 49 | b = 0 50 | do 51 | wait 1 52 | incr b 53 | loop until b >= 3 or bt_learn = 1 54 | if b >= 3 then 55 | gosub fac_reset 56 | bitwait bt_learn , set 57 | end if 58 | end if 59 | 60 | readeeprom xduty , duty_addr 61 | 62 | if xduty = 255 then xduty = duty 63 | 64 | b = 0 65 | cduty = 99 66 | tcnt0 = 6 67 | start timer0 68 | enable timer0 69 | enable interrupts 70 | 71 | do 72 | led_status = 1 73 | if bt_learn = 0 then 74 | waitms 50 75 | if bt_learn = 0 then 76 | w = 0 77 | do 78 | waitms 10 79 | incr w 80 | loop until w >= 98 or bt_learn = 1 81 | if w >= 98 then 82 | if xduty > 0 then 83 | decr xduty 84 | writeeeprom xduty , duty_addr 85 | led_status = 0 86 | waitms 50 87 | led_status = 1 88 | waitms 150 89 | led_status = 0 90 | waitms 50 91 | led_status = 1 92 | else 93 | gosub blink5 94 | end if 95 | else 96 | if xduty < 100 then 97 | incr xduty 98 | writeeeprom xduty , duty_addr 99 | led_status = 0 100 | waitms 100 101 | led_status = 0 102 | else 103 | gosub blink5 104 | end if 105 | end if 106 | bitwait bt_learn , set 107 | end if 108 | end if 109 | loop 110 | 111 | end 112 | 113 | timer0_isr: 114 | tcnt0 = 6 115 | incr b 116 | dw = PERIOD * 5 117 | if b >= dw then 118 | b = 0 119 | incr cduty 120 | if cduty >= 100 then cduty = 0 121 | if xduty > 0 and cduty < xduty then pwm_out = 0 else pwm_out = 1 122 | end if 123 | return 124 | 125 | fac_reset: 126 | xduty = duty 127 | writeeeprom xduty , duty_addr 128 | gosub blink5 129 | return 130 | 131 | blink5: 132 | for n = 1 to 5 133 | led_status = 1 134 | waitms 150 135 | led_status = 0 136 | waitms 150 137 | next 138 | return 139 | --------------------------------------------------------------------------------