## Posts Tagged ‘arduino’

### Blrrrrblrblrblrblrbbbggggzzzggg….

Sunday, February 6th, 2011

Breakthrough on the solenoid valve from the previous post! Got it working, and made the code give it some extra rhythmic life, rather than just opening it and letting it all drain out. I think the problem was too much head after all, cause after I shortened the tube between the reservoir and the valve it drained exquisitely. Video.

Now, however, it took about 1 minute to drain 1 gallon, due to the extra life I gave it. At 192 gallons, that’s going to take way too long. I should have timed how long with just an open valve. If I want to keep this kind of life, I’ll need 16 valves to get it down to 6 minutes of drain time. The valve is 1/2″, so I can’t increase the tube size. There’s got to be a better solution to decreasing drain time than adding more valves, while still keeping some life in the rhythm of the solenoid. I might even make a wireless (Xbee) valve controller with some buttons to control which valves are doing what and when, and the syncopation.

### Calculations

Tuesday, January 25th, 2011

Working on the water aspects of the project. Helpful things to know when working with water, pressure and volume: ’head’ is the amount of vertical water space in a tube or container from the top of the column of water to the release point, valve or pump. There is 5′ of head in a 5′ tube of water, when vertical.

1 gallon = 8.43 lbs
1 cubic foot = 7.47 gallons
1 cubic foot (7.47g) = 62.38 lbs
1 foot of head = 0.433 psi (pounds per square inch, of water pressure in a vertical chamber)

To fill an 8′ x 6’5″ x 6′ volume with water:

8′ x 6’5″ = 51.36 sq/ft x 0.5 ft/depth = 25.68 cu/ft
25.68 cu/ft = 191.83 Gallons
25.68 cu/ft x 62.38 lbs = 1601 lbs

(oy vey)

The cistern at the top of the structure, where the water will sit until draining into the chamber, will have the volumetric measurements of 4′ x 4.2′ x 1.5′ (depth) = 25.68 cu/ft

The cistern will be visible to whoever ventures up the slope to the top, and the bottom will be transparent, like a glass bottomed boat, creating a threshold where the body builder and rats are visible, albeit through 1.5′ of water and 1/2″ thick polycarbonate. If I want the cistern to not be a box shape, I’ll take a few inches off the bottom extents and add them to the top.

Bottom: 3’9″ x 3’11″
Top: 4’3″ x 4’5″
Depth: still 1’6″

Since I’m using gravity, there is only head, vertical pressure. To drain the chamber, I’m using an electronic solenoid valve (EchoTech 1/2″ Gravity Feed Electric Solenoid Valve DDT-CD-12VDC, \$16 on ebay), or more than one of them. It didn’t work. Too much head– the valve doesn’t like more than 7 feet. Or because I was pumping the valve with 18A when it wants 500mA. The valve works continuously, or can be opened and closed repeatedly within 1 second. I can use that feature to slow down the flow of water. I’ll have to program it to respond to switches, or to analog values in.

Surprisingly difficult to find cheap parts to step down the 1/2″ bore to 3/8″ to 1/4″. The foam store on Canal was not the right place for this. Maybe Home Depot, or something. I like to support the little guy though!

The transistor circuit controlled by Arduino, powered by a liberated PC power supply. 5v for Arduino and 12v and for the valve. I’ll also use the 12v to power ventilation fans, and the Arduino will also control the transistors that allow AC current to flow to the incandescent light bulbs in the chamber.

More testing needed. And I have to mirror this system at the bottom of the chamber to drain the 6″ of water into a sub-chamber. The sub-chamber will be drained to the street using a submersible pump. Work ahead of me.

Some helpful sites to have open for speed, cause you can easily change one number and not the others:

Right triangle calculations

http://www.csgnetwork.com/righttricalc.html

Volume calculations

http://www.dep.state.pa.us/dep/deputate/waterops/redesign/calculators/volcalchtm.htm

### Mental Block– tha code

Wednesday, December 30th, 2009

Below is the code that was uploaded to each Arduino in each headset. Kudos to Eric for the noble task of commenting. It’s easier to read if you copy/paste into the Arduino IDE or another IDE like Eclipse.

ZIP!

MentalBlockCode

