comprare viagra pastilla cialis trouble erection cialis kopen sildenafil venta viagra fur frauen kamagra pharmacie viagra europe cialis venta cialis meilleur prix zithromax generique achat cialis en ligne cialis moins cher viagra kosten acheter isotretinoine generische viagra dysfonction erectile acheter cialis 20mg ordina levitra levitra france sildenafil generico generique du viagra commander du viagra sildenafil sin receta acheter viagra pas chere procurer du cialis sildenafil 50 mg achat de levitra vente levitra viagra svizzera acquisto viagra generico cialis livraison rapide viagra versand levitra te koop vente kamagra levitra en pharmacie viagra controindicazioni levitra a vendre cialis belgique sildenafil rezeptfrei comprar viagra em portugal aquisto levitra comprar vardenafil cialis generico viagra effet secondaire vendo cialis prezzi cialis achat cialis 20mg kamagra rezeptfrei acheter cialis pas chere kamagra gel levitra sin receta farmaci impotenza viagra moins cher acheter viagra kamagra kopen remede impuissance cialis bon prix cialis sans ordonnance tadalafil bestellen viagra generique comprar viagra cialis suisse prozac prix cialis generique acheter levitra naturale cialis generico 10 mg acheter propecia clomid sans ordonnance acquisto viagra net levitra 20 mg acquisto viagra vardenafil generique sildenafil kaufen cialis generico sicuro commande levitra viagra generico vendo levitra levitra 20 mg disfunzione erettile rimedi cialis france levitra svizzera sildenafil receta achete cialis viagra prezzo comprar levitra generica cialis preço levitra venta libre cialis ohne rezept aquisto cialis vardenafil bestellen pilule levitra impotenza cure achat viagra en ligne generique du cialis viagra vendita libera kamagra en france acquisto cialis generico cura impotenza compro viagra cialis generique en france vente cialis viagra donna propecia sans ordonnance levitra sans prescription acheter cialis sur internet impotenza rimedi levitra donna cialis prijs achat de viagra viagra dosaggio viagra kopen kamagra generique compro sildenafil tadalafil generique acheter cialis internet levitra donne viagra 100 mg acheter cialis moins cher levitra generico medicament viagra acheter kamagra acheter zyban cialis generique cialis venta libre vente de cialis sur internet levitra ohne rezept acheter cialis en espagne vardenafil generico cialis ricetta medica viagra 100 mg vendita levitra

Archive for the ‘Optical’ Category

Getting Started with Pachube & Arduino

Thursday, June 25th, 2009

Another post on Pachube and how easy it is to get setup and going. This post will cover the basic steps on how to get some sensors online!  I will be using my project of two light sensors as an example.  The status of my light sensors are viewable at http://www.pachube.com/feeds/2145

Pachube + Arduino from Morgellon on Vimeo.

STEP ONE: GET A PACHUBE ACCOUNT!

Head over to the Pachube website and see various sensors from all over the world and view their status.  Be sure to view the ABOUT page, this describes INPUTs and OUTPUTs, along with ways to interface with Pachube and your sensors.  The QUICKSTART page has the details to get started and how to use your API.  Pachube is still in beta, so you’ll need to get an invite code… but no worries, Pachube has an email address on the QUICKSTART page.  Just send them and email asking for an invite and what you would like to do.  If they let me in… they will let anyone in! ;)

STEP TWO: PREPARE ARDUINO!

The Arduino can be interfaced with Pachube two ways: 1. With an Ethernet shield OR 2. Via USB connected to a PC running Processing… which is the way used in this tutorial… as I feel it is an easy and inexpensive way.  You can learn more about each way at the Pachube Arduino page.

To prep the Arduino, you need to connect the sensors you will be using and verify that they are working correctly! Once the sensors are good, then upload the “Standard Firmata” to the Arduino.  Now the Arduino is prepped for Pachube!  Leave the Arduino connected to the PC.

STEP THREE: PREPARE PROCESSING!

To have Processing communicate easily with Pachube, you will need to add a few libraries.  They are the Pachuino, Arduino and EEML libraries, they are available and there is more info at the PACHUINO page.  Download, unzip and move them to the libraries folder, in your sketchbook folder.  Now Processing is ready!

STEP FOUR: PREPARE INPUT FEED!

Once you have a Pachube account and your API key, go ahead and set up a new feed for your sensors.  Since I have light sensors, I started a new INPUT FEED.  I chose to make my feed “manual” (as this is easier for me) which means Pachube gets updates only when I send them.  Instead of Pachube connecting directly to my PC to pull the info.

STEP FIVE: PREPARE CODE FOR PROCESSING!

Once you have the libraries in the folder, you are ready to start Processing and start coding.  Below is the code I used for my light sensor.  This was taken from the sample code and stripped to make it more simple. I added a LED on pin 11 to light up (to let me know when my Arduino was running) and a delay(1500).

Be sure to add you API Key, and the URL of your INPUT FEED!

import processing.serial.*;
import cc.arduino.*;
import eeml.*;
import pachuino.*;

Pachuino p;
Arduino arduino;
int ledPin = 11;

void setup(){
p = new Pachuino(this, Arduino.list()[0], 115200);
p.manualUpdate(”http://www.pachube.com/api/2145.xml”); // change URL — this is the feed you want to update
p.setKey(”—YOUR API KEY HERE—”);

// local sensors
p.addLocalSensor(”analog”, 0,”Light Sensor Inside”);
p.addLocalSensor(”analog”, 1,”Light Sensor Outside”);
}

void draw(){
//p.debug();
p.digitalWrite(ledPin, Arduino.HIGH);
delay(1500);
}

// you don’t need to change any of these

void onReceiveEEML(DataIn d){
p.updateRemoteSensors(d);
}

STEP SIX: LAUNCH CODE AND COLLECT DATA!

Make sure that:

  • Sensors are *working* and connected to Arduino
  • Arduino is running “Standard Firmata” and connected to computer
  • Processing is collecting sensor data from Arduino
  • Computer has Internet connection

Now run your program and begin collecting data and sharing it on the web!!  Check your feed to make sure you data is being transmitted.  Have fun and happy tinkering!

–Morgellon OUT!

Arduino + Pachube = Web Connected Sensors!

Wednesday, June 24th, 2009

Quick update before I zonk out…  Yesterday I setup an account for Pachube and spent all night getting familiar with how it works. Pachube describes itself as a service that enables you to connect, tag and share real time sensor data from objects, devices, buildings and environments around the world. The key aim is to facilitate interaction between remote environments, both physical and virtual.

It also works with Arduino and Processing… hrmmmmm…..

As a “test” project, I set up two light sensors in my room.  One is mounted on the wall, the other is taped to the window facing outside.  The idea is to compare inside light levels to outside light levels and adjust for energy consumption.  If the light level outside is equal or greater than inside, then perhaps I should open the blinds to let in more light… or maybe even go outside… *gasp*
The two light sensors are connected to an Arduino running the Standard Firmata.  The Arduino is connected to a PC running a Processing sketch that sends the sensor data to Pachube.  Nice and easy!  I’ll post more details, code and a basic tutorial later… after I’ve slept… that way it *might* make sense.
Until then, here are some pictures and graphs. (yay graphs!) The two graphs are generated by Pachube and are fairly easy to customize.  The higher the number, the less light is present.  So, hopefully the Inside Light Sensor will stay a nice high number as I sleep… while the Outside Light Sensor should lower over the course of the day.

The graphs will continue to update as they receive more data from the sensors.  It will be interesting to watch and compare the differences in the two graphs.  More to come soon!

–Morgellon OUT!!


Slotted Optical Sensors

Wednesday, September 3rd, 2008

After watching Citizen Engineer, I wanted to play with a slotted optical sensor, well that and a payphone, a sim card reader, a little vice and other cool electronics things. So I ordered a few from All Electronics.

As usual, I had no idea how these things work, so I started plugging in wires and using a standard analog input sketch. That did not work at all, after I heard something pop I knew I was not on the right track. Then I started looking for some help. I still have not found a datasheet, but I found a graphic that made things work for me. My exact model is the OPB3902.

Optical Sensor Schematic

There are four pins on the bottom of these things, two to work the emitter (E) (pins 1 and 3) and two for the detector (D) (pins 2 and 4). Two resistors are needed, a 330 Ohm (orange orange red) and 2.2 K (red red orange).

I mounted the Optical Sensor on a proto board, having carefully cut off the plastic bump on the bottom of the sensor. I also used a led with a 1K (brown black red) for signaling when something was activating the switch. According to the drawing 5 volts would work, so that’s what I used, along with analog pin 2 for input and digital pin 12 for the signaling led.

After running my sketch and dumping the sensor reading to serial I found that it idled at ~929 and when the sensor was activated it was ~1020.  This is great, no problem to see a change of state, so I wrote a bit more code to activate the led.  I did not include a delay as I wanted the led to react quickly.

Here is my code, feel free to do with it as you will!

/*
Demo for a slotted optical sensor.

I am sure that someone elses code is in here somewhere
*/

int inputPin = 2;    // select the input pin for the potentiometer
int ledPin = 12;   // select the pin for the LED
int val = 0;       // variable to store the value coming from the sensor

void setup() {
  pinMode(inputPin, OUTPUT);  // declare the ledPin as an OUTPUT
  pinMode(ledPin, OUTPUT);
  Serial.begin(9600);
}

void loop() {

  val = analogRead(inputPin);    // read the value from the sensor
  Serial.println(val);

  if(val > 950){
    digitalWrite(ledPin, HIGH);  // turn the ledPin on
  } else {
    digitalWrite(ledPin, LOW);   // turn the ledPin off
  }
}

I am very excited to know how to set up this sensor.  Next time I am going to find some with the hook up wires already soldered and heatshrinked on.  For those that are curious, that is a Freeduino from NKC under there.

  • Cool Arduino Parts

  • You are currently browsing the archives for the Optical category.



  • Viagra ordre
  • Cialis en ligne
  • Levitra en ligne
  • Propecia acheter
  • Viagra acheter
  • Acheter cialis
  • Ordre levitra
  • Ordre propecia
  • En ligne viagra
  • Vente cialis
  • Levitra bon marche
  • Propecia en ligne
  • Viagra online
  • Buy cialis
  • Order Levitra
  • Buy propecia
  • Buy viagra
  • Cheap cialis
  • Cheap Levitra
  • propecia online
  • Viagra prescription
  • Cialis online
  • Buy Levitra
  • Order propecia