Go Down

Topic: Does ADC in + PWM out = trouble? (Read 6685 times) previous topic - next topic

cossoft

What is the output impedance - as I said its all about impedance.
I don't know, but the tube will run on about 2mA via a throttling resistor.  The noise will be taken directly off the tube's anode and then amplified by other tubes.  A pentode's grid impedance is pretty high.  The biggest extraneous noise will be mains hum @ 50Hz but that will not effect the randomness extraction.  RFI is irrelevant as the circuit can only sample frequencies at a maximum of 5kHz if I run the Arduino at full pelt.  There's also a 100kHz SMPS for the 260V tube voltage but again that's above the sample limit.

I'm concerned about the 500Hz PWM output from the Arduino.  That's right in the sample range and it might affect the analogue readings.  I'd be creating my own auto correlation.  Hence this question since I have scant experience of Arduinos (Arduinoes?)

cossoft

You'll get a random load of transitions...  
... and the digital inputs of the arduino can count at up to 8MHz
To be honest I don't like thresholding.  It automatically reduces the measured entropy rate by a decade as you down sample from 10 bits to 1 bit.  You then just have to reassemble all  the bits into bytes to transmit them over Ethernet, and you still have to process them again to make them truly random.  Simply thresholding a noise source into bits won't make cryptographic strength random numbers.

Also, I'm not sure that 8MHz is anywhere near the practical bandwidth of the pentodes I have.  I think that we're looking at audio frequencies.  I can't easily test /trouble shoot 8MHz frequencies but I can hear audio.  Plus I now have my super dooper PC oscilloscope to see it too  :)

allanhurst

#17
Aug 20, 2016, 06:31 am Last Edit: Aug 20, 2016, 07:33 am by allanhurst
If you coupled the output with a good quality high voltage capacitor you should be fairly safe....

- any idea what pentodes they used?  If 807's as in  colossus, good for 10MHz easily.

- I bet ERNIE didn't have any sort of A/D - they must have used thresholds. Not very random?

- if you stick with your a/d idea I think you're worrying unduly about the effect of your pwm/meter output - the arduino analog input will be driven by quite a low impedance from your pentode amplifiers. Check the anode impedance of your pentodes - it'll be a few k ohms  . 

regards

Allan

cossoft

any idea what pentodes they used?  


CV4002s are military wired versions of the pin based CV4014 that I'm using.  I've consulted some valve aficionados but no one seems able to guess the operating frequency of this circuit.  I'm concerned with the small  1nF inter stage coupling capacitors.  They suggest frequencies above normal audio.  The RC constant on the cathode resistor /bypass suggests perhaps a minimum of 16KHz.  I'm hoping to re spec the bandwidth of the amplification stages but valve design is really hard  :(   I think that I'll have to resort to  the Monte Carlo methodology and just try some stuff.  It's perhaps apt to use randomly chosen components for a random number machine...

I'd really really like to avoid MHz frequencies as I only have a PC and hammers.  The Arduino can only sample 5kHz analogue anyway.

allanhurst

#19
Aug 20, 2016, 04:15 pm Last Edit: Aug 20, 2016, 04:50 pm by allanhurst
The arduino can COUNT at up to 8MHz - which, since 10 bits a/d is 1000:1, is equivalent to sampling to 10 bits at 8kHz..  I repoint you at my schmidt idea..

aha !  ......  it's an EF91.

check specs at http://www.r-type.org/exhib/aaa0215.htm

it's good to 200MHz ...  bit overkill for 5k arduino analog sampling, but should give plenty of rattle at 8Mhz +

regards

Allan.

MarkT

#20
Aug 20, 2016, 04:31 pm Last Edit: Aug 20, 2016, 04:31 pm by MarkT


CV4002s are military wired versions of the pin based CV4014 that I'm using.  I've consulted some valve aficionados but no one seems able to guess the operating frequency of this circuit.  I'm concerned with the small  1nF inter stage coupling capacitors.  They suggest frequencies above normal audio.
No, they don't.  You have to remember valve circuitry operates at high impedance (high voltage,
low current) so that 1nF (which is 160k ohms reactance at 1kHz) is a reasonable value (the grid bias
resistor is 470k, which is the effective load).
Quote
The RC constant on the cathode resistor /bypass suggests perhaps a minimum of 16KHz.
The breakpoint is 1.6kHz, not 16kHz.
Quote
I'm hoping to re spec the bandwidth of the amplification stages but valve design is really hard  :(   I think that I'll have to resort to  the Monte Carlo methodology and just try some stuff.  It's perhaps apt to use randomly chosen components for a random number machine...

I'd really really like to avoid MHz frequencies as I only have a PC and hammers.  The Arduino can only sample 5kHz analogue anyway.
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

cossoft

I just lit up my QS92 voltage stabiliser!  My first valve.  At the moment the noise seems to be approximately 15mVpp which is less than I expected.  50dBV gain should get me to full Arduino levels which is achievable.

