• Psychedelic Drugs Welcome Guest
    View threads about
    Posting RulesBluelight Rules
    PD's Best Threads Index
    Social ThreadSupport Bluelight
    Psychedelic Beginner's FAQ
  • PD Moderators: Esperighanto | JackARoe |

Open source Microgram balance

ArakniD

Greenlighter
Joined
May 31, 2007
Messages
15
Hi guys,

I'm not sure where this belongs, but i know this is relevent to everybody in here..

basicaly, i have trowled the internet and my uni skillz and have developed a microgram balance (accurate to +- 0.2mg) using an old galoveter and an optoelectronic transistor and an atmel CPU. you could use a PIC of other microcontroler if you like.

Are there any other micro programmers out there that are willing to put in a few hours to program a command line interface to it? or some build files and/or computer front end via a serial port for using the scales?

the algroithum i've customised is based on a standard PID algoritum with a custom low freqency noise filter and gain feedback for the varying weight conditions. it can weigh from tare weight to maximum electricaly calibrated weight with about 550 stable points.. Depends on the Hz of the PWM output and the PWM accuracy. The atmel i'm using is 16bit accurate at 16Mhz clkHz with a PWM output at 488.1Hz.

it will stabise any weight within its calibrated zone in about 3-4 seconds.

anyhow, i think this would be useful for the safe consumption of psychdelics as the doseage is very important.

the idea was based on the following link:
http://www.erowid.org/archive/rhodium/chemistry/equipment/scale2.html

however the code supplies in that article is for a very specific compiler and building exactly that is near impossible..

PID and low frequency noise filter written in C code.

For this to be usable to other, one would require some kind of timer base schedule (re-calculation) and a streamed data output and command line value/options interface.

Are any programmers here willing to put in a little time doing this?

Are any electrical engineers willing to refine this circuit so that it operates more stabliy?

Would anyone be willing to actualy use the output of this project to enhance their safe measurment of whatever it is that they are doing?

Where does this thread belong?
 
I'm studying to be a computer engineer so I can help out with any programming or digital logic, although I'm not an EE, so I can't help with circuit stuff. Just let me know.
 
(accurate to +- 0.2mg)

did you mean +- 0.2ug?

I'd love to help, but I dont think I have enough knowledge in programming yet to handle something as sensitive as this.
 
AcidRain said:
did you mean +- 0.2ug?

Most lab scales aren't even close to this accurate so I think 0.2mg sounds right.

This is a good idea. That type of accuracy would be great, especially if it means not having to lug around some old Mettler scale from the cold-war era...
 
An opto transistor - sounds interesting considering most scales use things like strain guages or suchlike as the transducer. Is it not possible to simply use the voltage/current output, run it through an op-amp to give the correct sort of scaling then run it straight to a multimeter giving a comparable voltage/current reading (eg so that it reads 1mV for each mg). I know it's an analogue system, but being an old fart I'm a bit happier with building things that work with analogue readings.

If you wanted a dedicated readout, you could always get a chip like a 7017 that is basically a multimeter on a chip with a 7 segment LCD/LED output to drive the final display
 
fastandbulbous said:
An opto transistor - sounds interesting considering most scales use things like strain guages or suchlike as the transducer. Is it not possible to simply use the voltage/current output, run it through an op-amp to give the correct sort of scaling then run it straight to a multimeter giving a comparable voltage/current reading (eg so that it reads 1mV for each mg).

Well, it could be that easy... kind of. The principle of the scale is that the galvanometer's needle, instead of measuring current, is used to lift whatever you're measuring to a certain pre-determined point. By measuring how much current you're using to do that, you can then determine the mass.

