Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
mobby_6kl
Aug 9, 2009

by Fluffdaddy
I'm logging some data with an ESP8266 and I'm having some issues with the BME280 sensor. I'm sampling from it once every minute and from time to time it freaks out and returns ridiculous values. It's not always the same but usually around -30C. Humidity is probably ok but is being affected by the temp, pressure is way off too.



The actual temperature should never be -30C so I could easily filter out these values, but still it's bothering me. It could be just the chinesium sensor but I want to make sure I didn't mess up myself.

Adbot
ADBOT LOVES YOU

Sagebrush
Feb 26, 2012

Desynchronized data read maybe? Your microcontroller is trying to read the data when the sensor isn't ready, and it's giving junk? Bad electrical connection perhaps? The fact that the spikes happen to both the temperature and the humidity simultaneously makes me think it's a communication problem.

I would just median-filter it tbh and call it a day. Temperature doesn't change quickly enough for the filtering lag to matter and it will instantly remove all of those outliers.

Shame Boy
Mar 2, 2010

mobby_6kl posted:

I'm logging some data with an ESP8266 and I'm having some issues with the BME280 sensor. I'm sampling from it once every minute and from time to time it freaks out and returns ridiculous values. It's not always the same but usually around -30C. Humidity is probably ok but is being affected by the temp, pressure is way off too.



The actual temperature should never be -30C so I could easily filter out these values, but still it's bothering me. It could be just the chinesium sensor but I want to make sure I didn't mess up myself.

How are you doing the sampling? Are you using SPI or I2C? The device has a couple of modes, the "forced" mode that just takes a sample whenever you ask it to and the "normal" mode that samples periodically and just makes the most recent sample available. Maybe try a different mode and see if you get a different result? If you're reading all the registers at once in a single sequential read operation, you could check to see if the chip ID ever comes back garbled, or if the status register says the device is doing something when the data indicates bad values. You could also try sending the reset code and waiting a second for it to reset before taking a sample, just to see if the device is getting into some weird internal state over time.

CarForumPoster
Jun 26, 2013

⚡POWER⚡

Trabant posted:

I think the answer is "eBay/AliExpress/disassemble a used monitor" but thought I'd ask:

I'm going down the path of making a briefcase to hold my Amiga emulator, a la this, because I'm a massive nostalgia dork. I need a display module that will ideally handle an HDMI input since that's the only signal my emulator device outputs, which in turn means I need a way to bring the audio signal out from the display to a pair of small speakers. Given that I'll be using it exclusively for Amiga game emulation, I'm not looking for some high-performance display and have zero need for touchscreen capabilities.

This guy would work well since it does HDMI and includes audio out, but it seems overpriced. Plus, I'd prefer something in the 13-15" range, which makes me think that my options are:

1) Cannibalize an old monitor which has either integrated speakers or (better yet) audio out
2) Try my luck with AliExpress items like this (which I know includes audio out because it's shown with speakers but has a massive bezel) or this (which should/might) or build-my-own combo of control board and display.

Is there an option I'm overlooking, or some parts source I just haven't thought of?

Thanks!

late edit: seller "oupin6" on eBay is probably the best single source I've found so far, e.g. this and many other items. Little confused by his warning though -- I have no idea how to parse this:

These exist, cost $5, and the crappy component video would be more nostalgic.

https://www.ebay.com/itm/5Ft-HDMI-M...5.c100005.m1851

Devices also exist which still have HDMI outputs but split off RCA audio connections.

Stabby McDamage
Dec 11, 2005

Doctor Rope

CarForumPoster posted:

These exist, cost $5, and the crappy component video would be more nostalgic.

https://www.ebay.com/itm/5Ft-HDMI-M...5.c100005.m1851

Devices also exist which still have HDMI outputs but split off RCA audio connections.

How do these work? These cables look passive, but isn't HDMI entirely digital?

CarForumPoster
Jun 26, 2013

⚡POWER⚡

Stabby McDamage posted:

How do these work? These cables look passive, but isn't HDMI entirely digital?

I think this one is probably a bad idea as it requires whatever youre feeding in to to be able to figure out its digital instead of analog. Heres an HDMI 1.3 (not 1.4 apparently) converter for $8.50 https://www.ebay.com/itm/Mini-Compo...X0AAOSwjTlZf4dt

JawnV6
Jul 4, 2004

So hot ...

mobby_6kl posted:

The actual temperature should never be -30C so I could easily filter out these values, but still it's bothering me. It could be just the chinesium sensor but I want to make sure I didn't mess up myself.

I think Sagebrush and Oreos are correct. But just for my curiosity, what's "-30C" look like on the wire before any of your conditioning or adjustment?

nobody-
Jun 4, 2000
Forum Veteran
Idiot filtering/sampling question for you guys: I want to sample audio into a microcontroller and do an FFT on it so I can display its frequency spectrum on some Nixie bargraph tubes I got off Ebay. I was planning on sampling the audio at 32kHz, which would give me a theoretical maximum identifiable frequency of 16kHz, which should cover most of the frequency components you'll hear in music.

I'm having trouble coming up with an antialiasing filter, though. The filter design tools I've been using keep coming up with ridiculous 8+ order filter topologies since my passband is so close to my sample rate. Am I overthinking things, and should I just do a cheapass RC low pass on it with a cutoff frequency around 16kHz? Or could I get away with not pre-filtering it and just do an FIR or IIR on it in the chip after sampling it in?

The little bit of DSP I know, I picked up along the way from various sources, so I'm not entirely sure what the "proper" way is to go about something like this. I assume there is some way to do what I'm trying to do, since most digital audio stuff samples at 44.1 kHz, and picks up frequencies of (I assume) up to 22 kHz.

nobody- fucked around with this message at 16:27 on Jun 8, 2018

longview
Dec 25, 2006

heh.
Audio ADCs use high speed delta sigma converters operating at very high frequencies, the CS5381 samples at 6 MHz and decimates+filters down to your target sample rate and bit depth in hardware.

Because of that the actual nyquist frequency is super high and you normally only need a simple RC filter.

Can your controller do I2S? If so you can probably find an ADC board off eBay and hook it up, most chips will operate at 32 kHz as well as 44.1+.

If it can DMA ADC transfers you could do 2-4x oversampling with the built in ADC and buy some wiggle room that way.

nobody-
Jun 4, 2000
Forum Veteran
Thanks for the tip! I got one of these things, since it takes care of the mic input, filtering, ADC, and decimation all together. I would've just bought the mic module without the breakout board, but Mouser and Digikey were both out of stock :argh:

Anyways, it works much better than the crappy electret mic/preamp setup I was feeding into my microcontroller's ADC.

CheddarGoblin
Jan 12, 2005
oh

ate all the Oreos posted:

Probably, I've used those 433mhz circuits plenty and they're very simple (just turning the crystal on and off with a transistor), but you might need to adjust the coil or capacitor (I think there's one or two caps on the other side of the board) too for it to transmit any appreciable distance. It also will probably be out of tune without adjusting those but in my experience the things output such a massive wide band (like 2 to 3MHz wide) that that doesn't really matter much for most cheap receivers

Hey thanks, I tried this and it totally worked.

Now I'm not sure if there's a better thread for my next question. On the top is the waveform from the actual remote sending a code, on the bottom is my approximation.



It does not work. I'm pretty sure I've got the pulse length from the real remote down pat at 345 microseconds, but I'm thinking the problem is that you can see in the waveform from the real remote that the pulses are very abrupt and start instantly, but with my dealy it takes a few μs to ramp up when the crystal is activated.

Is this something that can be easily corrected electronically? Alternatively, am I likely to be able to fool the receiver by slightly lengthening the 'on' pulse (and conversely shortening the 'off' pulse)?

e: ok it definitely has something to do with swapping the crystals on the TX, i just tried it with one of the unmolested 433mhz ones and I get a proper waveform.

ee: holy poo poo it works! it was likely exactly what you said - i found a 315mhz version of the TX (obviously a lot closer to 303 than the 433 one) and did the same crystal swap. now it works like a champ.

CheddarGoblin fucked around with this message at 23:17 on Jun 14, 2018

Super Rad
Feb 15, 2003
Sir Loin of Beef
My project to build a MIDI DJ controller has been moving along nicely - for my first foray into microcontrollers the Teensy 3.6 has been an absolute breeze to work with.

However, as all projects tend to, my vision for this project has morphed slightly. My initial version had a 'stationary' jogwheel with a capacitive touch sensor hooked up through a carbon brush. This surprisingly worked well despite the very janky appearance of the setup, but at the end of the day it doesn't really feel like an actual scratch setup and it's easy to see why scratch performers still mostly operate off traditional or Digital vinyl - or use some kind of motorized jogwheel or more modern solution (like Rane 12).

So I went to Home Depot and got some various dowels and PVC connectors and turned my rotary encoder from a jogwheel with a 7" touch sensitive aluminum platter to a vinyl 'needle'. I fashioned a much smaller disk into a wheel and suspended the rotary encoder over a vinyl record playing on a regular turntable, replacing the stock needle. This lets me use an actual vinyl spinning at 33rpm as the control surface while still sending the motion of the disk via MIDI over USB to DJ software.

Again, to my surprise everything here functioned as expected on the first go, but I want to build a standalone device, not some ugly thing that you suspend over a functioning turntable.

Essentially now I need to build my own turntable/platter. The platter is not much of a problem, I know where I can purchase a 7" platter that would fit my needs perfectly, but the motor/speed control is another thing. This is one of those cases where the internet is not being very helpful for looking up reference points - I get the impression that cheap DC motors can be lovely, and that controlling the speed can also require some intricate electronics - however it's hard to parse out what is real from what is merely opinion from HIFI grognards who are trying to justify their purchase of a $500 DC motor.

Certainly my little turntable uses something much cheaper and while definitely not a piece of HIFI equipment it sounds very much passable and has not only a switch for 33/45/78 rpm but also a dial for +/- 10% pitch.

I'd like to replicate that, preferably on the cheap, if I could get a wider range on the pitch that would be a bonus - I actually don't even need the 33/45/78 rpm select since 33rpm is ideal for using with MIDI software.

In terms of what I need are recommendations for a top-mounted DC motor with a pulley that would do that job, as well as a preferred design for fine tuning and pitch-bending the speed. Again, my first round of searches have revealed that the rabbit hole here goes pretty deep, the debate between AC and DC motors alone is far older than I am, and then when it comes to pitch control there are yet more options/opinions.

carticket
Jun 28, 2005

white and gold.

I would go to Goodwill and look for a turntable for like $5 to get the mechanics and drive system. I don't know what they use for speed control, but there's some sort of method for it. Figure out how it's driven and then just replace the drive circuit with something of your own.

mobby_6kl
Aug 9, 2009

by Fluffdaddy

ate all the Oreos posted:

How are you doing the sampling? Are you using SPI or I2C? The device has a couple of modes, the "forced" mode that just takes a sample whenever you ask it to and the "normal" mode that samples periodically and just makes the most recent sample available. Maybe try a different mode and see if you get a different result? If you're reading all the registers at once in a single sequential read operation, you could check to see if the chip ID ever comes back garbled, or if the status register says the device is doing something when the data indicates bad values. You could also try sending the reset code and waiting a second for it to reset before taking a sample, just to see if the device is getting into some weird internal state over time.

JawnV6 posted:

I think Sagebrush and Oreos are correct. But just for my curiosity, what's "-30C" look like on the wire before any of your conditioning or adjustment?
Thanks. It's hooked up with I2C. I think it's sampling in normal mode, at least I don't remember switching it. I'd probably need to review the code as it's been a while, as well as investigate the library which is supposedly a wrapper over Bosch reference implementation. Unfortunately of course this hides a lot of what's really going on there from me, so this might be a great opportunity to finally bust out my ebay logic analyzer. Hopefully I'll have a bit more time this week to mess with this so I'll post an update.

ante
Apr 9, 2005

SUNSHINE AND RAINBOWS
You've got it hooked up to an encoder? Yeah, I'd guess most of that is nerds being nerds if that's the case


I doubt you'd need a lot of torque, just get a lovely$5-15 12v DC motor. They run at 2000-7000 rpm or so, and use a pulley or maybe two stages to get it down to a usable speed on the output. Use a microcontroller to measure the encoder and compensate with a PWM signal to the motor to speed up or slow down.

Your compensation might be able to be really naive, too. I'd guess humans aren't good at detecting minute speed variations at that level.
But even if you have to make it better, later, all of that stuff will be required anyway

babyeatingpsychopath
Oct 28, 2000
Forum Veteran


ante posted:

You've got it hooked up to an encoder? Yeah, I'd guess most of that is nerds being nerds if that's the case


I doubt you'd need a lot of torque, just get a lovely$5-15 12v DC motor. They run at 2000-7000 rpm or so, and use a pulley or maybe two stages to get it down to a usable speed on the output. Use a microcontroller to measure the encoder and compensate with a PWM signal to the motor to speed up or slow down.

Your compensation might be able to be really naive, too. I'd guess humans aren't good at detecting minute speed variations at that level.
But even if you have to make it better, later, all of that stuff will be required anyway

In common musical ranges, detectable pitch differences are like .1% (~1-3Hz from 250-1500Hz). That's pretty tight tolerances when trying to reproduce music well.

It might be worth hooking up a dedicated PLL->PWM to the encoder. Give the PLL a good reference frequency and have it adjust the PWM of the driver to make the motor match. 16.0000kHz crystals are dirt cheap, and downsampling into something reasonable shouldn't be too hard. TBH, if you've got a good reference clock on a spare microcontroller, there's no real reason not to just use one specifically and only to control the motor speed and nothing else. The 33/45/78 and +-10% pitch wheels should be an absolute breeze, and the dev boards you're using probably have pretty clean clocks on them already.

Splode
Jun 18, 2013

put some clothes on you little freak

Super Rad posted:

Essentially now I need to build my own turntable/platter. The platter is not much of a problem, I know where I can purchase a 7" platter that would fit my needs perfectly, but the motor/speed control is another thing. This is one of those cases where the internet is not being very helpful for looking up reference points - I get the impression that cheap DC motors can be lovely, and that controlling the speed can also require some intricate electronics - however it's hard to parse out what is real from what is merely opinion from HIFI grognards who are trying to justify their purchase of a $500 DC motor.

Certainly my little turntable uses something much cheaper and while definitely not a piece of HIFI equipment it sounds very much passable and has not only a switch for 33/45/78 rpm but also a dial for +/- 10% pitch.

I'd like to replicate that, preferably on the cheap, if I could get a wider range on the pitch that would be a bonus - I actually don't even need the 33/45/78 rpm select since 33rpm is ideal for using with MIDI software.

In terms of what I need are recommendations for a top-mounted DC motor with a pulley that would do that job, as well as a preferred design for fine tuning and pitch-bending the speed. Again, my first round of searches have revealed that the rabbit hole here goes pretty deep, the debate between AC and DC motors alone is far older than I am, and then when it comes to pitch control there are yet more options/opinions.

Use a brushed DC motor (this is the most basic kind), any other kind of electric motor is unnecessarily complicated for what you need. as for exactly which model, there's millions but you'd have to try pretty hard to get it wrong. Even if the torque doesn't feel right you can adjust the sizes of your pulley wheels and change your motor speed (for your fixed RPM requirements)

To control the speed of the motor all you have to do is throttle it's input voltage. If you search for an L298N module on ebay you'll get a little H bridge module that'll trivialise speed and direction control for you for around $10, if you cbf designing any electronics.

Shame Boy
Mar 2, 2010

So I've noticed this suggestion about decoupling capacitor layout in a few different datasheets and I don't get it:

Some PIC Datasheet posted:

On the board layout from the power supply circuit, run the power and return traces to the decoupling capacitors first, and then to the device pins. This ensures that the decoupling capacitors are first in the power chain.

Assuming the decoupling cap is within a few mm of the pin, why would it matter that the trace goes to the cap and then the pin?

ante
Apr 9, 2005

SUNSHINE AND RAINBOWS
If the cap is actually a couple metres away, so the propagation speed of the electrons is measurable, then momentary variations on current draw would allow the voltage rail to wildly swing up or down.

I suspect you know this though. Just consider that if a cap is in line with the power rail, it is "decoupling" voltage swings from one section to the next. If it's just off to the side, it's merely an energy tank, relying on the resistance of the traces before the PIC power section to slow the voltage rising and falling enough that it can take/replace energy before it fucks poo poo up.

Now, in practice, it might not matter so much. I've seen that recommendation in PIC datasheets and frequently broken it when convenient to do so, but most of electronics is just conceptualizing concepts as they would work if trending to infinity

longview
Dec 25, 2006

heh.
It could potentially very slightly reduce the amount of conducted emissions from the IC by making a really high frequency LC filter.

From the ICs perspective it won't make any difference if the cap is 10mm away and in-line with the supply or 10mm away on a separate trace, the inductance to the cap is the same.

jovial_cynic
Aug 19, 2005

If I have a sensor that outputs range from 10kohms to 20kohms, but I have a sensor gauge that is expecting a resistance value range of 10ohms to 200ohms, I know I could either:

1) Get a new sensor that's appropriate for the gauge
2) Get a new gauge that's appropriate for the sensor
3) Magic.

What's the magic formula? I have a general understanding of stacking individual resistors to adjust a single value of resistance, but I'm having trouble picturing how to adjust the output of a sensor so that the full sweep of values falls within a particular range.

Similarly but separately, if the sensor had an output range of 10ohms to 100ohms, but the gauge was expecting 100ohms to 10ohms (reverse), is there an easy to address this with an arrangement of components?

babyeatingpsychopath
Oct 28, 2000
Forum Veteran


jovial_cynic posted:

If I have a sensor that outputs range from 10kohms to 20kohms, but I have a sensor gauge that is expecting a resistance value range of 10ohms to 200ohms, I know I could either:

1) Get a new sensor that's appropriate for the gauge
2) Get a new gauge that's appropriate for the sensor
3) Magic.

What's the magic formula? I have a general understanding of stacking individual resistors to adjust a single value of resistance, but I'm having trouble picturing how to adjust the output of a sensor so that the full sweep of values falls within a particular range.

Similarly but separately, if the sensor had an output range of 10ohms to 100ohms, but the gauge was expecting 100ohms to 10ohms (reverse), is there an easy to address this with an arrangement of components?

I've been tackling this for a bit with a circuit simulator and here's my thoughts (before an EE shows up).

Your sensor Rmin/Rmax ratio is 1:2. Your gague Rmin/Rmax ratio is 1:20. I don't think some simple parallel resistors will fix that. Given a nominal 12V source voltage, your gauge will draw 60mA at the high end, and 1.2A at the low end. Paralleling a resistor at the low end of your sensor means ~10ohm resistor for your expected gauge current, but a ~200ohm resistor at the high end. Splitting the difference at 100 ohms means your gauge only swings <1%, because the parallel resistor dominates the current.

For your other problem, if you have some potentiometer that's reading backwards, normally you just hook the wires up to the terminals in the other order and its output changes. So if you have a 3-wire fuel level sender that's normally red + black - green sig, you would swap red and black. Originally, low fuel would give you high voltage on green, now low fuel gives you low voltage on green. If it's a two-wire float, then you just turn the sensor upside-down on its bracket and possibly re-bend the arm.

A real EE will probably show up shortly with some kind of amplifier or magic resistor divider magic.

Sagebrush
Feb 26, 2012

What is the sensor and what is the gauge? There is probably a much easier way to go about this than trying to create some analog resistor network.

Most of the time, resistive sensors are measured by putting them in series with a known resistance, which forms a voltage divider, and measuring the voltage in the middle of the circuit. So let's say that your existing gauge puts its expected sensor (10-200Ω, R1) in line with a 100.0Ω precision resistor (R2) and puts 12v (Vcc) across the line, with the sensor on the high side of the circuit.

When your sensor's resistance is 10Ω, the measured voltage in the divider will be (Vcc * R2) / (R1 + R2) = 10.9v
When your sensor's resistance is 200Ω, the measured voltage in the divider will be 4v.

So what you need to do is build a circuit that will convert your 10kΩ-20kΩ into a 10.9-4.0v range, and put that into the gauge wherever it's expecting to read a voltage. Knowing what sensor you're using would be helpful.

Shame Boy
Mar 2, 2010

ante posted:

If the cap is actually a couple metres away, so the propagation speed of the electrons is measurable, then momentary variations on current draw would allow the voltage rail to wildly swing up or down.

I suspect you know this though. Just consider that if a cap is in line with the power rail, it is "decoupling" voltage swings from one section to the next. If it's just off to the side, it's merely an energy tank, relying on the resistance of the traces before the PIC power section to slow the voltage rising and falling enough that it can take/replace energy before it fucks poo poo up.

Now, in practice, it might not matter so much. I've seen that recommendation in PIC datasheets and frequently broken it when convenient to do so, but most of electronics is just conceptualizing concepts as they would work if trending to infinity

I'm not sure I get this in terms of propagation delays, because if the cap is the same distance from the pin (but either on the power rail or off to one side) I'd think the propagation time would be exactly the same and the only thing that would change is the capacitor would have to recharge over twice the distance. However I made a little toy model of the inductances and resistances in LTSpice and the LC filter effect makes a huge difference, at least with the unrealistically large losses I simulated, so I get that at least:

Shame Boy
Mar 2, 2010

Anyway BattleMaster you're the guy who's built a bunch of radiation detectors right? I'm thinking about building a proportional counter next because geiger counters are fun but I think I've extracted all the fun I can from just clicks. Got any resources you could recommend?

Shame Boy
Mar 2, 2010

By the way, Arrow is currently running a deal where you buy $50 worth of stuff and get a free Raspberry Pi 3B. I know this because I just bought a little over $50 worth of stuff from them and noticed the ad for the deal after I completed the order :saddowns:

