View allAll Photos Tagged arduino

I made this housing for an Arduino Pro that will control my waveguide relay in my 47 GHz radio. This housing is made from 6061 billet aluminum. The cover is held on with a dozen 0-80 screws. There i a cutout for the programming connection and a filtered DC feedthrough. Later I will add other connectors for the servo and transmit/receive switch, etc.

Monitoring heating milk during yogurt making with Arduino microcontroller, LCD, buzzer and thermocouple. More information on this project on my blog, Mental Masala.

Developing an Arduino application for a series of revolving storefront window displays. Each display holds a laptop which is plugged in, so the motor must be reversed once every revolution to avoid twisting the laptop's power cord.

 

The display's rotating axle will have a reflective tab that crosses over the sensor (a phototransistor) shown above. Arduino's analog I/O pin detects a change in voltage from the sensor-- a value that can be adjusted in the script, to make the sensor more or less sensitive. It then makes one of two digital output pins high, which triggers the respective coil in the relay. The relay then reverses the polarity to the motor, reversing it until the tab comes back around and the process starts again.

 

In this image I have LEDs simulating the reversal, in the real thing a motor will be hooked up instead.

 

See a video of this guy in action: www.youtube.com/watch?v=mpuy9b2Fk4k

This lovely little shield is the best way to add a small, colorful and bright display to any project. We took our popular 1.8" TFT breakout board and remixed it into an Arduino shield complete with microSD card slot and a 5-way joystick navigation switch (with a nice plastic knob)! Since the display uses only 4 pins to communicate and has its own pixel-addressable frame buffer, it can be used easily to add a display & interface without exhausting the memory or pins.

    

The 1.8" display has 128x160 color pixels. Unlike the low cost "Nokia 6110" and similar LCD displays, which are CSTN type and thus have poor color and slow refresh, this display is a true TFT! The TFT driver (ST7735R) can display full 18-bit color (262,144 shades!). And the LCD will always come with the same driver chip so there's no worries that your code will not work from one to the other.

    

The shield has the TFT display soldered on (it uses a delicate flex-circuit connector) as well as a ultra-low-dropout 3.3V regulator and a 3/5V level shifter so its safe to use with 5V Arduinos. We also had some space left over so we placed a microSD card holder (so you can easily load full color bitmaps from a FAT16/FAT32 formatted microSD card) and a 5-way navigation switch (left, right, up, down, select).

This is an Arduino-based Motion Detector I created. Upon pressing the button, it will arm 10 seconds later. Then beep and blink the LEDs when motion is detected. It can be disarmed by pressing the same button. The code is as follows:

 

/*****

* By Pete Lamonica

* Released under a Creative Commons Non-Commerical/Attribution/Share-Alike

* license

* creativecommons.org/licenses/by-nc-sa/2.0/

****/

#define MOTION_PIN 0

#define SPEAKER_PIN 9

#define RED_LED_PIN 2

#define GREEN_LED_PIN 3

#define ARM_PIN 4

 

#define SECONDS_TO_ARM 10

 

//defines what "motion" is. There's a pull-up resistor on the

// motion sensor, so "high" is motion, while "low" is no motion.

// I allowed some fuzziness on the "motion"

#define MOTION (analogRead(MOTION_PIN)=1000)

 

//Plays a tone of a given pitch

void playTone(int tone, int duration) {

for (long i = 0; i < duration * 1000L; i += tone * 2) {

digitalWrite(SPEAKER_PIN, HIGH);

delayMicroseconds(tone);

digitalWrite(SPEAKER_PIN, LOW);

delayMicroseconds(tone);

}

}

 

//will beep for about 3 seconds and check for disarm in the meantime.

//Could arrange a hardware interrupt to do the same thing

void alarm() {

for(int i=0; i<3; i++) {

if(checkForDisarm()) return;

digitalWrite(RED_LED_PIN, HIGH);

playTone(1432, 300); //F

digitalWrite(RED_LED_PIN, LOW);

digitalWrite(GREEN_LED_PIN, HIGH);

if(checkForDisarm()) return;

playTone(1915, 300); //C

if(checkForDisarm()) return;

digitalWrite(GREEN_LED_PIN, LOW);

delay(400);

if(checkForDisarm()) return;

}

}

 

boolean armed = false; //armed status

 

//arm the device.

void arm() {

armed = true;

 

for(int i=0; i<SECONDS_TO_ARM/2; i++) {

digitalWrite(RED_LED_PIN, LOW);

delay(1000);

if(checkForDisarm()) return;

digitalWrite(RED_LED_PIN, HIGH);

delay(1000);

if(checkForDisarm()) return;

}

}

 

//Check if the system should be disarmed and do so if that's the case.

boolean checkForDisarm() {

if(digitalRead(ARM_PIN) == HIGH && armed) {

armed = false;

digitalWrite(GREEN_LED_PIN, LOW);

digitalWrite(RED_LED_PIN, HIGH);

delay(1000);

return true;

}

return false;

}

 

void setup() {

pinMode(SPEAKER_PIN, OUTPUT);

pinMode(RED_LED_PIN, OUTPUT);

pinMode(GREEN_LED_PIN, OUTPUT);

 

pinMode(ARM_PIN, INPUT);

 

digitalWrite(RED_LED_PIN, LOW);

digitalWrite(GREEN_LED_PIN, LOW);

}

 

int detected = 0;

 

void loop() {

if(MOTION && armed) { //If there's motion and it's armed, sound the alarm

alarm();

delay(1000);

} else if(armed) { //if it's armed, but there's no motion, show a green LED

digitalWrite(RED_LED_PIN, LOW);

digitalWrite(GREEN_LED_PIN, HIGH);

} else { //if it's not armed, show a red LED

digitalWrite(GREEN_LED_PIN, LOW);

digitalWrite(RED_LED_PIN, HIGH);

}

 

//check to see if the "ARM" button has been pressed

if(digitalRead(ARM_PIN) == HIGH && !armed) {

arm();

}

 

//check for a disarm

checkForDisarm();

}

Arduino. Model: Mega 2560

THOR's small machinist ball peen hammer and $9 ARDUINO Compatible STARTER KIT - Anyone can learn Electronics

 

This is an old hammer I think from my Grandfather who I never meet but I've had this hammer as long as I can remember. It has a short handle.

Powered by Arduino!

Arduino art show curated by Alicia Gibb, March 27 2010 @ NYC Resistor

A DIY audio electronics development platform. Very easy to plug things in and out of the breadboards and Arduino (duemilanove). Seeed Studio oscilloscope has proven to be a worthy tool. Now cooking: an arduino synthesizer, based on some simple waveform tables, homemade 8-bit DAC and bitwise modulation. Basically same as this but now much neater. Audio and video demos coming up, soon maybe... Here's an old demo, this one sounds roughly the same.

Arduino hitting the yahoo RSS server and displaying result on Sparkfun LCD (driven by Serial Backpack). Note the 404 page, evidentally I don't have my URL quite right.

Arduino art show curated by Alicia Gibb, March 27 2010 @ NYC Resistor

The first experiment on Arduino: a blinking light.

Lilypad mp3 --> Korg kp2

Thingamagoop RGB

All into iRig mixer

4x4x4 LED Cube shield for Arduino

Each student in my Spooky Arduino class was awarded one of these badges by Mark from Machine Project.

My first Arduino project, the AreGeeBee color mixer.

 

Read more about it here:

www.itsptk.com/2011/03/11/arduino-aregeebee-color-mixer/

My take on the arduino based PC ambient lighting project posted here: siliconrepublic.blogspot.com/2011/02/arduino-based-pc-amb...

  

I used the same embedded arduino code and wiring setup to get it working, but main difference is that I used Python code instead of Processing for the desktop client, and I used an arduino proto shield to make a compact package that I could hide on my desk. I'm still tweaking the code so that it can work with fullscreen applications like games and average all 3 monitors instead of the center, but as it is now it works really well.

 

WIP python code: dl.dropbox.com/u/9993009/AmbiLight.py

