Monday, May 1, 2017

NBC Discussion/Presentation




Chapters 0-2 were our group's assigned chapters, and we went over the discussion in class. Our notes are shared via Google Docs. I don't have any posts from the other chapters, as we never presented and discussed these in class. 

Wednesday, April 19, 2017

Final proj progressss



So I bought another RFID that has an internal antenna and had it express shipped (painfully expensive). Eugene is also using an RFID so he shared some of his findings with me and we've been adding things back and forth to help a brotha out with this RFID biz. It is super complicated and not as easy as I thought it was going to be. 










Arduino project




Ordered Parts

RFID Reader ID-20LA (125 kHz)

SEN-11828

LED RGB Strip - Addressable, Sealed (1m)

COM-12027

RFID Tag - Laundry MIFARE Classic® 1K (13.56 MHz)

SEN-10131

RFID Tag - ABS Token MIFARE Classic® 1K (13.56 MHz)

SEN-10127

--------------------------------------------------------------------------------------------------------------------------------

Resource Links

ID Datasheet

RFID reading with Arduino instructable ~ MrkTrussell

Code for the Innovations ID RFId tag reader

LED Addressable Datasheet
LED arduino code

Fastled



notes
Blutooth sensor
RFID
Led strip 120mcd

Mpja.com
Electronix express
Alltronics

Adafruit.com

Sparkfun electronics

Mouser.com
Jammeco.com  v  
newark.com/element14














Rfid code
55 70 48 48 49 66 50 57 65 57 69 52 13

http://forum.arduino.cc/index.php?topic=177602.0

[SOT] FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF 37 46 30 30 31 42 32 39 41 39 45 34 D A [EOT]

Tag ID: 7F001B29A9
Checksum: E4



/////
/*
* RFID Loop
* by Alexander Reeder, Nov 16, 2007
* Modified by Brian Riley  January 2008
*/
#define RESETLEDPin  13
#define RESETPIN     2

char val = 0;


void setup() {
   Serial.begin(9600); // connect to the serial port
   pinMode(RESETPIN, OUTPUT);    // sets the digital pin as output
   pinMode(RESETLEDPin, OUTPUT);    // sets the digital pin as output

}

void loop () {

   char IDstring[13];
   int  i;
   digitalWrite(RESETLEDPin, LOW);  // Shut off LED
   digitalWrite(RESETPIN, HIGH);    // pull up Reset line   


   if (Serial.available() > 0 ) {
     if ( (val = Serial.read()) == 02 ) {    // look for Start Of Text marker
       Serial.print("[SOT] ");
                                             // reda until you get End Of Text
       for ( i = 0; (val = Serial.read()) != 03 ; i++) {
         Serial.print(val, HEX);
         Serial.print(" ");
         IDstring[i] = val;
       }
       Serial.println("[EOT]");
       Serial.println();
       Serial.print("  IDString[");
       IDstring[10] = 0x00;        // tie off IDstring at the CR-LF
       Serial.print(IDstring);
       Serial.println("] ");
       Serial.println();
       resetID12();                // reset after a valid read
     }
   }
}

void resetID12()
{
       digitalWrite(RESETLEDPin, HIGH);   // show reset by lighting LED
       digitalWrite(RESETPIN, LOW);       // pull reset down
       delay(100);    
 
}

////



int readCard[13];  //For holding the ID we receive
int val = 0;
int rfid_1[12] = {  37,46,30,30,31,42,32,39,41,39,45,34};

void setup()
{
 Serial.begin(9600);

 delay(500);
 while(Serial.available()>0)
 {
   Serial.read();
 }
 Serial.println();
 Serial.println("RFID module started in Auto Read Mode, Waiting for Card...");
}

void loop()
{
 // read the serial port
 if(Serial.available() > 0) {
   val = Serial.read();
   if (val == 2)
   {  
     Serial.print(" Start the real read: ");
     Serial.println(val);
     val = Serial.read();
     int count = 0;
     while(count < 13)
     {
       readCard[count] = val;
       Serial.print(" Reading: ");
       Serial.print(val);
       Serial.print(", saved: ");
       Serial.println(readCard[count]);
       val = Serial.read();
       count++;
     }
     Serial.println(" Done reading ");
     int count2 = 0;
     while(count2 < 13)
     {
       Serial.print(readCard[count2]);
       Serial.print(" ");
       count2++;
     }
     Serial.println();
   }
 }

  delay(500);
  Serial.println("Waiting");
}



///////


#include <FastLED.h>

#define LED_PIN     5
#define COLOR_ORDER GRB
#define CHIPSET     WS2811
#define NUM_LEDS    60

#define BRIGHTNESS  200
#define FRAMES_PER_SECOND 120

bool gReverseDirection = false;

CRGB leds[NUM_LEDS];