sharkytm
Oct 9, 2003

Ba

By

Sharkytm doot doo do doot do doo


Fallen Rib

ate all the Oreos posted:

By the way, Arrow is currently running a deal where you buy $50 worth of stuff and get a free Raspberry Pi 3B. I know this because I just bought a little over $50 worth of stuff from them and noticed the ad for the deal after I completed the order :saddowns:

Call/email their order support folks. I'll bet they'd throw one in.

BattleMaster
Aug 14, 2000

ate all the Oreos posted:

Anyway BattleMaster you're the guy who's built a bunch of radiation detectors right? I'm thinking about building a proportional counter next because geiger counters are fun but I think I've extracted all the fun I can from just clicks. Got any resources you could recommend?

Have you read "Radiation Detection and Measurement" by Knoll? It helps to have a good theoretical background on the hows and whys of gas-filled detectors. In 4th edition, you want to skim chapters 1 and 2 for anything you don't already know, give a closer skim over chapters 3 and 4 for the statistics and general stuff, and then read 5 through 7 to learn everything you'd want to know and more about gas-filled detectors. Chapters 16 through 18 cover the electronics, but don't really give circuit explanations or examples.

Pulse Recorder and Analyzer turns a PC audio input into a multichannel analyzer. I have access to actual multi-thousand dollar equipment at my job but I hooked up a test pulser to my computer and it seemed like it was getting good results with this software.

If you don't want to build a charge-sensitive preamplifier yourself (this is needed to collect the charge from the detector and turn it into a pulse that's suitable to be shaped and measured), Cremat sells reasonably-priced modules and instruments based on those modules. The modules are like $50 bucks Canadian last time I checked and you just need a +/- 12V power supply for them to work. I use these at my job when I have to build the preamp into something and it's impractical to connect an external one.

If you want to build a preamp yourself, I can give you a design that you can build for like $20 bucks with parts from Digikey. What's funny is I independently came up with this design but the company Spectrum Techniques sells a full preamp instrument that's almost identical. I thought i was cheating by using an op-amp with an integrated JFET input stage but they had the same idea. You'll need to build or find a +/- 6-12 volt supply for it.

You'll need a variable high-voltage power supply. The proper radiation detector NIM bin modules are expensive so you'll probably want something more general purpose. I use an HP 6516A power supply from the 60s that I lucked out and got an eBay for under $200 a few years ago. There might be something more modern, cheap, and hobby-grade if you go digging but you'll want something that can be varied up to +1000 volts at least.

You may find it easier as a hobbyist to build a scintillator-based gamma detector than a proportional counter just due to poor availability of inexpensive proportional gas tubes. Most of the stuff here still applies if you go that route - you may just need a power supply that goes up to maybe 2000-3000 volts instead.

If you need any more guidance I'll be here.

Edit: you may be able to forgo high voltage altogether with a photodiode detector but I don't know much about that from a hobbyist point of view

BattleMaster fucked around with this message at 21:24 on Jun 28, 2018

Shame Boy
Mar 2, 2010

BattleMaster posted:

Have you read "Radiation Detection and Measurement" by Knoll? It helps to have a good theoretical background on the hows and whys of gas-filled detectors. In 4th edition, you want to skim chapters 1 and 2 for anything you don't already know, give a closer skim over chapters 3 and 4 for the statistics and general stuff, and then read 5 through 7 to learn everything you'd want to know and more about gas-filled detectors. Chapters 16 through 18 cover the electronics, but don't really give circuit explanations or examples.

All I've really read so far other than example circuits and wikipedia was a few academic papers I yanked from sci-hub, so that sounds pretty great, thanks.

BattleMaster posted:

Pulse Recorder and Analyzer turns a PC audio input into a multichannel analyzer. I have access to actual multi-thousand dollar equipment at my job but I hooked up a test pulser to my computer and it seemed like it was getting good results with this software.

If you don't want to build a charge-sensitive preamplifier yourself (this is needed to collect the charge from the detector and turn it into a pulse that's suitable to be shaped and measured), Cremat sells reasonably-priced modules and instruments based on those modules. The modules are like $50 bucks Canadian last time I checked and you just need a +/- 12V power supply for them to work. I use these at my job when I have to build the preamp into something and it's impractical to connect an external one.

If you want to build a preamp yourself, I can give you a design that you can build for like $20 bucks with parts from Digikey. What's funny is I independently came up with this design but the company Spectrum Techniques sells a full preamp instrument that's almost identical. I thought i was cheating by using an op-amp with an integrated JFET input stage but they had the same idea. You'll need to build or find a +/- 6-12 volt supply for it.

Yeah the main reason I'm doing this is because I like the process of building the stuff, so I'd be more interested in going off something like your preamp design rather than a pre-built module.

BattleMaster posted:

You'll need a variable high-voltage power supply. The proper radiation detector NIM bin modules are expensive so you'll probably want something more general purpose. I use an HP 6516A power supply from the 60s that I lucked out and got an eBay for under $200 a few years ago. There might be something more modern, cheap, and hobby-grade if you go digging but you'll want something that can be varied up to +1000 volts at least.

Way ahead of you on this one, I've designed and built a nice and stable digitally-controlled power supply that in its current form can output between 100V and 800V at low current suitable for use with the geiger tubes, and I specifically designed it to be easy to boost up into the thousands of volts by swapping out a few components because I knew that's where I'd be going next. I'm slowly putting together a detailed blog post about the design and build process of this that I'll link in this thread when I'm done if anyone's interested in pointing out why my design sucks and is a deathtrap

BattleMaster posted:

You may find it easier as a hobbyist to build a scintillator-based gamma detector than a proportional counter just due to poor availability of inexpensive proportional gas tubes. Most of the stuff here still applies if you go that route - you may just need a power supply that goes up to maybe 2000-3000 volts instead.

I found out about CosmicWatch recently and from that bought a couple of high-sensitivity photodiodes (the company has a pretty decent sale for people who are buying low volumes specifically for this application) and some scintillator material, so I'll probably get around to putting one of those together sooner or later. I also drunkenly ordered a PMT off ebay the other night so maybe I'll go that route too :v:

BattleMaster posted:

If you need any more guidance I'll be here.

Edit: you may be able to forgo high voltage altogether with a photodiode detector but I don't know much about that from a hobbyist point of view

Thanks!

Shame Boy
Mar 2, 2010

sharkytm posted:

Call/email their order support folks. I'll bet they'd throw one in.

Yeah I sent them a message. I already have a Pi 3B so it's not too big a deal if they don't, but eh it's always nice to have more junk for my junk collection

BattleMaster
Aug 14, 2000

Here's the charge-sensitive preamp I designed; it may be a good starting point. Please excuse my crusty symbols. I hadn't bothered to show the +/- 12V supply for the op-amp since I couldn't decide how to best represent that, but you'll want some bypass caps or filtering on those voltages.



This should work for essentially any kind of detector. Regardless of the detector, the bias voltage should be positive and the detector connection should connect to the anode of the detector, and the case (for a proportional gas tube) or photocathode (for a photomultiplier) should be grounded. If you're using a PMT the resistors in the dynode resistor divider should be >>R2.

R1 and C1 form an RC filter that helps a bit to smooth out the detector bias voltage. It also helps to prevent sharp rises and falls that can send big voltage spikes through C2 into the sensitive low-voltage side. Not every preamp has protection about it and it's a common thing for the delicate input JFETs to get toasted because of that - I've had to replace a few because of that.

You may want to adjust the various resistor and capacitor values for a different time constant on the integrator or a different gain on the output amp, and you may not care about the 47 ohm output resistor. For board layout, you want C3 and R3 to be as close to the input and output of the op amp as possible. You'll also want to minimize the distance between the inverting input of the integrator and the anode of your tube. Coax of up to a couple of feet should be okay, but try to minimize the capacitance to ground in your board design.

Be sure to make sure there's adequate spacing on the high voltage side of things and be sure to use connectors and cables that are rated for high voltage. BNC probably won't cut it at the voltages you want to use so consider looking for MHV or SHV stuff.

Here's a preamp I was asked to try to fix a few months ago that amused me because it's shockingly similar to mine, right down to the same op-amp: http://www.spectrumtechniques.com/wp-content/uploads/2016/12/PA1-Manual.pdf

I didn't include a test input in my design since most hobbyists don't have a tail pulse generator, but you can refer to the Spectrum Techniques schematic for an idea of how to do that.

If you decide to try a different op-amp, be sure it has a JFET input stage or otherwise has a very high input impedance. You can also try designing your own external JFET input stage which is common in most commercial preamps but you'll need a high end JFET that may cost about the same as that particular op-amp anyway.

Full disclosure: I haven't actually built this preamp for real yet; I've had the design sitting around for a couple of years. But given that Spectrum Techniques' design is so similar and works just fine, it should be fine as well.

Edit: should work fine for a photodiode as well, but you want to reverse bias it, and obviously you won't need to worry about high voltage stuff

BattleMaster fucked around with this message at 02:15 on Jun 29, 2018

Shame Boy
Mar 2, 2010

BattleMaster posted:

Here's the charge-sensitive preamp I designed; it may be a good starting point. Please excuse my crusty symbols. I hadn't bothered to show the +/- 12V supply for the op-amp since I couldn't decide how to best represent that, but you'll want some bypass caps or filtering on those voltages.



This should work for essentially any kind of detector. Regardless of the detector, the bias voltage should be positive and the detector connection should connect to the anode of the detector, and the case (for a proportional gas tube) or photocathode (for a photomultiplier) should be grounded. If you're using a PMT the resistors in the dynode resistor divider should be >>R2.

Ah cool, that's pretty easy to follow

BattleMaster posted:

R1 and C1 form an RC filter that helps a bit to smooth out the detector bias voltage. It also helps to prevent sharp rises and falls that can send big voltage spikes through C2 into the sensitive low-voltage side. Not every preamp has protection about it and it's a common thing for the delicate input JFETs to get toasted because of that - I've had to replace a few because of that.

On my current geiger counter design I used a couple of very low reverse leakage diodes (the BAQ134, 500nA max leakage) to clip voltages to the power rails, and that apparently worked too well - I had to bodge in a 10M resistor to ground because once charge got in there it couldn't get back out. Would adding these clipping diodes to this circuit be a good idea to protect the JFETs or is even 500nA too much for this kind of signal?

Also while on the topic of R1 and C1, I found the following circuit in a LND datasheet for the 71210 energy compensated GM tube:



I've never seen a tube hooked up like that, since usually the cap is directly on the anode like in your circuit. I thought about it a bit and it sorta makes sense - this way you don't have any capacitors directly across the tube itself, so there's no current surge other than the tube's own capacitance. I'm guessing there's a trade-off in doing it this way that I'm missing though...

BattleMaster posted:

