Hi,
I need insight on what went wrong.
Context:
Since hearing a static discharge when plugging the HAT to the 24V battery, I was coding in a couch that charges a lot of static. The RPi5 didn't start on 1st try, then after unplugging and plugging back, it worked, but laser is not shooting anymore. `GPIO.input(pin)` reports 0 after setting HIGH. The second I plug the battery (I believe + makes contact before GND) I get the laser ON. Tried a different GPIO pin, same luck.
After thinking a bit, I some voltage is finding path to GND thru the Laser Pin, before the connector grounds the HAT.
But before the static discharge that was not the case.
The workaround is to connect the laser pin AFTER the HAT is powered up.
I made a script to test pins:
The HAT: HRB8825 Stepper Motor HAT Board for Raspberry Pi Series Boards
Questions:
I need insight on what went wrong.
Context:
- I'm feeding power to the RPi5 through the HAT, the HAT's input is motor Voltage (24V). Using 12V 7A/hr batteries in series.
- Laser head is fed 12V separately, on a common GND, per diagram.
- Laser head has 5V logic input connected to HAT's GPIO, proxying RPi5 GPIO.
Since hearing a static discharge when plugging the HAT to the 24V battery, I was coding in a couch that charges a lot of static. The RPi5 didn't start on 1st try, then after unplugging and plugging back, it worked, but laser is not shooting anymore. `GPIO.input(pin)` reports 0 after setting HIGH. The second I plug the battery (I believe + makes contact before GND) I get the laser ON. Tried a different GPIO pin, same luck.
After thinking a bit, I some voltage is finding path to GND thru the Laser Pin, before the connector grounds the HAT.
But before the static discharge that was not the case.
The workaround is to connect the laser pin AFTER the HAT is powered up.
I made a script to test pins:
Code:
>>> def testPins():... import RPi.GPIO as GPIO... import time... GPIO.setmode(GPIO.BCM)... for pin in range(2, 27):... try:... GPIO.setup(pin, GPIO.OUT)... time.sleep(0.01)... GPIO.output(pin, GPIO.HIGH)... time.sleep(0.01)... state = GPIO.input(pin)... print(f"pin {pin} state {state}")... if not state:... print(f"Pin {pin} not responding.")... time.sleep(0.2)... GPIO.output(pin, GPIO.LOW)... except NameError as e:... print(f"Error on pin {pin}: {e}")... >>> testPins()Error on pin 2: name 'pull' is not definedError on pin 3: name 'pull' is not definedpin 4 state 1pin 5 state 1pin 6 state 1pin 7 state 1pin 8 state 1pin 9 state 1pin 10 state 1pin 11 state 1pin 12 state 1pin 13 state 1pin 14 state 1pin 15 state 1pin 16 state 1pin 17 state 1pin 18 state 1pin 19 state 1pin 20 state 1pin 21 state 0Pin 21 not responding.pin 22 state 1pin 23 state 1pin 24 state 1pin 25 state 1pin 26 state 0Pin 26 not responding.
The HAT: HRB8825 Stepper Motor HAT Board for Raspberry Pi Series Boards
Questions:
- What exactly broke?
- Are these 2 GPIO lost?
- Did I break the RPi5 in other ways?
Statistics: Posted by juanmf — Sat Mar 30, 2024 5:38 pm