I know everyone has done this before. RFID and arduino that is. But looking at the example code it looks like the antenna is always in receive mode. I am not sure how this affects the life of the chip / reader but I thought of adding a way to detect human presence before activating the receiver.

 

I found some little IR heat detector (here: www.allelectronics.com/make-a-store/item/IRD-10/INFRARED-... and tossed together some analog read code and viola. Now when the IR detector detects over a certain variable heat temp it activates the RFID reader.

 

I will post the code and write up on my blog.

blog.synthetos.com

Arduino + Processing Workshop

Side view of my Arduino Synthesizer Module prototype. About 90% done at this point.

 

This is my first module where a sizable part of the design is my own, vs. building a kit or someone else's PCB.

Monitoring Japanese stock (dashi) with Arduino Uno R3 and thermocouple. Kitchen folklore says that boiling the dashi ingredients leads to bitterness, so the sensor and electronics alert me when the dashi temperature reaches 180 F. More information on this project on my blog, Mental Masala. (Dashi recipe at the bottom of this blog post at Mental Masala.)

Looking to build an Internet connected device? The Arduino Ethernet is the ticket, with an Arduino UNO paired with an ethernet port it's the perfect piece of hardware to experiment with the Internet of Things. Or if you've developed something using an Arduino and an Ethernet shield it can be ported to this board with no code changes (uses the same WizNet W5100 controller).

 

Available from oomlout:

www.oomlout.co.uk/arduino-ethernet-board-p-259.html

  

Connecting an Arduino and Raspberry Pi to create a webpage with temperature and humidity measurements.

 

UPDATE: You can still find the Arduino Library here: arms22.googlecode.com/files/CameraC328R.zip

 

// C328R_with_I2C_flash_LCD

// by s_p_e_x, some rights reserved

//

// Based on work by Sean Voisen

 

// (http://gizmologi.st/2009/04/taking-pictures-with-arduino/)

// and Ryan Detzel

// (http://10kohms.com/arduino-external-eeprom-24lc256)

//

// I converted Seans code to use I2C EEPROM instead of SPI

// Flash. Also I wrote A base64 encoder in an attempt to dodge

// problems with escape codes messing up terminal programs. I'm

 

// still having issues. But it does work and opens the door to

// a direct interface via Ethernet and a web browser.

 

// Oh, and I added LCD support to have some clue about what is

// going on. Without having access to the serial interface I

// was really puzzled by why it wasn't working.

 

// After struggling with getting a proper 3.3V source

// (I finally switched to a "real" Arduino with a built in

 

// 3.3 regulator) and with iffy contacts on the camera cable

// I was totally thrown by the long delay to write the image to

// the I2C flash. Having an LCD took much of the guess work out.

//

// My I2C EEPROM is a 24LC256, and I use the highest two bytes

// to hold the picture size so when you reset it knows how much

// to read back.

 

// Unforunately the I2C EEPROM is SLOW, so if you can't monitor

 

// the progress via an LCD, be very patient waiting for the

// lights to blink and tell you setup() is over. ~5 minutes

 

// Here's a Function Map which helped me figure out the example:

 

//setup(){

//  if A0 is HIGH

  //  camera.sync()

  //  camera.initial()

 

  //  camera.setPackageSize()

  //  camera.setLightFrequency()

  //  camera.snapshot()

  //  camera.getJPEGPicture()

  //    fillPageBuffer()

  //      writeBuffer() -- for loop

 

  //        writeEEPROM() -- write bytes to EEPROM

  //    getJPEGPicture_callback()

  //    camera.poweroff()

// if A0 is LOW

  //    transferPicture() -- print bytes from EEPROM

  //      bintoascii() -- base64 encoder not perfect but works

 

  //      readEEPROM() -- for loop read bytes from EEPROM

//}

//loop(){

//  blink LED

//}

 

// wire A0 HIGH or LOW to take a picture or to extract a picture

 

// HIGH will guide the camera through init and a photograph and

 

// transferring to flash before exiting setup().

 

// LOW will read back the flash and send the data base64 encoded to

// the console. I added a header and footer to take advantage of the

// URI data scheme:

//   secure.wikimedia.org/wikipedia/en/wiki/Data_URI_scheme

 

// On my Mac I extracted the picture with screen:

  

//   screen /dev/tty.usbmodemfd551 38400

 

// This was on a Mac with an Arduino Uno. The device name may vary.

 

// Very quickly turn on the logging ^aH (control-A and then shift-H).

 

// Once the image is done dumping, exit screen completely: ^a^\

 

// rename the logfile to a .html file:

  

//    mv ~/screenlog.0 image.html

 

// You should now be able to view your image directly with FireFox.

 

#include "CameraC328R.h"

#include

#include

  

#define LED_PIN 13

#define PAGE_SIZE 64

#define BAUD 38400

 

#define eeprom1 0x50    //Address of 24LC256 eeprom chip

 

// Buffer for EEPROM data

 

byte pageBuffer[PAGE_SIZE];

 

CameraC328R camera;

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);  

 

 

