Author Topic: Triggering AVR pin off a -25V signal, Opto, FET, BJT or something else?  (Read 3322 times)

0 Members and 1 Guest are viewing this topic.

Offline StonentTopic starter

  • Super Contributor
  • ***
  • Posts: 3824
  • Country: us
I'm looking to build an add-on to my Geiger counter once I get it all fixed and ready to go.

Basically will consist of the Noritake VFD, an AVR, a LED and a speaker / headphone jack.

A tick on the Geiger counter generates a -25V spike at a very low current at the Amphenol 75-PC-1M headphone connector.
It was really only ever designed to use the headphones that came with it which had an impedance of 4K Ohm and inductance of around 600 to 700 uH.

If you put a 8 or 16 Ohm speaker on it, the tick is barely audible because the current draw is more than it was designed for.

There is a Geek Group video where they use an optocoupler tied to an interrupt pin on the AVR and it uses that to do counting of ticks. Would you say that would be the best way to do it?  What about a transistor of some kind? I have several 2N2222 and 2N3904's in my collection.

Apparently a standard thin piezo element works well with the unamplified signal at a reasonable volume so if providing amplified output would complicate it, I can live with just a piezo.

The VFD and the AVR will need +5V and I can figure out how I'm going to do that separately. The VFD will also need 4 pins on the AVR for its own usage. If I can squeeze it down to an ATTiny45/85, then even better, but I'll have to see how big the Hex file is after I write up a program.

So for just the signaling part, do you think just a 2n2222 or 2n3904 could work?

On the NPN, if the base is higher than the emitter then electricity will flow, but -25V is not higher than +5 (or is it?)
On the PNP if the base is lower than the emitter, electricity will flow that sounds more like it except -25 is lower than +5 but also no signal which would be 0V is also lower than +5, right?

Sorry if it sounds like rambling, I'm just sort of conceptualizing it right now.
The larger the government, the smaller the citizen.
 

Offline SArepairman

  • Frequent Contributor
  • **
  • Posts: 885
  • Country: 00
  • wannabee bit hunter
Re: Triggering AVR pin off a -25V signal, Opto, FET, BJT or something else?
« Reply #1 on: October 05, 2013, 03:54:25 am »
Well if the current is low you probably need a transistor with gain to be triggered on it in order to pass a signal to an opto coupler.

I think an opto coupler is the easiest solution so long the signal is not too fast. They are cheap and very easy to use.
 

Offline c4757p

  • Super Contributor
  • ***
  • Posts: 7799
  • Country: us
  • adieu
Re: Triggering AVR pin off a -25V signal, Opto, FET, BJT or something else?
« Reply #2 on: October 05, 2013, 04:11:04 am »
Bah... optocouplers....

How about this?

Perhaps add a 3k3 resistor from Q1's base to +5 to make it more reliable (shut off fully)

Depending on what "very low current" is you may need to play with the resistor values.

The output is on Q2's collector, if that wasn't obvious - forgot to label...
« Last Edit: October 05, 2013, 04:24:22 am by c4757p »
No longer active here - try the IRC channel if you just can't be without me :)
 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 19516
  • Country: gb
  • 0999
Re: Triggering AVR pin off a -25V signal, Opto, FET, BJT or something else?
« Reply #3 on: October 05, 2013, 08:54:09 am »
I don't see why you need two transistors. A single PNP will do. The output will be inverting but that can be solved by software.

How about just using a potential divider? 22k and 120k should do.
 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 19516
  • Country: gb
  • 0999
Re: Triggering AVR pin off a -25V signal, Opto, FET, BJT or something else?
« Reply #4 on: October 05, 2013, 01:43:14 pm »
I've just looked at the datasheet. The ATTiny45/85 has an internal pull-up resistor with a value of approximately 36k, so all you need is to connect a 180k resistor in series with the input and enable the pull-up.
 

Offline geraldjhg

  • Regular Contributor
  • *
  • Posts: 61
  • Country: ar
Re: Triggering AVR pin off a -25V signal, Opto, FET, BJT or something else?
« Reply #5 on: October 14, 2013, 07:53:10 pm »
hi id use a series capacitor with a pull up to vref and diode to ground to avoid negative pulses
if that cant be detected with the mcu then id amlify it an lenghten it with any transistor
try with r of 10k and c of .1 to .01  and of course the 1n4148
G E R A L D
 

Offline StonentTopic starter

  • Super Contributor
  • ***
  • Posts: 3824
  • Country: us
Re: Triggering AVR pin off a -25V signal, Opto, FET, BJT or something else?
« Reply #6 on: October 15, 2013, 12:14:21 am »
Well I did grab some 4N36 optocouplers last week so that should get me started. I'll have to play with them and see how well they work.
The larger the government, the smaller the citizen.
 

Offline Psi

  • Super Contributor
  • ***
  • Posts: 9939
  • Country: nz
Re: Triggering AVR pin off a -25V signal, Opto, FET, BJT or something else?
« Reply #7 on: October 15, 2013, 12:18:43 am »
Atmel did an app note which I can't find right now, but basically they made a mains energy meter that did zero crossing detection by connecting the hot wire of the mains through a 1M resistor to a microcontroller pin. The internal clamping diodes are enough to protect the micro from the +/-300V or more coming in from the mains (remember it's 240V RMS, not peak).

You could do the same thing. 1M might be a bit high, you will need to experiment. As long as the current on the pin is very low the clamping diodes will protect it.

Yep, i was about to post the same thing.
Here's the appnote http://www.atmel.com/images/doc2508.pdf

I'm sure his -25V pulse has enough energy to pull down a input pin tied to VCC with 1M.
Just have to limit the current absorbed by the low clamp diode.

I would probably start with a 1Meg to VCC and 100K in series with the -25V signal and reduce if needed.
« Last Edit: October 15, 2013, 12:27:10 am by Psi »
Greek letter 'Psi' (not Pounds per Square Inch)
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf