Author Topic: Pulse/strobe timeout circuit for a thermal printer?  (Read 2249 times)

0 Members and 1 Guest are viewing this topic.

Offline ArtlavTopic starter

  • Frequent Contributor
  • **
  • Posts: 750
  • Country: mon
    • Orbital Designs
Pulse/strobe timeout circuit for a thermal printer?
« on: December 04, 2014, 03:55:38 pm »
I have a thermal printer module that i want to connect to a microcontroller.
The module have an active-low "burn" input, which heats up the printing elements.

This input must not be active for more than several milliseconds, or else the module would burn up itself.

Now, i don't trust my ability to never ever make an error in software that would result in this line getting stuck low for long or permanently, so i wanted to add a hardware safeguard.

The circuit should immediately give out high when input is low, and low when the input is high (i.e. the pulse can be terminated before the time out).
If the input stay high for more than a given time, it should revert the output back to high (safety timeout).
If the input were to be left floating, the output should stay high (fail-safe).

Here is what i came up with.
The resistor dividers are set up in such a way as to always keep the non-inverting input above the inverting one, with a delay capacitor on the former to slow it down. The time it takes to charge the capacitor is our valid pulse window.


Questions are:
-Is that a good solution? That is, would it work as described?
-How is this problem solved normally, i.e. in cash registers? That is, can it be made simpler?
 

Online Alex Eisenhut

  • Super Contributor
  • ***
  • Posts: 3494
  • Country: ca
  • Place text here.
Re: Pulse/strobe timeout circuit for a thermal printer?
« Reply #1 on: December 04, 2014, 07:27:47 pm »
Too much stuff. Why not code in a watchdog/regular timer interrupt that sets the port every x milliseconds?

Hoarder of 8-bit Commodore relics and 1960s Tektronix 500-series stuff. Unconventional interior decorator.
 

Offline ArtlavTopic starter

  • Frequent Contributor
  • **
  • Posts: 750
  • Country: mon
    • Orbital Designs
Re: Pulse/strobe timeout circuit for a thermal printer?
« Reply #2 on: December 04, 2014, 07:52:16 pm »
Too much stuff. Why not code in a watchdog/regular timer interrupt that sets the port every x milliseconds?
What if i code it wrong, or something would get broken before the code gets to it, or interrupts would get disabled and forgotten to be reenabled?
Pooff!
Out goes the magic smoke.
 

Offline ArtlavTopic starter

  • Frequent Contributor
  • **
  • Posts: 750
  • Country: mon
    • Orbital Designs
Re: Pulse/strobe timeout circuit for a thermal printer?
« Reply #3 on: December 05, 2014, 09:12:13 pm »
In case anyone googles that up, i built it and it worked perfectly.

Unfortunately the printer still went up in smoke, but it was due to me screwing up it's pinout, not due to any fault in the protection circuit.   :-BROKE :palm:
Fortunately, i only connected one half of the power supply pins, so the other half remained intact, and i was able to get it running (at half the speed, just in case).  8)
 

Offline amyk

  • Super Contributor
  • ***
  • Posts: 8415
Re: Pulse/strobe timeout circuit for a thermal printer?
« Reply #4 on: December 05, 2014, 10:04:09 pm »
All you basically need is a high-pass filter. How about a cap with a pullup resistor and Schmitt trigger inverter on the other side?
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf