Package Arrival Email Automation, google apps script

The packages for MITERS makerships are being routed through me (to force people to go to MITERS, heh). I wrote a quick and dirty script to automate notifying people by email when the packages arrive at MITERS. My first try at google apps scripting.
Google’s documentation is excellent: http://code.google.com/googleapps/appsscript/service_spreadsheet.html
The code is like so:

Which corresponds to a spreadsheet is set up like so.

So, the full steps:
You start out with the raw spreadsheet. Then, to add a script to it, got to Tools > Script Editor… which will take you to a blank version of the following. To check your script for errors, you hit the play button here.

Now, go to Tools > Script Manager > Run to run your script and create the custom menu (which is just for convenience for running your script, but invaluable when you’re rerunning all the time to debug). The first time Google will double-check with you if you want to run this script, since it’s doing Dangerous Things like emailing people under your name. After that you’re set.

The emails, interestingly enough, will NOT thread/group in gmail. So this is still a rather spamtastic script. _shrug_ I don’t care enough. You can see my testing emails below:

I didn’t choose to use an HTML template for me email. See http://googleappsdeveloper.blogspot.com/2011/10/4-ways-to-do-mail-merge-using-google.html if you want to implement that.

6.131 Power Electronics Notes

6.131, Power Electronics, has been a blast, even if it’s completely destroyed any belief I have that I can build a functional circuit. Lectures are awesome and Practical Electronics for Inventors is and awesome and completely readable / understandable book.

Here are the main analogies I have learned through 6.131 in terms of relating power electronics to mechanical mechanisms:

Totem pole: because your comparator’s square wave cannot directly drive FETs (not able to source enough currrent)

Boost converter: (e.g. takes 6V and turns into 15V — usu. cannot get it to gain more than 1 order of magnitude). Like winding up a fishing rod (inductor charging capacitor while diode prevents cap from discharging back into inductor), build up power (pool fishing wire behind you), and then release (snap fishing rod forward).
(thus, do NOT hook up without load because it is like winding up the fishing rod and and whacking the wall repeatedly, over and over, at some kHz aka many times per second).

Buck converter: (e.g. takes 15V and turns into variable 0 to 12V). — a switching amplifier (linear amplifier, like 7805, dumps extra power as heat, while switching stores in cap for later use).

transformer trades off voltage and current like mechanical gearbox trades off speed and torque. also, by power conservation, (and used to measure parasitics / Lleak and Lmag), short one side of transformer = short other side, open circuit one side = open circuit other side.
–> todo: reflecting things across the transformer

regulated voltage — a wall wart http://www.ladyada.net/learn/powersupply/ counts, and then can be further filtered ala 2.007 nano carrier with as switching power supply

===== debugging…
Also, circuit debugging things that 6.131 has taught me:

Getting crazy fuzzy on your 74HC delay circuit? (ringing) — check if you have bypass caps, both on your 12v and 5v rails. (For me, connection a cap across pins 14 and 7 didn’t work either, but dropping a cap across 5v rail worked instantly).

2125 debugging: does not required Vdd, merely requires Vcc and the inputs from the delay circuitry. Pin 2: input. Pin 7: output. On high side, measuring directly may not work (get fast flickering or no visible signal) — to measure high side output, stick probe gnd on pin 5 (gnd) and probe in 7 (output). Same for A (which cannot be measured without a load?)
Totem pole drawing max current when your high side signal from the delay circuit is plugged in?

Check that all the grounds are connected.

If you’re at MITERS, check that it’s not a sketchy scope probe / scope problem.

Do NOT build complicated circuits (e.g. control circuitry) straight on the protoboard, no matter how sure you are of building it correctly — you can spend hours  and have a short somewhere and be hard-pressed to diagnose it or rule your control circuit out as the source of your [short, bug]. Build it on the breadboard first — it really is actually must better than protoboard, no matter any concerns about breadboard sketchiness, the faster prototyping time is definitely worth it.

Building the delays and 555s with unclipped resistors and caps may not be a bad idea, since you’ll reuse these circuits and lot but will need to change the values from lab to lab.

Go-kart circuit from lab 2 is reused in lab 3 — make sure you have a working totem pole, or else that will eat unnecessarily into lab 3 time.

Start on the labs early! and ask for help. Even if it seems like a dumb circuit that should just work, if you’re stuck, asking an experienced circuiteer for help will work wonders and you’ll learn a ton about the circuit too, including all the individual parts which you’ll need to know to help anyone else debug and which you wouldn’t pay attention to if you simply breezed through to a working circuit.

