Difference between revisions of "MicroBoSL"
Line 136: | Line 136: | ||
In looking at the current BOM of the microBoSL there are quite a number of central components which are out of stock for some months. Therefore some alternate parts will need to be found, preferably these will be drop in replacements. | In looking at the current BOM of the microBoSL there are quite a number of central components which are out of stock for some months. Therefore some alternate parts will need to be found, preferably these will be drop in replacements. | ||
+ | |||
+ | The 9V tolerant input was accomplished with two TPS709 LDOs, these regulators were chosen since they have reverse current protection, that is that current does not flow backwards through them. Hence they may be used as a replacement for the MAX40203 ideal diodes which have become out of stock. One LDO is used for USB power and one for the Battery. <br> | ||
+ | The motor switching was accomplished with the ZXBM210-S H bridge controller. This accepts power directly from the battery to control the motor. It also has PWM speed control which can be used with the ATmega's PWM pins. | ||
+ | The on off switch was implemented next. The reset button was replaced with reset pads which need to be shorted with a screwdriver or the like to activate. A SPST switch is now placed in the battery line. We still want the RTC to be active even when this switch is off, so the battery backup of the RTC was connected to a high impedance voltage divider which draws only 1 μA at with a fully charged battery yet is still sufficient to operate the RTC. |
Revision as of 13:18, 27 April 2021
For schematics and design files please see: microBoSL Board rev0.1.0
Here we will document the design of the microBoSL board, a miniaturized version of the BoSL board optimised for automatic pumping operations.
Changes include:
- Smaller size, no more than 14 mm in width
- Integrated MOSFET for pumping operations
- Reduced connectivity
- Add connection for wake and pump counting hall effect sensors
- o-ring circuit for USB or battery powering.
To do this many components will have their parts changed to a smaller footprint version.
These substitutions include:
- Many passives -> mostly 0402
- ATmega328P-AU -> ATmega328P-MMH
- FT232RL -> FT232RQ
- 74HC126D -> 74HC126PW-Q100
- MCP7940NT-I/SN -> MCP7940NT-I/MNY
- MCP1700-3302E_SOT89 -> MCP1700-3302E_SOT23
Contents
20th January 2020
The micro BoSL is here:
A quick test reveals that programs are able to be uploaded to the device. This verifies the status of the MCU and the USB-TTL converter.
Next is to test the RTC. A quick test with indicates that this too is working well. An issue is had a bit with the LEDs. These tend to stay on even after the USB power is removed. This is an issue as it could cause extended power draw. A work around found was to hold the reset button for 3 seconds until all the LEDs turned off after this they did not seem to turn on again.
A test using the RTC persistence time keeping indicates that the board can operate on battery power hence, the o-ring and power delivery circuit does indeed work.
Now we need to test the MOSFET. Applying a 50 Ω load connected on the high side to 5V, the MOSFET was able to turn this on and off. Thus, the MOSFET is at least capable of driving a 100 mA load, and it is suspected that an even greater load is possible.
Notably what hasn't been tested is the pin interfaces on the external side of the device. This includes the hall effect sensors. However this is very simple circuitry, direct connections to Arduino pins, so issues should be had.
25th January 2021
The sleep quiescent current was also measured, using the Arduino low power library (RTC on). This was found to be 6.8 μA. In idle the current was about 4 mA. The O-ring circuit was also tested more thoroughly. It was found that at battery voltages below 5.3V, the board drew zero current from the battery, preferring to be powered via the USB.
3rd February 2021
A test was conducted to see how the microBoSL was able to perform in a pumping environment. To do this the BoSL FAL pump was connected to a water reservoir and an empty water container. The pumping program was uploaded to the microBoSL, with parameters: PumpEveryXMin = 1, DurationOfRun = 180, NumberOfSpins = 10. The microBoSL and pump were powered with a 4.2V li-ion battery. The hall effect sensor was connected directly up to the ports on the Pump was connected on the positive side through 4.2V and on the negative side to the MOSFET integrated into the microBoSL.
The test was ended at the 3 hour and 9 minute mark as the microBoSL had not finished on its own. It is uncertain if this was because of the inaccuracies of the internal clock. At the end of the a volume of 260 mL was pumped. Given that over this time the pump underwent approximately 1890 rotations the volume per rotation is 0.14 mL. This is in accordance with proper operation of the pump.
26th March 2021
Getting Started With the RTC
The microBoSL features an inbuilt MCP7940N-xSN RTC. This can be used for keeping real time and setting alarms to wake up the ATmega328p. The RTC communicates via I2C and an additional multi-function pin MFP, which is connected to digital interrupt pin 2 on the ATmega. This pin is mostly used for waking up the ATmega328p from sleep on a timed alarm. The RTC may be operated either via I2C commands or via a library. One such library is this one.
Below is some code helpful in getting started with the RTC it will be using the library mentioned above. The code sets the RTC to upload time and then uses an RTC alarm to wave the device from sleep every 15 seconds.
//Include RTC library #include <MCP7940.h> //Include low power library #include <LowPower.h> //initiate RTC class MCP7940_Class MCP7940; void setup() { delay(1000); //Set MFP to input pullup pinMode(2,INPUT_PULLUP); Serial.begin(9600); //Start RTC MCP7940.deviceStart(); //Set RTC time to code compile time MCP7940.adjust(); } //interrupt service routine when alarm activates void wake(){ detachInterrupt(digitalPinToInterrupt(2)); } void loop() { //create date object for alarm DateTime alarmtime; //create date object and get current time from RTC DateTime now = MCP7940.now(); //print current time Serial.print(F("RTC Time: ")); Serial.print(now.year()); Serial.print('/'); Serial.print(now.month()); Serial.print('/'); Serial.print(now.day()); Serial.print(' '); Serial.print(now.hour()); Serial.print(':'); Serial.print(now.minute()); Serial.print(':'); Serial.println(now.second()); //set alarm for 15 seconds from now alarmtime = now + TimeSpan(0,0,0,15); //set alarm 0 to go off when seconds match (argument 2 see library for other options) MCP7940.setAlarm(0,0,alarmtime,true); //flush serial buffer Serial.flush(); //add interrupt on pin 2 for MFP pin attachInterrupt(digitalPinToInterrupt(2), wake, LOW); //sleep LowPower.powerDown(SLEEP_FOREVER, ADC_OFF, BOD_OFF); //on alarm wakeup clear alarm MCP7940.clearAlarm(0); Serial.println(F("Alarm 0 ")); }
Not that the RTC has no backup batter and will loose time if power is disconnected from the microBoSL.
A datasheet which has a details the complete set of features is available here MCP7940 datasheet
23rd April 2021
Some testing of new PCB assembly methods will be tested on the microBoSL. In light of this there are some changes which should be made the the microBoSL for added ease of use. These include:
- 9 V tolerant voltage input
- Solder point for M+, with VBAT connection
- Switching hall effect sensor pins to match hall effect sensor print
- motor direction switching
- global board power switch to isolate all electronics (except RTC)
- (optional) remove reset switch for reset contacts
Some changes to facilitate assembly:
- Panelised PCBs
- 10 PCBs per board
- tooling strips
- fiducials
In looking at the current BOM of the microBoSL there are quite a number of central components which are out of stock for some months. Therefore some alternate parts will need to be found, preferably these will be drop in replacements.
The 9V tolerant input was accomplished with two TPS709 LDOs, these regulators were chosen since they have reverse current protection, that is that current does not flow backwards through them. Hence they may be used as a replacement for the MAX40203 ideal diodes which have become out of stock. One LDO is used for USB power and one for the Battery.
The motor switching was accomplished with the ZXBM210-S H bridge controller. This accepts power directly from the battery to control the motor. It also has PWM speed control which can be used with the ATmega's PWM pins.
The on off switch was implemented next. The reset button was replaced with reset pads which need to be shorted with a screwdriver or the like to activate. A SPST switch is now placed in the battery line. We still want the RTC to be active even when this switch is off, so the battery backup of the RTC was connected to a high impedance voltage divider which draws only 1 μA at with a fully charged battery yet is still sufficient to operate the RTC.