Skip to content

galagithub/btt_relay_os

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Alternative Firmware for BTT Relay v1.2

ATTENTION!

The relay board contains high voltage area, which may result in serious harm to the operator (even death). The author assumes no liability which may come from using the software or by following the instructions included in this project.

How it works:

  1. AC power on to relay
  2. relay powers the printer main power supply.
  3. after 60 seconds the relay looks for PS_ON signal to be high (over 1 Volt).
  4. if PS_ON if high, then relay goes to "running" state and awaits PS_ON to go low (0 Volts).
  5. if PS_ON is low, then the relay will go to "power delay" state, which means it will shut down after 20 seconds.
  6. when the relay shuts down (cuts power to the printer) it will go into "recovery delay" state for 30 seconds.
  7. after recovery delay, the relay will go into "tripped" state, where it will reset itself if PS_ON signal goes to high.

At any time, if enabled, the short-circuit protection can be engaged, when 5V_IN signal is lower than 4.5 Volts. The relay can be reset at any time, from eny state, by shorting the reset pin on board to relay 5V pin (momentary switch). If these 2 pins are always shorted, then the relay is disabled, thus providing power to the printer with no control over it. Relay states are signaled via on-board leds.

It is using platform.io and written using C language. All the build requirements should be automatically handled by platform.io. Development environment assumes you are using vscode with platform.io installed and have a 5V serial adapter to flash the MCU.

To flash MCU:

  1. the relay board should have no power
  2. connect 5V serial adapter to board 4 pin header reversing TX and RX, do not connect the 5V pin!
  3. put a jumper on the reset header.
  4. power on the relay board (high voltage is present!)
  5. click "Upload" in platform.io controls, a new terminal will appear
  6. when message "Cycling power: done" appears remove jumper from reset pins (high voltage may be present!)
  7. wait for program to flash, check messages in terminal for errors

Current features:

  • response time: 100ms - changes in conditions faster than this won't be detected, limit to max 500ms
  • startup delay: 60s - the relay will not trip is PS_ON is disconnected (or 0) and power has just been applied
  • power off delay: 20s - time to allow the board/PC to shutdown cleanly
  • recovery delay: 30s - blanking time to avoid fast power off/on cycle, after which relay can recover with PS_ON (self-reset)

Leds show state:

  • green off and red off - no power to the relay
  • green on and red on - MCU is reset or in programming mode
  • green on and red blinking - startup delay, power to system, only SC is available
  • green on and red off - power to the system
  • green blinking and red off - PS_ON triggered, power off delay
  • green and red blinking - no power to the system, wait for recovery delay
  • green off and red on - no power to the system, relay is in power off state
  • green alternate red blinking - SC triggered

More details in the C code.

Information regarding HW:

Alternative firmwares:

  1. https://github.com/talv2010/biqu-relay-v1.2-firmware-modified
  2. https://github.com/sobieh/bttrelay

Related projects

About

Firmware for BTT Relay v1.2

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages