Tested only on Ubuntu and raspbian. Run
git submodule init
git submodule update
./setup.sh install_once
to install dependencies. Then run with
./server.py --fake
.
If you are on an actual Pi with the ADS1115 connected
to the first i2c channel, run
./setup.sh
to install dependencies, do per-boot configuration, and test the config. Then run
sudo ./server.py
and visit http://localhost:8000/ to load the UI. A developer console is available at /dev.html.
Re-run ./setup.sh
after each boot to rerun any per-boot configuration.
The server must run as a user that
has access to /dev/mem
in order to control the GPIO; if you don't want to run the server
as root, you can add the user running the server to kmem
but in practice this is not terribly
different than running as root.
- server.py glues everything together. It instantiates a Robot or a FakeRobot, a Controller, and a webapp2.WSGIApplication. It has all the request handler implementations, and even the recipe "compiler."
- robot.py - robot.py is a thin layer over parts/
- fake_robot.py - pretends to be a thin layer over parts/ so the UI can be run on a normal machine. It's the scumbag steve of robots.
- actions/ - classes that take a Robot instance and implement high-level actions like "Meter", "Move", and "Home."
- config/ - includes configuration parameters.
- drinks/ - code to generate drink recipes
- parts/ - code to interface with robot components (like the stepper, load cell, and GPIO)
- static/ - HTML, CSS, JS, and images served as is for the UI.
- templates/ - HTML templates that are modified server-side before being sent to the client.
- wikiaparse/ - a horrible mistake.
A Raspberry Pi is used for the CPU.
Fluid levels are monitored using a load cell; the output from the load cell is a voltage difference that is amplified (INA129), digitized (ADS1115), and read through i2c. See monitor_load_cell.py.
A stepper motor is used to move the chuck along the track. See toggle_pin.py.
Valves are actuated using io_bank.py.
http://www.adafruit.com/products/1085
- VDD: 3.3v
- GND: GND
- SCL: rPI SCL
- SDA: rPI SDA
- ADDR: GND
- A0: INA129 Vo
- A1: INA129 Ref / GND
http://www.ti.com/product/ina129
- p1-p8: 100 ohm resistor -- configures 500x gain
- p2: Vin- load cell white
- p3: Vin+ load cell blue
- p4: V-, ground
- p5: Ref, GND (and ch0 on the ADS1115)
- p6: Vo - ch1 on the ADS1115
- p7: 3.3v to ensure Vo is clamped (0, 3.3v)
A load cell is used to weigh the glass and any liquid it contains. Using weight to meter alcohol allows us to use cheap solenoid valves ($4/ea) instead of expensive peristaltic pumps and still achieve reasonable accuracy. Note that we don't have any code to compensate for the extra force from liquid falling into the glass, which causes us to undermeter by a fixed amount. This has been corrected for by increasing the weight we wait for proportional to the requested weight, but really the fixed offset should be measured and added to actions/SimpleMeter.py (or possibly actions/Meter.py ).
http://www.amazon.com/gp/product/B005GIXJKY/ref=wms_ohs_product?ie=UTF8&psc=1
- Black: GND
- Red: +10v
- White: Vo-
- Blue: Vo+
Output is ~1mV/V, or 10mV at the full 1kg load with an activation voltage of 10V. Note that the differential reading can be negative if there is net upward force on the load cell (true of NEBree8.0).
High-current shift registers are used to actuate valves and flip the relay controlling the compressor.