void setup() {
 delay(30); // sanity delay
 FastLED.addLeds<CHIPSET, LED_PIN, COLOR_ORDER>(leds, NUM_LEDS).setCorrection( TypicalLEDStrip );
 FastLED.setBrightness( BRIGHTNESS );
}

void loop()
{
 // Add entropy to random number generator; we use a lot of it.
 // random16_add_entropy( random());

 Fire2012(); // run simulation frame

 FastLED.show(); // display this frame
 FastLED.delay(600 / FRAMES_PER_SECOND);
}


// Fire2012 by Mark Kriegsman, July 2012
// as part of "Five Elements" shown here: http://youtu.be/knWiGsmgycY
////
// This basic one-dimensional 'fire' simulation works roughly as follows:
// There's a underlying array of 'heat' cells, that model the temperature
// at each point along the line.  Every cycle through the simulation,
// four steps are performed:
//  1) All cells cool down a little bit, losing heat to the air
//  2) The heat from each cell drifts 'up' and diffuses a little
//  3) Sometimes randomly new 'sparks' of heat are added at the bottom
//  4) The heat from each cell is rendered as a color into the leds array
//     The heat-to-color mapping uses a black-body radiation approximation.
//
// Temperature is in arbitrary units from 0 (cold black) to 255 (white hot).
//
// This simulation scales it self a bit depending on NUM_LEDS; it should look
// "OK" on anywhere from 20 to 100 LEDs without too much tweaking.
//
// I recommend running this simulation at anywhere from 30-100 frames per second,
// meaning an interframe delay of about 10-35 milliseconds.
//
// Looks best on a high-density LED setup (60+ pixels/meter).
//
//
// There are two main parameters you can play with to control the look and
// feel of your fire: COOLING (used in step 1 above), and SPARKING (used
// in step 3 above).
//
// COOLING: How much does the air cool as it rises?
// Less cooling = taller flames.  More cooling = shorter flames.
// Default 50, suggested range 20-100
#define COOLING  20

// SPARKING: What chance (out of 255) is there that a new spark will be lit?
// Higher chance = more roaring fire.  Lower chance = more flickery fire.
// Default 120, suggested range 50-200.
#define SPARKING 10


void Fire2012()
{
 // Array of temperature readings at each simulation cell
 static byte heat[NUM_LEDS];

 // Step 1.  Cool down every cell a little
 for ( int i = 0; i < NUM_LEDS; i++) {
   heat[i] = qsub8( heat[i],  random8(0, ((COOLING * 10) / NUM_LEDS) + 2));
 }

 // Step 2.  Heat from each cell drifts 'up' and diffuses a little
 for ( int k = NUM_LEDS - 1; k >= 2; k--) {
   heat[k] = (heat[k - 1] + heat[k - 2] + heat[k - 2] ) / 3;
 }

 // Step 3.  Randomly ignite new 'sparks' of heat near the bottom
 if ( random8() < SPARKING ) {
   int y = random8(7);
   heat[y] = qadd8( heat[y], random8(160, 255) );
 }

 // Step 4.  Map from heat cells to LED colors
 for ( int j = 0; j < NUM_LEDS; j++) {
   CRGB color = HeatColor( heat[j]);
   int pixelnumber;
   if ( gReverseDirection ) {
     pixelnumber = (NUM_LEDS - 1) - j;
   } else {
     pixelnumber = j;
   }
   leds[pixelnumber] = color;
 }
}

Wednesday, April 12, 2017

Final Arduino Progress





So the RFID I bought didn't have an internal antenna.... UGH!@@@ I was able to make the servo motors move based on the light from a photocell, but it's not as cool or dramatic as the RFID. I can make an antenna, but it is really bulky and looks way easier than it actually is. 

I did find some other codes/tutorials on how to make servo motors move with other sensors so WE SHALL SEEE!!!!!!! 



RFID Stuff





Photocell/Other Stuff







Monday, April 3, 2017

Arduino Workshop




Using the Arduino with a photo sensor, LED, and resistor. 





We assigned values for the photosensor and the LED up top before the 'void setup'

int photoPin = 0;
int ledPin = 13;


Under 'voided setup' put in the functions, Serial.begin for photosensor and pinMode for LED

Serial.begin(9600);

pinMode(ledPin, OUTPUT);



Made it set up a function to read and collect data from photosensor 

int value = analogRead(photoPin);

  Serial.println(analogRead(value));



Put 'if' statement in for LED. If the value of the readings from the photosensor are a certain number, then the LED will do something. 

- IF: the value of the photo reading is less than 700, the led will turn on (HIGH) 
- ELSE: if below the set value 700, it will turn off, (LOW)
- Delay: added to create some time in between the functions. 

  if (value <=700){
    digitalWrite(ledPin, HIGH);
}
else{
  digitalWrite(ledPin, LOW);
  
}

delay(25);

}