Tuesday, April 30, 2024

ESP-32 data logger (3): logger redesign

 I have redesigned the ESP32 logger: 

  • I have abandoned using the ESP32 ADCs entirely
  • The logger will use an ADC module with the 16 bit 4 channel ADS1115 ADC
  • Rather than use a current sense resistor, I have opted to use a ACS712 Hall effect module, which will feed a voltage proportional to current to the ADS1115
  • Battery voltage will be fed to the ADC  using a voltage divider, not shown on the schematic below. 
  • I've added an SSD1306 OLED display. 
  • I added a voltage divider breakout with a 0.2 voltage reduction for sampling the battery voltage
The schematic for the new logger design is below.  I have ordered the ADS1115 module and the ACS712 module from Amazon.com. Delivery is due Friday/  

click to enlarge









Monday, April 29, 2024

ESP-32 data logger (2) --- 12V 7.2AH SLA battery (5) -- partial failure (UPDATED)

 I conducted a test of the ESP32 data logger (link), and simultaneously testing the LM317 charger circuit (link). 

Details: 

  • The current limit on the LM317 circuit was set for 0.72 amps
  • The charge voltage was set to 13.8 volts
  • The battery was discharge to about 30% capacity 
  • Charging was done over a 10 hour interval
  • The logger was set for 1 measurement every 10 seconds
  • Voltage sense was through ESP32 ADC0 using a 1:0.128 voltage divider (6.8K-1K).
  • Current sense was through ESP32 ADC3 taken across the charger's 0.825 ohm, current sense resistor. 
  • The ESP32 ADC channels were set at 12 bits, 0 to 3.3V
  • Logged data was smoothed using Excel moving average filter, 20 samples wide. 
Logged charging curve is shown below: 


The charge current failed to reduce below 0.2 amps after 10 hours of charging.  I am not sure why.  I suspect the  battery has some leakage.  Will be checking this.

The  IR drop across the charger current sense resistor causes an error in the battery voltage measurement.  This is compensated in Excel by subtracting the voltage drop from the measured battery voltage. 

The measured current doesn't seem capable of going less than 0.17 amps.  I think this is a problem with the ESP32 ADC.  I'll need to investigate further.  It's a little disappointing. 

This task is to put the charger and logger circuit into separate enclosures. 

UPDATE:
1. For the logger circuit, it seems the ESP32 ADCs have a very evil reputation.  I am going to order  some ADS1115  4 channel 16 bit ADC modules, and try to improve the ADC accuracy.

2. For the charger, I am going to put away the LM317 charger for now and build a circuit around the UC3906 SLA battery charger chip.



Sunday, April 21, 2024

Husky 2 gallon compressor repair

 My compressor crapped out about a week ago.  After I took the cover off, I discovered a circuit board inside with a DC motor.  The fuse on the circuit board was blown.  After making a trip to Lowe's to get 3A 1-1/4 inch AGC fuses, I replaced the fuse. When I powered the compressor it blew the fuse again. 


I suspected a burned out motor, but didn't see any indication.  I made sure the compressor was unplugged and removed the cover again.  The small circuit board seemed simple enough, as it contained only a bridge rectifier and a capacitor and fuse. 


I removed the screws holding the circuit board to the chassis and turned the board over to look. 


I traced out the circuit, as shown below: 


The input ac power is fused, then run to the power switch. From there the AC line goes through a 100 psi pressure limiter switch.   After this the AC line and neutral are applied to a diode rectifier. The rectified DC is filtered by a small capacitor and then applied to the DC motor. 

The motor resistance was 13 ohms which seemed reasonable.  I clipped one of the wires to the motor to isolate the circuit from the motor.  Then I used my multimeter in diode voltage mode to check the diode bridge.  One of the arms of the diode bridge was shorted.  The bridge is a KBPC610, which I found I could order 10 pieces from Amazon for $8. 


When I received the replacement diode bridge, I soldered it in and tested the compressor, but it didn't work.  After some troubleshooting I found that one of the AC input connections to the board had broken off under the insulation.  After fixing this the compressor ran ok.  I carefully spliced and insulated the wire I had cut to the motor.  Then put everything back together, making sure that none of the wires was in danger of getting caught by the small axial fan that is under the cover. 

I hope the air compressor will keep running. I bought it about 15 years ago at Harbor Freight in Houston. 

Wednesday, April 17, 2024