You may want to adjust the various resistor and capacitor values for a different time constant on the integrator or a different gain on the output amp, and you may not care about the 47 ohm output resistor. For board layout, you want C3 and R3 to be as close to the input and output of the op amp as possible. You'll also want to minimize the distance between the inverting input of the integrator and the anode of your tube. Coax of up to a couple of feet should be okay, but try to minimize the capacitance to ground in your board design.

Be sure to make sure there's adequate spacing on the high voltage side of things and be sure to use connectors and cables that are rated for high voltage. BNC probably won't cut it at the voltages you want to use so consider looking for MHV or SHV stuff.

Yeah finding good HV connectors that don't cost $50 each has been a bit challenging. Right now the power supply has a big beefy overspec'd terminal block that can handle something like 1000V at 20A that I got just for the "1000V" part, but I know that once I go over 1000V terminal blocks won't cut it anymore so I'm already looking for alternatives. I also got some HV conformal coating lacquer stuff to slather on the board once it's done, just for extra protection.

BattleMaster posted:

Here's a preamp I was asked to try to fix a few months ago that amused me because it's shockingly similar to mine, right down to the same op-amp: http://www.spectrumtechniques.com/wp-content/uploads/2016/12/PA1-Manual.pdf

I didn't include a test input in my design since most hobbyists don't have a tail pulse generator, but you can refer to the Spectrum Techniques schematic for an idea of how to do that.

If you decide to try a different op-amp, be sure it has a JFET input stage or otherwise has a very high input impedance. You can also try designing your own external JFET input stage which is common in most commercial preamps but you'll need a high end JFET that may cost about the same as that particular op-amp anyway.

Full disclosure: I haven't actually built this preamp for real yet; I've had the design sitting around for a couple of years. But given that Spectrum Techniques' design is so similar and works just fine, it should be fine as well.

Edit: should work fine for a photodiode as well, but you want to reverse bias it, and obviously you won't need to worry about high voltage stuff

Thanks!

Slugworth
Feb 18, 2001

If two grown men can't make a pervert happy for a few minutes in order to watch a film about zombies, then maybe we should all just move to Iran!
This the right thread for a small motor question? Sorry if not.

I've got a suction pump that stopped working. Switching it on causes a momentary quiet buzzing sound and then it shuts off. I pulled off the end of the casing and turned it on, and it makes the usual operating sound but doesn't have any suction. Replacing the end of the casing immediately shuts it off. Any ideas? Have an imgur album:

https://m.imgur.com/a/hPafYDM

Should the plate that those brushes contact be spinning? Because it doesn't, and my limited understanding is that you'd only need brushes there if it spun. (It's not super clear in the picture, but in the second photo there's a plate that gets pushed in towards the motor which then pushes 4 brushes against a larger plate behind it.)

Slugworth fucked around with this message at 18:39 on Jun 29, 2018

Shame Boy
Mar 2, 2010

Slugworth posted:

This the right thread for a small motor question? Sorry if not.

I've got a suction pump that stopped working. Switching it on causes a momentary quiet buzzing sound and then it shuts off. I pulled off the end of the casing and turned it on, and it makes the usual operating sound but doesn't have any suction. Replacing the end of the casing immediately shuts it off. Any ideas? Have an imgur album:

https://m.imgur.com/a/hPafYDM

Should the plate that those brushes contact be spinning? Because it doesn't, and my limited understanding is that you'd only need brushes there if it spun. (It's not super clear in the picture, but in the second photo there's a plate that gets pushed in towards the motor which then pushes 4 brushes against a larger plate behind it.)

The buzzing definitely sounds like a motor that's just rapidly oscillating in place which would happen if the brushes are messed up or something else was preventing it from advancing along with the phase properly. It shutting off might be it blowing an internal thermal trip / breaker or something like that. Does the motor have a starting capacitor? Can you take the suction bit off the front and see if it can spin without any load, or is it all integrated too much?

Aurium
Oct 10, 2010
I assume it's a centrifugal pump. Can you see the impeller?

BattleMaster
Aug 14, 2000

ate all the Oreos posted:

On my current geiger counter design I used a couple of very low reverse leakage diodes (the BAQ134, 500nA max leakage) to clip voltages to the power rails, and that apparently worked too well - I had to bodge in a 10M resistor to ground because once charge got in there it couldn't get back out. Would adding these clipping diodes to this circuit be a good idea to protect the JFETs or is even 500nA too much for this kind of signal?

Here's an example from another preamp module of how to add protection:



An RC filter on the bias supply and being sure to gradually dial the voltage up and down instead of just slamming the bias supply on or off will protect you from the worst things that can happen, but you can add a diode configuration like that which will shunt big transients away from the sensitive input of the preamp.

You want to avoid leakage which will weaken signals and put a lower limit on what events you can detect, but added capacitance will wreck the energy resolution of your setup so you need to watch that as well. Knoll has a good discussion of why this is the case, but the main thing you need to do is make sure the capacitance of the diodes isn't excessive.

quote:

Also while on the topic of R1 and C1, I found the following circuit in a LND datasheet for the 71210 energy compensated GM tube:



I've never seen a tube hooked up like that, since usually the cap is directly on the anode like in your circuit. I thought about it a bit and it sorta makes sense - this way you don't have any capacitors directly across the tube itself, so there's no current surge other than the tube's own capacitance. I'm guessing there's a trade-off in doing it this way that I'm missing though...

Dunno. I've seen all sorts of weird poo poo recommended for hooking up G-M tubes.