your 74HC wants 5V, not 12V!

connect ALL your grounds.

==== misc from this week: lamp ballast:
to find the resonant frequency, you can try to calc by f = 1 / (2*pi*sqrt(L * C)) = (somewhere in 30 to 40 kHz) and measuring the exact L that you actually wound. alternatively, run the FETs on the totem pole (Vdd) at 12v (Vcc for the IR2125’s is 12V and pulled via a wire from the control circuitry, which you breadboarded on a separate board instead of protoboarded straight on the totem pole board, right?) and adjust the frequency (via pot on 555 or whatever you are using to generate square wave being fed into 311 comparator), sweeping the 30 to 40 kHz range until you found where your power supply is supplying the most current. For me, I found the current peaked at 0.38A at 12v at ~32 kHz (and diminishes to either side), while my calculated resonant frequency was closer to 35kHz. This was the magic sauce that led to my fluorescent bulb striking, yay!

also, you want to ground the ERR pins on the IR2125 / totem with jumpers if you want the 2125s to work. The may work without pulling to ground explicitly, but best not even have to worry about it.

molding and casting research

I conclude that yes, hydrostone and drystone (which mas.863 has lots leftover) can be used for metal casting.

http://www.lagunaclay.com/catalog/pdf/lcc_plaster.pdf
USG PLASTERS & GYPSUM CEMENTS FOR ART, STATUARY & CASTING APPLICATIONS
DRYSTONE Fast-casting gypsum cement that provides strong, durable casts without the need for dryers. Excellent compressive strength and good
impact resistance. Enhanced flexural properties. Low absorption for reduced paint demand. Environmentally preferred to resin-based
alternatives. Available in solid or hollow cast formulas.

HYDRO-STONE Especially suitable where high strength and resistance to wear are necessary. Used in high-quality art and novelty castings, molds, figurines,
modeling material, anchoring material, density fill applications, lamp bases, and die production. Works well in most mold materials, especially
flexible molds. Expansion about two times greater than Hydrocal A-11. Self-leveling when poured and not suitable for hollow cast
applications

http://www.sheffield-pottery.com/US-Gypsum-Plaster-Information-s/38.htm  
DRYSTONE – Fast setting high strength product that needs no drying. An environmentally sound alternative to resin-based products. No hazardous chemicals or waste, no styrene emissions and no required environmental controls.
HYDRO-STONE – One of the hardest and strongest of all gypsum cements. When mixed properly, has a heavy, syrupy consistency ideal for pouring solid models or patterns. Recommended for stretch-press dies where extreme surface hardness is required. Slightly higher setting and expansion than ULTRACAL 30. Used for high quality art novelty and statuary castings.

http://en.wikipedia.org/wiki/Plaster_mold_casting
http://chestofbooks.com/reference/Henley-s-20th-Century-Formulas-Recipes-Processes-Vol1/Casting-Plaster-Molds.html 
plaster is used for metal casting but requires drying for several days

 http://www.artlex.com/ArtLex/G.html
gesso – Plaster or a fine plaster-like material made of gypsum, which is also called whiting, used for sculptures. An especially versatile medium in reliefs, gesso can be either a material cast in a mold or a material of a mold, a material to be modeled, or carved, or attached to something else. When used for molds into which molten metal is poured, it must be hardened with sand as a grog. Gesso may also refer to such a gypsum material mixed with an animal-hide glue and used as a ground for painting. For this latter use, it isWEAR A DUST MASK! usually applied to the surface of a wood panel or sculpture to become the surface on which an artist paints. It was used by Gothic and Renaissance panel painters, and is still used today. Oxgall (or another wetting agent) can be employed MEDICAL ALERT!to eliminate pin-holes in gesso surfaces by mixing it into the gesso before the gesso is applied. Like all other dusts, airborne gesso is hazardous to breathe — every user should wear an appropriate dust mask. Also see slip and stucco. 

therefore gesso is probably food safe.  so if I coat my pink foam model (which can cause sensitivity with prolonged exposure — cue architecture student horror stories) with gesso and then cast it with food-safe silicon, should be good.

overview of molding techniques
http://miniatures.about.com/od/techniques/tp/moldputtylist.htm

discussion of 3d-printing plaster molds
http://forums.reprap.org/read.php?171,37834,3783