ESP-32 data logger (1): micro SD logger design

 I am backing away from the battery charger project because I need to complete another project to continue.  So far I've been using a pencil and paper to record battery charge and discharge curves.  I am going to automate that data acquisition process using a ESP-32 microcomputer.  The first attempt will be to store the data to a micro SD card.  The second version will be to use WIFI to store the data on thingspeak.com. 

I have an ESP-32 development board that I bought off of amazon.com. (link).  It's a pretty sophisticated MCU.  I program it using the Arduino IDE.  The development package is 38 pins.  A diagram of the different pin functions is shown below



The test circuit for the micro SD logger is shown below.  The circuit will be powered through the development board USB port.  I order the micro SD card module from amazon.com (link).

click to enlarge

The circuit is wired up on solderless breadboard as shown below, The ESP32 dev board is on the left and the micro SD reader is on the right.   The first experiment will be to simply write some data into the micro SD card and read it back. 





Friday, April 12, 2024

12V 7.2AH SLA battery (4): LM317 battery charger test

 When I originally tried a LM317 circuit, I used the circuit I found at this link.  The LM317 charger circuit is quite popular and can be found all over the web. The circuit I'm using differs from that at the above link in that I added a 100 ohm resistor in the base of the 2N3904 current limiting transistor. I did this to protect the transistor. The circuit is design for a charge voltage of 13.8V and a charge current limit of 0.75A. 

Click to enlarge

The charging circuit works as follows: 

  • The LM317 regulator controls the voltage drop between the power source on the left and the battery on the right to maintain 1.25V from the VO pin to its ADJ pin. 
  • The regulator voltage is set by VO = (1+(RV1+R5)/(RV1+R5+R4)*1.25V)
  • The battery charge voltage is set to 13.8 volt. Given the values in the schematic, this corresponds to RV1 = 2.52Kohm
  • R6 and Q3 form a foldback current limiter circuit. The current limit cuts in when the voltage at R6 reaches about 0.6V.  If R6 = 0.82 ohms (four 3.3 ohm resistors in parallel), then the current limit will be 0.6V/0.82ohm = 0.73A. 
  • In actual operation with a discharged SLA battery, the circuit will initially attempt to regulate the battery voltage at 13.8V but current limiting would cut in, resulting in constant charge current as the battery charged.  As the battery charge voltage approached 3.8V the current limiting would cut out and battery charge current would fall while the charge voltage remained constant. 
I built the charger circuit 


After building the circuit, the LM317 charger was tested as shown in the photo below.  In the upper left is a 23V source taken from the unregulated side of a 13.8V power supply. The charger circuit is in the lower left while a voltage and current monitor for the battery is in the lower right while the battery itself is in the center right. 

click to enlarge

The initial test of the LM317 charger is shown below.  A problem with is test is that the voltage was not set to 13.8V as required.  The voltage was set to 13.4 volts. The battery fails to charge fully and final battery charge voltage settles at 13.3 volts.  

click to enlarge

The test will be conducted after adjustment of the set voltage to 13.8V. 



Thursday, April 4, 2024

Craftsman 10" bandsaw 113.244513 (5): Testing new lower blade guide (updated)

 I installed the new lower guide into the Craftsman saw, as shown in the photo below.  There were minor issues and one major issue as noted in the photo and the list below the photo.

click to enlarge


  • There is interference between the left side of the thrust bearing axle and the case. This is easily fixed by cutting the ends of the axle down.
  • There is possible interference between the right blade guide and the case.  Fix by cutting the guide length down. 
  • Change all the set screws to Allen style headless screws.  This will help reduce places to snag when installing the sawblade.
  • The thrust bearing is not centered on the blade.  For now I will install a shim under the lower blade guide support to move the guide over about 1 mm. 
The saw runs fairly well, with some noise. Once I get the above issues on the lower guide fixed, I'll replace the wheel bushings with ball bearings, and replace the worn tires. 

UPDATE: 
I bought a bottom style 10-24 tap on Amazon.com for $3.  It cleaned out the set screw holes very well.  Now the set screws don't jam and it's easy to feel when the screw contacts the blade guide.   I also shortened  the thrust washer bearing axle and the two blade guides.  Now there is no interference of those features with the case.  

I printed a set of shims to use under the lower guide support to center the thrust bearing  on the blade. The shims were nominally 1mm, 0.5mm, and 0.25mm thick.  Upon actual 3D printing, each shim was 0.13mm or so larger than nominal.   The 1mm and 0.5mm shims together seemed to center the blade on the bearing the best. 

The photo below shows the shims after 3D printing.



The photo below shows the guide installed with notes on latest changes.

click to enlarge