That setup isn't too far off from the standard, but it's like it's tapped off the bias resistor instead of getting the signal right from the anode. It could be that it takes the edge off of the signal, which for a G-M tube can be quite substantial given that a typical Geiger discharge liberates a lot of electrons. You can see signals coming out of G-M tubes in the tens of volts while strong signals from a proportional counter are typically in the hundreds of millivolts. This is also why you typically don't need anything resembling a preamp for a G-M tube while you need to be careful about preamp design for other forms of detector; the signal from a G-M tube can get you a nice loud click from a piezo element without any active electronics.

quote:

Yeah finding good HV connectors that don't cost $50 each has been a bit challenging. Right now the power supply has a big beefy overspec'd terminal block that can handle something like 1000V at 20A that I got just for the "1000V" part, but I know that once I go over 1000V terminal blocks won't cut it anymore so I'm already looking for alternatives. I also got some HV conformal coating lacquer stuff to slather on the board once it's done, just for extra protection.

SHV connectors are the standard modern connector. They're typically rated for 5000 volts/5 amps. They're also pretty expensive.

MHV connectors are an older standard that is rated for 5000 volts/3 amps. They were abandoned in favour of SHV at some point because of safety issues. They make contact with the center wire first instead of the grounded case which can momentarily electrify the case of some electronics if you hot plug. They also look like BNC if you don't know what to look for, and will mate with BNC connectors without a lot of added force, which is an obvious problem given that BNC is typically rated for 500 volts.

They're safe enough if you don't make connections while your system is energized, and you can find MHV stuff on Ebay for low enough prices, so I recommend using them as a hobbyist over anything you can rig up yourself, and definitely is a better option than hoping and praying that you can overvolt BNC stuff.

Slugworth
Feb 18, 2001

If two grown men can't make a pervert happy for a few minutes in order to watch a film about zombies, then maybe we should all just move to Iran!

ate all the Oreos posted:

The buzzing definitely sounds like a motor that's just rapidly oscillating in place which would happen if the brushes are messed up or something else was preventing it from advancing along with the phase properly. It shutting off might be it blowing an internal thermal trip / breaker or something like that. Does the motor have a starting capacitor? Can you take the suction bit off the front and see if it can spin without any load, or is it all integrated too much?
The shutting off at this point only happens when I reassemble it, and immediately so. If it's partially disassembled as pictured, it'll 'run' (albeit without any suction) no problem. And what's odd is, the only thing I can see that would change when closed is the brushes getting engaged, but by the same token, if I just manually engage the brushes while disassembled, it doesn't shut off.

The other side of the pump, where the suction tubing connects, does come off in theory, but there's a stripped screw that's keeping me from taking it apart, so not sure if there's a starter cap. I don't see one anywhere I can access, but it was definitely my first thought.

Aurium posted:

I assume it's a centrifugal pump. Can you see the impeller?
Not sure if its a centrifugal pump or not (I'm super out of my depth on this), but if it helps guess what sort of pump it is, it's a surgical suction machine. Hose goes from the unit to a glass jar that has a second hose that runs to the patient. No fluid ever enters the pump itself, so I'm assuming there's no impeller? Perhaps it'd be more fair to call it a vacuum than a pump.

babyeatingpsychopath
Oct 28, 2000
Forum Veteran


Slugworth posted:

The shutting off at this point only happens when I reassemble it, and immediately so. If it's partially disassembled as pictured, it'll 'run' (albeit without any suction) no problem. And what's odd is, the only thing I can see that would change when closed is the brushes getting engaged, but by the same token, if I just manually engage the brushes while disassembled, it doesn't shut off.

The other side of the pump, where the suction tubing connects, does come off in theory, but there's a stripped screw that's keeping me from taking it apart, so not sure if there's a starter cap. I don't see one anywhere I can access, but it was definitely my first thought.

Not sure if its a centrifugal pump or not (I'm super out of my depth on this), but if it helps guess what sort of pump it is, it's a surgical suction machine. Hose goes from the unit to a glass jar that has a second hose that runs to the patient. No fluid ever enters the pump itself, so I'm assuming there's no impeller? Perhaps it'd be more fair to call it a vacuum than a pump.

That plate-and-brushes attachment is for the centrifugal switch that pulls the start cap out of the circuit and switches in the run cap (or switch out the start coil and switches in the run coil). Your motor is junk. Unmount it and get a new motor; finding replacement parts for stuff like this is not worth the time. If your time is worthless and you want to learn, then start reading resistances on coils and stuff and you can probably find the one that's opened up.

Slugworth
Feb 18, 2001

If two grown men can't make a pervert happy for a few minutes in order to watch a film about zombies, then maybe we should all just move to Iran!

babyeatingpsychopath posted:

That plate-and-brushes attachment is for the centrifugal switch that pulls the start cap out of the circuit and switches in the run cap (or switch out the start coil and switches in the run coil). Your motor is junk. Unmount it and get a new motor; finding replacement parts for stuff like this is not worth the time. If your time is worthless and you want to learn, then start reading resistances on coils and stuff and you can probably find the one that's opened up.
Cool, if it's not an easy fix, it's definitely not worth my time. Now the boss will have to pony up for a nice new pump.

Or buy this exact same decades old unit off of ebay for a third time.

Adbot
ADBOT LOVES YOU

Stabby McDamage
Dec 11, 2005

Doctor Rope
Hey, folks. I need to get multiple analog readings into a raspberry pi with 16-bit resolution at 250 kHz. Any thoughts on good ways to do that?

I have ADCs that have 16 parallel bits of output, but I can't bit-bang fast enough, and I'm not sure if I could DMA or something for that. So anything that can eat 16 parallel bits at 250kHz would also work.

The end result is I need a dump of the analog readings in a file on the Pi.

(This is for an insane ocean sonar probe thing)

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply