PaxInstruments / t400-electronics

Electronics for the Pax Instruments T400 temperature datalogger
20 stars 9 forks source link

Add 4.7k pulldown to VBUS input #188

Closed cibomahto closed 9 years ago

cibomahto commented 9 years ago

Unfortunately, when USB is disconnected and the device is powered from battery, there is a small amount of leakage through the battery charging circuit that leaves a residual voltage of 3.7V or so on the VUSB line. This prevents the VUSB input on the processor from being able to determine if the device is plugged in or not.

The most straightforward thing to do here is add a small pulldown resistor to bleed this current down. VUSB needs to be <1.4V for the processor to detect it as disconnected. Some quick experimentation shows that a 4.7k resistor drops the voltage to .37v, which means it creates a load of ~80uA on the battery at all times. Increasing the resistance to 11k raises the voltage to .8v but only drops the load to 72uA, so sticking with something around 4.7k is probably the best compromise between detection capability and battery life. screen shot 2015-08-14 at 6 14 36 pm screen shot 2015-08-14 at 6 15 23 pm

charlespax commented 9 years ago

Version 0.13 has a 10k resistor. Change this to 4.7k.

screen shot 2015-09-28 at 15 35 57