// MENTAL BLOCK
// Parses packets from a Neurosky chip to collect EEG-derrived
// “attention” and “medidation” values.
// Uses these values to set the position of a polarized disk mounted
// on a servo.

#include <SoftwareServo.h>
#include <NewSoftSerial.h>

// Give the headset an ID. Useful for debugging over serial.
int id = 1;

// Set up the polarizer disk servo.
// Using the SoftwareServo library because I suspected the
// built-in library was conflicting with the NewSoftSerial
// library.
SoftwareServo servo;
int currentPos = 45; // Start halfway between the 0 – 90 degrees we care about.
int targetPos = 45; // The target tells the servo where it should move towards.
int servoPin = 9;
unsigned long lastMovement = 0; // Track time so we can move the servo at regular intervals without delay().

// Set up the simulator for brainless testing.
unsigned long lastSimulatedPacket = 0;

// NeuroSky Parser and Serial Communication.
(more…)

### Mental Block– documentation

Tuesday, December 29th, 2009

(all this and more is available at http://mentalblock.net)

Mental Block system schematic

(Eric Mika has a ton of great documentation for this project on his blog, Frontier Nerds)

Eric came up with a great idea for how to make a variable detent potentiometer using a regular pot and a vibrating motor. When the pot is adjusted to a specific interval, the motor vibrates for a moment letting you know you’ve reached the first, second, third, etc, interval.

Here’s Sofy’s Pure Data patch that mirrors binaural beats– it was really too bad we couldn’t get the radios to work.

Here’s what we came up with, in action:

A fun video of that stuff getting cut out on the laser:

### From Brain Radio to Mental Block: A History

Tuesday, December 29th, 2009

(All this and more is available for perusal at http://mentalblock.net)

(This Flickr feed has the A-Z photo documentation for the process)

The project began with an interest in using EEG equipment to control media. There are two consumer level EEG hookups on the market, the MindFlex and the Star Wars Force Trainer. Both use chips from NeuroSky. The MindFlex only let us listen to LED states, whereas the Force Trainer gave us direct serial data. Wonderful. Here’s us playing with the Mindflex, and then hacking the Force Trainer.

### Serial Lab 2 (spongey!)

Monday, November 30th, 2009

The second serial lab. There is a lot to learn when it comes to serial communication between devices and applications. No doubt I will be working hard over the winter break to get serial communication into my blood, to have the handshake method down cold, to master punctuation and prevent binary from byting my ASCII. Sending data serially is a beautiful, complex beast. Most of what’s covered in the two serial labs was key in Beat Feet, the mid-term project that Eric, Yin and I built. We used Zigbees to send data from sensors on a pair of shoes and hat to the computer which played back sound files or MIDI library depending on which sensor was triggered. What we did with that project was more interesting and involved than what I ended up making for the second serial lab, which is basically what was outlined in the examples. The video at the bottom shows an accelerometer and an Arduino used to move a ball around on the screen in Processing. The button makes the ball appear or disappear. (more…)

### servo control

Monday, November 30th, 2009

Finally getting around to some of the labs I neglected.  The servo lab is certainly fun.  I wanted to mount two servos on a welding hat to make the visor go up and down based on some sensory input. Further down the line I might use this as a jaw mechanism for a mask, and have the data controlling the servos come from the jaw of the person wearing it. Classic animatronics. I’m using a light detecting resistor in this video.

I made this system using both the servo library and the “pulse method” outlined on this page. To get the servos to move in opposite directions, I reversed the values of one of the servos in the map() function.  For example, from the pulse method:

```pulse1 = map(analogValue,890,660,minPulse,maxPulse);
pulse2 = map(analogValue,660,890,minPulse,maxPulse);
```

I constrained the values to match the values received by the LDR. Next I will smooth the values so the servos aren’t jumping around as much.

### Shoe Music (aka BeatFeet)

Thursday, October 29th, 2009

Or maybe we should call it BetaFeta, but that would be cheesy. If we’re in a triumphant vegetative state, BeetFeat.

### Serial Lab #1 (crunchy!)

Wednesday, October 28th, 2009

I like working with serial from Arduino to Processing. It makes me a little giddy.

### Tone Library Lab

Wednesday, October 28th, 2009

I used an 8ohm speaker I took from some object, had to extend the leads, soldered them.