Coder Social home page Coder Social logo

fourthievesvinegar / microlab Goto Github PK

View Code? Open in Web Editor NEW
18.0 5.0 2.0 930 KB

DEPRECATED! See https://github.com/FourThievesVinegar/solderless-microlab

Home Page: https://fourthievesvinegar.org/

HTML 34.21% JavaScript 1.89% Python 57.14% Shell 2.96% Roff 3.80%
biohacking chemistry medicine

microlab's Introduction

FTVC Microlab

NOTE: This project is outdated. The new version is here.

Four Thieves Vinegar Micro Lab

This is the software component for controlling and monitoring the Four Thieves Vinegar Collective's Apothecary Microlab hardware. It's built for Raspberry Pi using Python 3.6 for the API and controller service layer and JavaScript for the UI.

This is beta software and is under active development.

For more information about the project, visit our website: https://fourthievesvinegar.org/

Installation

It is advised you're using a virtualenv. Then install all the deps in requirements.txt:

pip install -r requirements.txt

Then you need to install RabbitMQ. If you're on a Debian/Ubuntu-based system you can run ./rabbitmq_install.sh. But make sure to fill in PASS in ./rabbitmq_install.sh and AMPQ_PASS in microlab/settings.py. If you're not on a Debian/Ubuntu system you'll need to follow: https://www.rabbitmq.com/download.html

Running the Software

First you need to run the Celery task mamager, from the root microlab directory:

celery -A microlab.tasks worker --loglevel INFO

From the microlab root directory, just run the following command to run the Flask microservice layer.

FLASK_DEBUG=true ./run.py

The API will be running at localhost:5000.

Software Architecture

Micro Lab Software Architecture

Hardware

STL files for building the 3D-printed microlab equipment can be found here https://github.com/FourThievesVinegar/Parts

Microlab PCB design files and outputs can be found here: https://github.com/FourThievesVinegar/microlab-pcb

microlab's People

Contributors

brandonrobertz avatar sparklestheunicorn avatar spikenebula avatar thedukezip avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

microlab's Issues

Determine File Format

Issue by TheDukeZip
Sunday Aug 21, 2016 at 02:34 GMT
Originally opened as https://github.com/TheDukeZip/4tvc/issues/9


We need to define the file format to distribute manufacturing instructions.

We can use the SW arch concept document as a guideline, but we aren't married to using any of the fields as written

Part of this involves creating a language of instructions for the hardware operations. The language probably should be somewhat human readable but not English either.

Create Custom Objects

Issue by TheDukeZip
Sunday Aug 21, 2016 at 02:10 GMT
Originally opened as https://github.com/TheDukeZip/4tvc/issues/2


We should create custom objects for the hardware devices which contain the properties of those objects - this will make the code easier to read and maintain.

As an example a syringe object would contain a motor object and two button objects. The button objects could inherit from gpiozero.Button but contain an additional property that specifies whether the button is for forward or reverse shutoff

[CLOSED] Setup a Docker image to enable front end development work using stub services and Nginx

Issue by fivetwentysix
Saturday Sep 10, 2016 at 02:14 GMT
Originally opened as https://github.com/TheDukeZip/4tvc/issues/15


Looks like you need help Duke,

I need a way to setup a dev environment easily; without all the Pis since it's inconvenient to set that up as I'm about to travel a bit. I'm pretty sure I'm not the only one to have this issue. With the new Native docker setups for OSX and Windows we should definately go with docker for dev environments at least.

I'm happy to take ownership of this, but maybe lets set a time to pair Duke to get us through this faster?

Middle Tier Controller Service

Issue by TheDukeZip
Sunday Aug 21, 2016 at 02:41 GMT
Originally opened as https://github.com/TheDukeZip/4tvc/issues/12


Create the middle tier controller service.

To start this can just support the diagnostic APIs, but eventually will be responsible for reading instructions out of the pharmaceutical file, prompting the user as needed, and operating the hardware as specified in the instructions.

Revamp JS UI

The current UI is an extremely rough and primitive jQuery based mockup, essentially. We need to streamline it, make it more modular and extensible. We also need to make it work with the current generation of the microlab backend.

Diagnostic UI Support Variable HW Devices

Issue by TheDukeZip
Sunday Aug 21, 2016 at 02:16 GMT
Originally opened as https://github.com/TheDukeZip/4tvc/issues/4


Once #3 is completed, the services may spit out an arbitrary number of each hardware device. The Diagnostic UI should detect how many of each device get returned from each service and automatically populate the UI with controls for each hardware device.

It would be nice if one property for each HW device was a "Name" field so that each device can have a custom name, which gets displayed on this UI.

UI / UX Concepts

Issue by TheDukeZip
Sunday Aug 21, 2016 at 02:25 GMT
Originally opened as https://github.com/TheDukeZip/4tvc/issues/7


It is desirable to have some fantastic UI designs for the

  • Diagnostic UI
  • Home Page
  • Pharmaceutical properties
  • Going through the process of manufacturing
  • What else do we need? (About page? etc)

We can use the concepts from the initial SW architecture concept or start from scratch.

Should be reviewed by Mixæl at a minimum.

We can possibly use Balsamiq to collaborate or any other tool someone is experienced with.

"Research" Test performance of 1-wire, SPI, and I2C

Issue by TheDukeZip
Friday Aug 26, 2016 at 03:13 GMT
Originally opened as https://github.com/TheDukeZip/4tvc/issues/14


A thermistor that is already coated in glass exists as a possibility for the temperature sensor.

Due to the fact that the Raspberry Pi has no analog input, an offboard A/D converter would be needed to take a temperature reading.

Although we can guess the speed at which we can read the A/D over the various busses should be predictable by specs, actual performance would be interesting to see.

Research and implement a heater control method

We need to find a reliable and safe method for keeping the heat at the correct temperature. The canonical method is via PID. We'll need to implement something similar, either a PID library, or something similar like Kalman Filter. There are libraries for all of these things. We need to abstract them out into a celery process which gets kicked off via a microlab command. This ticket is for the groundwork on this.

Syringe Switches Turn Off Motor Regardless of Direction

Issue by TheDukeZip
Sunday Aug 21, 2016 at 02:20 GMT
Originally opened as https://github.com/TheDukeZip/4tvc/issues/5


When either a forward or reverse stop switch is hit for a syringe, the motor turns off regardless of the direction it is going in.

This initially may not be a problem since the motor.off() operation is trigger by the button push. But if the forward stop switch is down and the syringe starts getting retracted, the forward stop may 'bounce' a bit on release, which would stop the motor. This is not desired behaviour.

This will probably be greatly helped with the completion of #2, since the button objects can contain a property specifying which direction they are intended for. That property should be accessible by the event handler for the button once #2 is completed.

Read Hardware Config from File

Issue by TheDukeZip
Sunday Aug 21, 2016 at 02:15 GMT
Originally opened as https://github.com/TheDukeZip/4tvc/issues/3


The services should pick up the hardware config (such as the number of syringes, and which GPIO pins are associated with the motors and the switches) from one config file.

This allows us to have one place to configure the hardware GPIO pins (later on, we could have a UI that allows the user to configure them.)

It also allows us to have a variable number of each hardware device. You could add another syringe to the config and the service would automatically show it as available, and it could be controlled through the interface.

We should probably do this after #2 so that we know exactly what properties each device contains.

We also may want to speak to #Chemistry about whether we would ever need to support two heaters running off the readings from one temp sensor... or using two temp sensors with one heating element.

Streamline Deployment Process

Issue by TheDukeZip
Sunday Aug 21, 2016 at 02:08 GMT
Originally opened as https://github.com/TheDukeZip/4tvc/issues/1


Manually running the uwsgi services (through the script) and nginx is fine for now but inconvenient.

Ideally, the uwsgi services should have .ini files in /etc/uwsgi/apps-available (and symbolic links to them in /etc/uwsgi/apps-enabled) and the nginx.conf pushed into /etc/nginx/nginx.conf. This way, an install script can push that data, then run sudo service uwsgi restart and nginx restart and the apps run automatically in the background. In addition, they would automatically start at boot.

The nginx part is easy, I had some difficulty implementing the right .ini settings for uwsgi, namely the mountpoint. I think this just requires a little reading of the documentation.

Ideally, the services get mounted into /api/syringes /api/heaters and /api/stirrers

PID Controller

Issue by TheDukeZip
Sunday Aug 21, 2016 at 02:31 GMT
Originally opened as https://github.com/TheDukeZip/4tvc/issues/8


We would like the solution temperature to be controlled by some PID controller code.

We probably shouldn't start on this until we have a very good idea of what temperature sensor we are going to use, and what heating method and element will be used, so that we can test and know if we have a working solution or not.

There are many Python PID controller examples we can look into online, although the solution does not need to be in Python if performance is an issue. The architecture allows us to call out to any code, or we could even implement as a kernel module if necessary.

Output of this probably involves using the code to control the temperature of multiple solutions with different specific heats, such as water and canola oil.

This may involve adding a calibration mechanism to the heater service which can be called to calibrate the PID controller for whatever we are heating.

Final output may require using a second temperature sensor on a computer logging the temperature, with some graphs that show the results using the PID controller to regulate the temperature of the different liquids, at multiple different temperatures. These graphs could be reviewed by #Chemistry to see if they are acceptable.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.