Had a good long think about how the cellar hands currently need the system to work so I can better customise the system for them, there seem to be a few basic actions required and these are really quite simple
- First thing they will normally do is scan a barcode, eg a job sheet barcode or a vessel barcode or a lab barcode etc which needs to go back to the factory processing system to be verified as a valid barcode and then have the status of the job, lab test, vessel etc checked to see what actions can be done on it.
- The next thing is to present and allow the user to pick one of these actions, which usually involve entering some data or a time or date or status
- For some options we may require a supervisor so we need to be able to check the users RFID tag and verify their identity before allowing the option to be chosen
- After this the system generally should go to sleep until the next time.
Wow its that simple and a few things spring to mind which is why bother with both a power switch and a scan button, lets just combine it such that the button switches on the terminal and initiates a scan immediately while simultaneously connecting to the WIFI, and once its done, wait a minute or so and power everything off.
This gets rid of a switch (and another pesky cut-out in the case!) and also saves having to micro manage the low power modes on each device too critically (Remember we have the TFT, RFID, CPU, WiFi, 5V reg & Barcode drawing power) more so, it can easily be done with a couple of MOSFETS and resistors as below.
So how does it work? Well, Q1 and the diode D1 are already in the circuit and they arbitrate what powers the circuit, when it is not connected to the USB Charger then Q1 allows the battery to power the circuit, when on USB Power then power is routed through D1 and the battery is effectively disconnected (allowing it to be charged without drawing current).
Q2 is normally switched off by the 100K R1 resistor holding the gate high and thus no power is drawn (except the leakage of Q2 which is lower than the batteries self resistance so effectively its off)
Pressing the power on button sets Q2’s gate low and Q2 switches on powering the LDO’s and thus powering the PIC32, immediately the PIC is powered on it must assert Port F5 high and Q3 will effectively take over from the switch shorting Q2 gate to ground and keeping on the power when the button is released. R2 is required as the PIC32 pin effectively floats when no power is connected and we need it normally off.
When were done we simply set Port F5 low and everything powers off.
Sounds like a plan!