static uint16_t pictureSizeCount = 0;

static uint16_t pageBufferIndex = 0;

static uint16_t currentAddress = 0;

 

bool dirtyBuffer = false;

 

int capture_mode_switch = A0; //HIGH => take picture; LOW => extract picture

int CaptureMode;

  

byte readEEPROM(int deviceaddress, unsigned int eeaddress ) {

  byte rdata = 0xFF;

 

  Wire.beginTransmission(deviceaddress);

  Wire.send((int)(eeaddress >> 8));   // MSB

 

  Wire.send((int)(eeaddress & 0xFF)); // LSB

  Wire.endTransmission();

 

  Wire.requestFrom(deviceaddress,1);

 

  if (Wire.available()) rdata = Wire.receive();

  

  return rdata;

}

 

void writeEEPROM(int deviceaddress, unsigned int eeaddress, byte data ) {

  Wire.beginTransmission(deviceaddress);

 

  Wire.send((int)(eeaddress >> 8));   // MSB

  Wire.send((int)(eeaddress & 0xFF)); // LSB

 

  Wire.send(data);

  Wire.endTransmission();

 

//yes you need this delay, and yes it makes flashing take 5 minutes or so

  delay(5);

}

 

 

/**

 

 * Writes the data in the buffer to the EEPROM at the page

 * starting at the given address.

 */

void writeBuffer( int deviceaddress, uint16_t address, uint16_t bufferSize )

{

 

  // Send the data

  for( uint16_t i = 0; i < bufferSize; i++ )

  {

    writeEEPROM(deviceaddress, address+i, pageBuffer[i]);

  }

 

 

  //digitalWrite( SS_PIN, HIGH );

}

 

/**

 * Fills the page buffer for the EEPROM with data.

 */

void fillPageBuffer( byte* data, uint16_t dataSize )

 

{

  for( uint16_t i = 0; i < dataSize; i++ )

  {

    pageBuffer[pageBufferIndex] = data[i];

    dirtyBuffer = true;

 

    pageBufferIndex++;

 

    if( pageBufferIndex == PAGE_SIZE && dirtyBuffer )

    {

      pageBufferIndex = 0;

      writeBuffer(eeprom1, currentAddress, PAGE_SIZE );

      currentAddress += PAGE_SIZE;

 

      dirtyBuffer = false;

      delay( 50 );

    }

  }

}

 

void bintoascii(char * outstring, byte byte0, byte byte1, byte byte2, uint16_t count)

 

{

  //outstring points to 4char string

  // byteX are the three possible input bytes

  // count marks the number of input bytes, this should

  //       always be 0 unless it is the last one or two input bytes

  

  byte temp1, temp2, temp0;

  char base64chars[]= "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";

 

 

  if (count == 0){

  temp0 = byte0;

  temp1 = byte1;

  temp2 = byte2;

  }

  if (count == 1){

 

  temp0 = byte2;

  temp1 = 0;

  temp2 = 0;

  }

   if (count == 2){

 

  temp0 = byte1;

  temp1 = byte2;

  temp2 = 0;

  }

 

  outstring[0]=base64chars[temp0 >> 2];

 

  //Serial.println(base64chars[temp0 >> 2], BYTE);

  outstring[1]=base64chars[((temp0 & 0x03) 4)];

 

  outstring[2]=base64chars[((temp1 & 0x0f) 6)];

  outstring[3]=base64chars[(temp2 & 0x3f)];

 

  

  // add padding

  if (count == 1){

    outstring[2]='=';

    outstring[3]='=';

 

  }

  if (count == 2){

    outstring[3]='=';

  }

  

}

  

 