The phototransistor/LED and further electronics come in to make the setup more user friendly. Instead of having to crank up the current by hand and read it off, the phototransistor detects when the needle is at the pre-determined point, and if not "adjusts the current" until it is. The reason for the scare quotes, and why the current probably can't just be read off, is because instead of continuously adjusting current it actually sends current in high-frequency on/off pulses to the galvanometer. The average current (alternatively, duty cycle times "on" current) is what you want to measure. The article ArakniD posted mentioned that this pulsing effect actually makes it easier to measure small masses, because it prevents the galvanometer from "sticking".

Edit: Reprased a sentence or two.
 
Last edited:
exaclty.. the beam has a small sheet of aluminium foil that acts to block or allow the optical transistor to recieve the light from the LED side of the circuit. You then get a fairly linear ~126mv to 5000mv output that tells you the beam position.

the circuit is setup to supply constant current with the pulse width modulated sink, which basicaly translates to, 20% PWM = tare weight, 95% PWM = maximum calibrated weight.. lets say 100mg... therefor if it requires 45% PWM to hold the beam at the 2500mV set point from the transistor.. it is equal to 33.33mg...

the actual % is stored and output to a 16bit PWM signal, meaning you have 65535 points to make up zero to 100% PWM duty. so you ignore the bottom 0.00XXXX% basicaly to read a stable weight.

the very good analytical balances, well the one that i use to have.. basicaly works as a floating voice coil from a speaker (kinda) around a ring magnet, with two beams holding the central aluminum beam directly vertical. then at the bottom it has a little bar that blocks an optical transistor just like i have setup. same theory.. except theirs requires a large voice coil, well machined and alligned parts and the use of different materials (copper, aluminum, plastic) in the floating dish to make it work.. you could most probably rip a speaker apart and do this actualy.. but that would require some engineering skills.. maybe as an advanced project?

but good news, both use the same control circuit and calculations :) this one measures zero to how much current you calibrate your galvometer for.. the large your maximum calibration weight and current, the lower low wight accuracy you achieve..

if you used a 40mg weight for instance.. the accuracy would be at about 50-100uG...

cost to make would be about... $20-30 AUD.. if you have a fair bit of electronics laying around... then less.. it cost me $4 to make..
 
Nice work ArakniD !

i would love to see the schematic and source

would also love to see if i could simplify the design to make it more friendly to blueighters.
 
exaclty.. the beam has a small sheet of aluminium foil that acts to block or allow the optical transistor to recieve the light from the LED side of the circuit. You then get a fairly linear ~126mv to 5000mv output that tells you the beam position.

So the degree of occlusion of the light at the phototransistor is controlled by a movable opaque sheet which is directly linked to the weighing platform?

If so, the current pulses should be able to be intergrated by a low pass filter (an active one built around an op amp would suffice I'd imagine) and the dc level produced relate directly to the degree of occlusion. Bit more amplification with another op amp should allow the direct driving of a moving coil meter without any sticking.

I just like the simplicity of analogue systems!
 
Im with F&B on this one. I would like an analogue output with the current driving something like a 7017 to drive a led display.

ArakniD would you mind giving me a PM with the schematic. Ill see if i can tweak it. Either way ill post it back up as an image, that way everyone can see it
 
sure thing :)

but a digital circuit allows you to tare the circuit, then specify maximum weights and stuff... which you analogue one is going to have to do anyhow.. AND you will then need to read in the analogue circuit's voltage to get a reading.. meaning a >16bit ADC.. which most micro's dont have onboard.. so for this instance, the digital circuit would be easier, cheaper to make, less components.. i'll shoot it over now

i have a code snippet aswell..

but i heavily embedded the code into one of my other projects.. so i use that to tare, calibrate and do readings from..

and from using it the other night properly, it was stable to 100uG.. and so long as the PWM output relation to weight is linear, then it was accurate to 100uG.. and it reacts very fast to every single little uG you add to the balance..

Yes, thats the intention, make it so easy any one can do it..

sending over schim now, enjoy!
 
lol spam brings up an awesome thread.

Has the schematics and etc. for this little DIY scale ever been hosted anywhere?
 
Top