I recorded the noise signal to a WAV file using the PC (44.1KHz @ 16bits).  A quick entropy calculation gives me a randomness rate of 192Kb/s.  Factoring down for an Arduino (10KHz @ 8bits) should be 24Kb/s.  I can live with that.  Beats the pants off /dev/random.

MarkT

15mV is a lot of noise.  Audio band noise is normally measured in nanovolts-per-root-Hz, or microvolts
for the full bandwidth.
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

allanhurst

#23
Aug 22, 2016, 12:41 am Last Edit: Aug 22, 2016, 12:59 am by allanhurst
The Boltzmann equation 4kTRB gives us poor engineers -174dBm/Hz at 300K

the voltage depends on the impedance, the temperature and the bandwidth

but 15mV sounds like a lot

regards

Allan

 

cossoft

Actually Boltzmann doesn't apply to a thermionic voltage regulator.  It's not a resistor and the conduction process is totally different, hence the higher noise.  If you think that's high, have a look at a 20V Zener diode passing 50nA.  Noise is in the order of 200mVpp.  But again, that's avalanche noise not Nyquist thermal noise.

Hmm, there's a thought   ::)

allanhurst

#25
Aug 22, 2016, 11:45 pm Last Edit: Aug 22, 2016, 11:47 pm by allanhurst
Don't quite understand your sums for data rate.


sampling :  PC vs arduino : 44.1k/10k is 4.41

resolution :  PC vs arduino ie 16 vs 8 bits is 256:1

so if you reckon the PC sampling gives 192kb/s worth of random, the arduino should give

192k /4.41*256 which is  170 b/s


or am I being particularly stupid?

regards

Allan

 

cossoft

The stupid are sat my side of the screen.  Frankly it's all guess work until I build the thing with the appropriate amplification.  I wish I wish I wish that I could calculate the gain of the two pentode stages in my schematic.  It's to do with the plate /cathode resistors ratio I think. 

One way to ball park the possible  entropy rate is this:-

On the Arduino, sample 8 bits @ 10KHz.  I like 8 bit samples because they look like bytes.
Assume the input signal level to the ADC pin is 50% of full range.  That's effectively 7 bits /sample.
You'll have to take my word for it that a sampled white noise signal contains about 25% entropy.
So entropy potential = 10,000 * 7 * 0.25 = 17500 bit/s.

That's a bit kinda like 24kbit/s.  Remember that this is pure entropy (randomness) not sampled data.  The 25% compression factor means that this stream will pass the standard tests for randomness.  I hope.

allanhurst

#27
Aug 23, 2016, 05:36 am Last Edit: Aug 23, 2016, 07:23 am by allanhurst
Gain  of each stage? It's not quite that simple.  The current flowing affects the gain as well .

This EF91 is running well outside the datasheet range - at a very low anode current. It won't be linear ( but who cares )

 I'd guess that the gm is probably in the region of 2mA/v, which gives a gain of 160ish .The output of 2 stages will be pretty much rail - to - rail with 15mV p-p input.

I suspect ERNIE used that as a logic input to a timer/counter  stage - the counter would overflow many times to give you a modulus at the end of the timer period.  Perhaps they used the mains input frequency as a timer reference?
 
If my guess is right, my idea of using a schmidt and timer is closer to the ERNIE concept than using a/ds...............

Build one and see!

regards

Allan.

ps if you want a more linear design using EF91's with an output in the 5v peak-peak range , I'll do some sums. When I was young, valves were all we had!

cossoft

Gain  of each stage?
I've just done a simulation and the first stage gives a max. gain of 40dBV @ 60kHz interestingly.  That's about 100x.  Plate resistor was only passing 1mA.  I'm not sure how accurate my EF91 model is, especially in the edge cases with such low currents.

I feel better now that it's a realistic circuit.  I'll have to rejig the capacitors to extend the gain to Arduino ADC frequencies.  Better get building...

allanhurst

#29
Aug 27, 2016, 07:28 pm Last Edit: Aug 28, 2016, 01:32 am by allanhurst
Hi Cossoft...

reckon if you changed the anode resistors you'd be in a more sensible part of the characteristic....

perhaps about 10k .

the anode current will be about 3 mA, the Gm about 5mA/V giving a gain of about 50x per stage.

edit : and g1 will be at about -3V compared to the cathode.

then 50x50x15mV gives a p-p at your arduino of about 3.75V - right sort of ballpark.

If you want a bit more, increase the anode resistors.

edit : Obviously you'll have to bias the capacitor-coupled input to the arduino with
a pair of resistors to it's mid-rail - suggest 2 100k's .  This appears at ac in parallel with the anode resistor, reducing the gain of the second stage by about 20%, so I'd make it's anode resistor 12k as a starting point.  I'd suggest the coupling cap about 3.9nF to make the LF -3dB point about 1kHz.

good luck - let us know when you've tried it!

regards

Allan

Go Up