/**

 * Sends a picture to the computer.

 */

void transferPicture( uint16_t startAddress, uint16_t size )

{

 

  char base64text[]="****";

  byte old, older, oldest;

  uint16_t endAddress = startAddress + size;

  uint16_t i;

 

  Serial.println("<img src=\"data:image/jpeg;base64,");    

  

  for( i = startAddress; i < endAddress; i++ )

  {

    oldest = older;

    older = old;

    old = readEEPROM( eeprom1, i );

//    Serial.print(i, DEC); Serial.print(": "); Serial.println(old, DEC);

  

    if ((i+1) % 3 == 0) { // every 3 bytes you print 4 characters

//      Serial.print(oldest, DEC); Serial.print(" "); Serial.print(older, DEC); Serial.print(" "); Serial.print(old, DEC); Serial.print(" ");

 

      bintoascii(base64text, oldest, older, old, 0);

      Serial.print(base64text);

    }  

    if((i+1) % 57 == 0) { // every 72 characters, you start a new line

 

      Serial.println("");

    }

  }

    //Serial.print( readEEPROM( eeprom1, i ), BYTE );

  

  if ((size % 3) != 0) { //if the image is not a multple of 3 bytes, encode the stragglers

 

    //Serial.print(oldest, DEC); Serial.print(" "); Serial.print(older, DEC); Serial.print(" "); Serial.print(old, DEC); Serial.print(" ");

    bintoascii(base64text, oldest, older, old, i%3);

    Serial.print(base64text);

  }

  

  Serial.println("\" />");

 

}

 

/**

 * This callback is called EVERY time a JPEG data packet is received.

 */

void getJPEGPicture_callback( uint16_t pictureSize, uint16_t packageSize, uint16_t packageCount, byte* package )

 

{

 

  // packageSize is the size of the picture part of the package

  pictureSizeCount += packageSize;

 

  // print progress

  lcd.setCursor(0, 1);

  //         0123456789012345

 

  lcd.print("                ");

  lcd.setCursor(0, 0);

  //         0123456789012345

  lcd.print("Camera -> EEPROM");

 

  lcd.setCursor(0, 1);

  lcd.print(pictureSizeCount, DEC);

  lcd.print("/");

  lcd.print(pictureSize, DEC);

 

 

  // package contains everything in the package

 

  fillPageBuffer( package, packageSize );

 

  if( pictureSizeCount == pictureSize )

  {

    // Is there still stuff in the buffer?

    if( dirtyBuffer )

    {

      writeBuffer(eeprom1, currentAddress, pageBufferIndex );

 

    }

    writeEEPROM(eeprom1, 65534, pictureSize & 0xff);

    writeEEPROM(eeprom1, 65535, pictureSize >> 8 & 0xff);

  

    camera.powerOff();

    lcd.setCursor(0, 0);

    //         0123456789012345

    lcd.print("Camera OFF.     ");

  

    digitalWrite( LED_PIN, HIGH ); // DONE!

//    Serial.flush();

//    delay( 5000 ); // Give us 5 seconds to hit a key ...

//

//    lcd.setCursor(0, 1);

//    //         0123456789012345

 

//    lcd.print("Send over Serial");

//    transferPicture( 0, pictureSize );

  }

}

//***********************************************************

//

//                         S E T U P

 

//

//***********************************************************

 

void setup()

{

  uint16_t storedpicturesize;

  Serial.begin( BAUD );

  Wire.begin();  

 

  pinMode( LED_PIN, OUTPUT );

 

  digitalWrite( LED_PIN, HIGH );

 

  lcd.begin(16, 2);

 

  if (analogRead(capture_mode_switch) > 511) {

 

    CaptureMode = 1;

  } else {

    CaptureMode = 0;

  }

 

  if(CaptureMode == 1) {

 

  

    if( !camera.sync() )

    {

      //Serial.println( "Sync failed." );

      lcd.setCursor(0, 0);

 

      lcd.print("Sync failed.");

      return;

    } else {

      lcd.setCursor(0, 0);

 

      lcd.print("Synced.");

    }

  

    digitalWrite( LED_PIN, LOW );

  

  

    if( !camera.initial( CameraC328R::CT_JPEG, CameraC328R::PR_160x120, CameraC328R::JR_640x480 ) )

    {

 

      //Serial.println( "Initial failed." );

      lcd.setCursor(0, 0);

      lcd.print("Initial failed.");

      return;

 

    } else {

      lcd.setCursor(0, 0);

      lcd.print("Inited.");

    }

  

 

    if( !camera.setPackageSize( 64 ) )

    {

      //Serial.println( "Package size failed." );

      lcd.setCursor(0, 0);

 

      lcd.print("Package size failed.");

     return;

    } else {

      lcd.setCursor(0, 0);

 

      lcd.print("Package sized.");

    }

  

    if( !camera.setLightFrequency( CameraC328R::FT_50Hz ) )

    {

      //Serial.println( "Light frequency failed." );

 

      lcd.setCursor(0, 0);

      lcd.print("Light frequency failed.");

      return;

    } else {

 

      lcd.setCursor(0, 0);

      lcd.print("Light frequenced.");

    }

  

    // Let camera settle, per manual

    delay(2000);

 

  

    digitalWrite( LED_PIN, HIGH );

  

    if( !camera.snapshot( CameraC328R::ST_COMPRESSED, 0 ) )

    {

      //Serial.println( "Snapshot failed." );

      lcd.setCursor(0, 0);

 

      lcd.print("Snapshot failed.");

     return;

    } else {

      lcd.setCursor(0, 0);

 

      lcd.print("Snapshotted.");

    }

  

    digitalWrite( LED_PIN, LOW);

  

    if( !camera.getJPEGPicture( CameraC328R::PT_JPEG, PROCESS_DELAY, &getJPEGPicture_callback ) )

    {

 

      //Serial.println( "Get JPEG failed." );

      lcd.setCursor(0, 0);

      lcd.print("Get JPEG failed.");

      return;

 

    } else {

      lcd.setCursor(0, 0);

      lcd.print("Got JPEG.");

    }

  } else {

 

    lcd.setCursor(0, 0);

    //         0123456789012345

    lcd.print("Send in 5 secs  ");

    

    Serial.flush();    

 

    delay( 5000 ); // Give us 5 seconds to hit a key ...

 

    lcd.setCursor(0, 0);

    //         0123456789012345

    lcd.print("Send over Serial");

 

    

    storedpicturesize = readEEPROM( eeprom1, 65535 );

    storedpicturesize = ((storedpicturesize*256) + readEEPROM( eeprom1, 65534 ) );

    //storedpicturesize = ((storedpicturesize << 8) | readEEPROM( eeprom1, 32766 ) );

    //storedpicturesize = ((storedpicturesize << 8) | readEEPROM( eeprom1, 32767 ) );

  

    lcd.setCursor(0, 1);

    //         0123456789012345

    lcd.print("send");

    lcd.print(storedpicturesize, DEC);

 

    lcd.print(" bytes");

  

    transferPicture( 0, storedpicturesize );

 

   lcd.setCursor(0, 0);

 

    //         0123456789012345

    lcd.print("send complete   ");

  }

}

 

void loop()

 

{

  digitalWrite( LED_PIN, HIGH ); // DONE!

  delay(100);

  digitalWrite( LED_PIN, LOW ); // DONE!

  delay(100);

}

 

// wow, flickr is not a good place to be sharing code

Two variations of the Arduino microcontroller being used in our classroom robotics workshop.

1 2 ••• 4 5 7 9 10 ••• 79 80