Author Archives: milgc503

Final Project Blog Post: Fortune Teller

Presentation: https://docs.google.com/presentation/d/1sUYrrKJgouIBgrMRpbiFp6CLde5otBWy1A05Q2PdyU4/edit?usp=sharing

Concept + Goals. What is your concept? What were your goals? Why did you decide on this project form for your concept and goal?

The Fortune Teller: Using an arduino, arduino printer, and a copper capacitive sensor I want to be able to give people a fortune based on the “random” amount of particles the sensor reads. Inspired by Mary Poppins measurement tape that collects the input of height and gives a corresponding description, “Perfect in everyway” and Zoltar, I want to design a fortune teller that reads its participants touch and subsequently gives them a corresponding fortune.

Intended audience. Who is this for? Why did you choose this audience?

Given that my idea of a fortune teller utilizes a non-invasive sensor my intended audience is anyone who is conveniently available and interested in getting a fortune.

Precedents. Share any precedents that inspired you.

Since one of the main components, if not the, of my project is to be able “sense” some aspect of my participant(s) I needed a sensor that could do just that in a relatively quantifiable way. I considered using a TMP36 Temperature Sensor so when a participant would get near/ touch the fortune teller depending on the temperature the fortune would change. Upon further deliberation, I believe most people range within the same body temperature so I wanted to use a component that could sense something with more range. Tubah (a tutor) recommended a capacitive sensor.

  • TMP36 Temperature Sensor: Based on the principle; as temperature increases, the voltage across a diode increases at a known rate. By amplifying the voltage change, a output proportional to temperature can be produced.

The capacitor is a component which has the ability or “capacity” to store energy in the form of an electrical charge producing a potential difference (Static Voltage) across its plates, much like a small rechargeable battery. Capacity is very sensitive and can be affected from a variety of environmental factors making it’s output very inconsistent.  Accordingly, using this aspect to my advantage when touched all individuals can produce a unique capacitance… therefore fortune.

 

Description of the project. Discuss the process of creating this project. How does it work? What is the desired interaction?

This project is simple in its composition. It utilizes a single sensor, capacitive,  and a single mode of output, a printer. I started the project with the physical components; the capacitive sensor and then the thermal printer. I found different tutorials for physical component that related to the outcome I needed. For example the capacitive code I used had a pre-set threshold of a 1000 and utilized an LED to show that the capacity was being read correctly. These details came in handy when it was no longer plugged into a monitor that could read the resistance since the LED would alert me to if the capacity was being read correctly. My next step after the physical setting up that was connecting the two through the code; have the printer respond to a capacitance that passes a threshold and have ranges equal different “fortunes.” I originally wanted to design two plaster hands that had metal wire running through them thus becoming the capacitor. With this idea, the participant would put their hands in the fortune teller’s hand, mimicking the interaction of a stereotypical gypsy fortune reading, and get their fortune. Though after the Parsons 2 building accident, which affected the wet lab, I used garden wire wrapped together as the hand instead. Ultimately, the project was successful. I made a capacitive sensor that was able to read capacity through a metal-wire-hand and subsequently read that input and print the corresponding fortune through code in the Arduino. 

 

Process + Prototypes. Discuss the process of creating this project. Show your prototypes, playtests, sketches, interaction diagrams, and any other files that illustrate the tools you used. What challenges did you faced?

  • Capacitor: I began assembling my project starting with the capacitor. While I waited for the thermal printer to arrive this component was pretty simple to construct. Using online sources for the code and the Arduino capacitive library, I successfully was able to read the capacity of myself using aluminum foil as the sensor.
    • As seen through the video featuring the serial monitor, when the capacity passes a certain threshold (1000) the LED will turn on. Alone the capacity of the aluminum foil and the environment have stayed under the threshold, nevertheless the capacity has been changing frequently from 60s-90s to 250s-290s.
    • Materials:
      • Resistor (100k ohm)
      • LED (Red)
      • Breadboard
      • Arduino + USB cord
      • 3x Jumper Wires
      • Metal: Aluminum foil
    • Code:

 

  • Thermal Printer: Once the thermal printer arrived I was able to get started. Getting the thermal printer functioning using the example code and downloading the printer library was a success. Using the set-up tutorial Thermal Printer Setup went smoothly as well. As seen in the video I got the example receipt to print and the capacitor to work individually.
    • As iterated in the video, the next step for me is to combine the two codes and get the arduino to read the capacitor’s input and in response print the output.
    • Materials:
      • A mini thermal receipt printer
      • thermal receipt paper
      • 5V 2A power supply
      • 2.1mm DC jack adapter
      • supply to the printer
      • 3x MM jumper wires
    • Code:

  • Code: As someone who doesn’t know how to code I went to the LC for help getting started. Off the bat, I had 3 major goals; 1)Get the printer and the capacitor onto the same code 2) Get the printer to print when the threshold is met 3) Print a fortune based on the different ranges of capacitance. Starting with step 1, I met with Tubah and by the end of the session we got the capacitor, arduino, and printer connected. However, the printer was unable to print the correct symbols (we were testing with the arduino test barcode). Matter of fact it was printing an infinite series of illegible symbols. With this I added new goals to my list; figure out why the 4) illegible symbols was printing 5) why the printer is continuously printing.
    The following session I met with Aarati and we found that the illegible symbols was due to baud-rate and or Arduino syntax between softwareserial/ mySerial.begin and Serial.begin. This was also connected to why the serial monitor wasn’t responding. Once we got the printer to respond to the capacitor we found that the printer will continuously print because capacity is read in milliseconds when touched. A solution to this was to add a timer for when the capacitance passes the threshold. We did this and got the connecting code working perfectly. The next step was to make ranges of capacitance with corresponding fortunes and with the help of Aarati that was easy. We even included a component that changed the fortune depending on whether the capacitance number read was odd or even.

  • Finishing Touches:
    The soldering, wire hand, chipboard silhouette, and the robe were simple add-ons that made the final product look more polish.
  • What would you do in a future iteration?
    Towards the end of my project my arduino code was nearing the maximum memory capacity ergo a future iteration might use a Raspberry Pi and may also have a cleaner and more artful design on the print.
  • Assembly:
    • Capacitor & LED:
    • Starting with the capacitor and LED find the highest resistor you can grab, (I used 150.5K) and put it on the Arduino ~4pin and ~8pin
    • Use the dedicated power cable and connect it positive side of the LED and plug the other into ~7pin
    • Use the dedicated ground cable and connected it to the ground end of the LED and plug the other into GND on the Arduino.
    • Place the LED in the breadboard connecting them with the GND and power wires. 
      • Optional; Include 220 ohm resistor in breadboard. I ended up using one when I soldered the board, but it’ll work without it. 
    • Printer: Using the Arduino Thermal Printer Pack
    • Plug in the GND (black) and VH (red) F wires into the printer
      • Cut off the open end of the Red and black wires to expose the metal inside.
      • Using the DC adaptor put in the exposed black and red end of the wires
      • Make sure they are oriented correctly
    • Plug in the GND (black), RX (yellow) and TX (Green) wires into the printer
    • Using the 3 MM jumper wires attach them to the open end of the GND, RX and TX cord.
    •  components_cableextend.jpg
      • Insert the TX (green) wire into the digital ~5 pin of the Arduino
      • Insert the RX (yellow) wire into the digital ~6 pin of the Arduino
      • Insert the GND (black) wire into the GND (any of them) of the Arduino
      • components_printer-wiring.jpg
      • Download the necessary Libraries:
      • Code:
      • Copy and Paste my Code: (Feel free to edit how you like)
      • Thermal Printer and Capacity Code Final
        • #include <CapacitiveSensor.h>

          CapacitiveSensor cs_4_8 = CapacitiveSensor(4, 8); // 1M resistor between pins 4 & 8, pin 8 is sensor pin, add a wire and or foil
          #include “Adafruit_Thermal.h”
          #include “adalogo.h”
          #include “adaqrcode.h”

          int LED = 8;
          int buttonpin = 3;
          //FIND A 10K resistor! Check if this is still relevant.

          #include “SoftwareSerial.h”
          #define TX_PIN 6 // Arduino transmit YELLOW WIRE labeled RX on printer
          #define RX_PIN 5 // Arduino receive GREEN WIRE labeled TX on printer

          SoftwareSerial mySerial(RX_PIN, TX_PIN); // Declare SoftwareSerial obj first
          Adafruit_Thermal printer(&mySerial); // Pass addr to printer constructor
          // Then see setup() function regarding serial & printer begin() calls.

          // Here’s the syntax for hardware serial (e.g. Arduino Due) ————–
          // Un-comment the following line if using hardware serial:

          //Adafruit_Thermal printer(&Serial1); // Or Serial2, Serial3, etc.

          // ———————————————————————–

          void setup() {
          cs_4_8.set_CS_AutocaL_Millis(0xFFFFFFFF);// turn off autocalibrate on channel 1 – just as an example
          pinMode(7, OUTPUT);
          // pinMode(7, OUTPUT); digitalWrite(7, LOW);
          // This line is for compatibility with the Adafruit IotP project pack,
          // which uses pin 7 as a spare grounding point. You only need this if
          // wired up the same way (w/3-pin header into pins 5/6/7):
          pinMode(5, OUTPUT); digitalWrite(5, LOW);
          pinMode (buttonpin, INPUT);
          // cs_4_8.set_CS_AutocaL_Millis(0xFFFFFFFF);// turn off autocalibrate on channel 1 – just as an example
          // Serial.begin(9600);
          // pinMode(7, OUTPUT);
          // NOTE: SOME PRINTERS NEED 9600 BAUD instead of 19200, check test page.
          pinMode(LED, OUTPUT); digitalWrite(LED, LOW);
          Serial.begin(9600);
          mySerial.begin(19200); // Initialize SoftwareSerial
          //Serial1.begin(9600); // Use this instead if using hardware serial
          printer.begin(); // Init printer (same regardless of serial type)

          }
          void box(char *string) {
          uint8_t i, len = strlen(string);
          //printer.write(0xDA);//upper-left corner
          for (i = 0; i < len; i++)printer.write(0xC4);// Top Edge
          // printer.write(0xBF);// Upper-right corner
          printer.setSize(‘S’); //Size
          //printer.println();//NewLine/Feed
          //printer.write(0xB3); //left edge
          printer.print(string);
          //printer.println(sensor1); How to print the capacity ?
          //printer.println(0xB3);
          // printer.println(0xB3);
          //printer.println();//Newline/Feed
          // printer.write(0xC0); //Lower-Left corner
          for (i = 0; i < len; i++) printer.write(0xC4);//Bottom Edge
          //printer.write(0xD9); //Lower-right Corner
          printer.println();//NewLine/Feed
          }

          void loop() {
          long sensor1 = cs_4_8.capacitiveSensor(50);

          Serial.println(sensor1); // print sensor output
          //if(4999 % 3 == 0)

          if (sensor1 >= 4000) {
          digitalWrite(7, HIGH);
          delay(100);
          digitalWrite(7, LOW);

          if (sensor1 % 2 == 0) {
          // printer.println(F(“The world is your oyster+”));
          box(“The World is Your Oyster+”);
          } else {
          box(“You Are Special-“);
          }

          printer.println(F(“”));
          printer.println(F(“”));
          printer.println(F(“”));
          printer.feed(2);

          printer.sleep(); // Tell printer to sleep
          delay(3000); // Sleep for 3 seconds
          printer.wake(); // MUST wake() before printing again, even if reset
          printer.setDefault(); // Restore printer to defaults

          } else if (sensor1 >= 2950) {
          digitalWrite(7, HIGH);
          delay(100);
          digitalWrite(7, LOW);

          if (sensor1 % 2 == 0) {
          box(“Have Empathy+”);
          } else {
          box(“Don’t Be Too Manipulated By Emotions-“);
          }

          printer.println(F(“”));
          printer.println(F(“”));
          printer.println(F(“”));
          printer.feed(2);

          printer.sleep(); // Tell printer to sleep
          delay(3000); // Sleep for 3 seconds
          printer.wake(); // MUST wake() before printing again, even if reset
          printer.setDefault(); // Restore printer to defaults

 

 

Fortune Teller (Week 13)

Goal: The goal of this project, to create the fortune teller using an arduino, thermal printer and capacitive sensor is still the same. The last time I posted I had achieve connecting the capacitive sensor and the printer into a single code. However, I still had no been able to figure out how to get the printer to print is accordance to when the capacity passes the 1000 point threshold, or in other words, when the capacity is touched. Ergo, for this past week my 3 major goals/ obstacles to overcome.

  1. Figure out how to have the printer read and print according to when the capacitive sensor is touched.
  2. Code the arduino to be able to read the capacity and give fortune according to different ranges in the capacity. For example; 1000-1499 (“The world is your oyster”) and also be able to code for if the capacity read is even or odd for another layer of fortune telling.
  3. Have the printer print the fortune.

Assembly: So I made two appointments (knowing that I probably wouldn’t complete this in one day) at the Learning Center. Originally I was trying to connect the printer to print in accordance to the push of a button, but Tubah and I had a lot of difficulties with the button so we jumped straight into using capacity. Eventually by the end of the session we got it connected. However, the printer was unable to print the correct symbols (we were testing with a barcode) matter of fact it was printing an infinite series of illegible symbols. So with task #1 taken off the list I had simultaneously created 3 more.

I was able to conclude from my experience with the Serial monitor that a possible cause of the symbol affliction was due to baud-rate and or Arduino syntax between softwareserial/ mySerial.begin and Serial.begin. I also would have to code a way to make the Arduino read the first number of capacity and then pause so that it wasn’t continuously printing fortunes for the milliseconds a participant may be touching the capacitor. Lastly, the serial monitor was no longer printing the read capacity. I wanted to be able to see the capacity change on the serial monitor so that I could make capacity ranges for fortunes.

  1. Find out how to get the printer and the Arduino speaking the same language.
  2. Code the arduino to be able to read the capacity and give fortune according to different ranges in the capacity.
  3. Code the Arduino to read only the first number of capacity past the threshold and then sleep.
  4. Get the serial monitor to print the capacity
  5. Have the printer print the fortune.

The following Monday I met with another tutor at the Learning Center, Aarati. She was amazing and helped me find the problems in my code. My intuition was right, the baudrate for the printer was changed from 9600 to 19200, which allowed the printer to be able to read the code and print correctly. Tangent from this, with small changes to the syntax of the code we were able to get the Arduino and the serial monitor to connect on the right level, thus presenting the capacity in the monitor. Lastly we even finished early enough to add in an “odd and even” if-else statement to the fortune code allowing for if the capacity if even an “evil fortune” if the capacity is odd a “nicer fortune.”  

How it works:

This is intro code to how the Fortune Teller tells it fortune. By defining several specific ranges of capacity I am able to tell the printer to print an according fortune.

The ranges I have thus far:

Capacity >= 1999 — Fortune
Capacity >= 1750 — Fortune
Capacity >=1499 — Fortune
Capacity >=1250 — Fortune
Capacity >= 1000 — Fortune
Capacity == 666 — Fortune

Materials:

  • A mini thermal receipt printer – with cables and plastic mounting shims
  • A roll of 50′ long thermal receipt paper – the perfect amount for the thermal printer. BPA-free.
  • 5V 2A power supply – an ideal supply for powering the thermal printer (and anything else that can use 5V power
  • 2.1mm DC jack adapter – makes it easy to attach the power supply to the printer
  • 6x MM jumper wires –
  • 1x LED
  • High Powered Resistor

My next step of this process is now to construct the the fortune Teller itself, solder a new clean board and clean the code up a little.

Some of my new goals are:
1) Find a way to add a text box around the code
2) Possibly make the presentation of the fortune a little more aesthetic
3) Build a nice sturdy stand to hold to box up right.
4) Make a robe and hand.

Thermal Printer Library

Thermal Printer

Thermal Printer Setup  

  • Assembly:
  • Plug in the GND (black) and VH (red) F wires into the printer
    Cut off the open end of the Red and black wires to expose the metal inside.
    Using the DC adaptor put in the exposed black and red end of the wires
    Make sure they are oriented correctly
    Plug in the GND (black), RX (yellow) and TX (Green) wires into the printer
  • Using the 3 MM jumper wires attach them to the open end of the GND, RX and TX cord.
  • Insert the TX (green) wire into the digital ~5 pin of the Arduino
  • Insert the RX (yellow) wire into the digital ~6 pin of the Arduino
  • Insert the GND (black) wire into the GND (any of them) of the Arduino
  • Highest Resistor (150.5K) ~4pin and ~8pin
  • Power Cable LED ~7pin
  • Ground Cable LED GND.
  • Download the Thermal Printer Library
    Change the baud rate from 19200 to 9600 by accessing the source code.
    If your printer test page shows ‘BAUDRATE: 9600’, you’ll need to make a small change to the library source code.
    Go into your computer files where the  Thermal Printer Library is being stored and using a text editor (Notepad, etc.) open the file Adafruit_Thermal.cpp
    Ctrl-F ‘BAUDRATE’ and change this line from 19200 to 9600.
    Save and exit.

Play Test: Fortune Teller (Week 12)

Goal: The next part of my prototype for my fortune teller was to get the Arduino thermal printer functioning and I did. With that being said the components of just the play-test for the thermal printer include;

  • A mini thermal receipt printer – with cables and plastic mounting shims
  • A roll of 50′ long thermal receipt paper – the perfect amount for the thermal printer. BPA-free.
  • 5V 2A power supply – an ideal supply for powering the thermal printer (and anything else that can use 5V power
  • 2.1mm DC jack adapter – makes it easy to attach the power supply to the printer
  • 3x MM jumper wires

Assembling the thermal printer was a little challenging due to the site leaving out some essential pieces of information like how/where the F jumper cables for VH, GND, RX and TX are supposed to be oriented as well as the key instruction to strip the VH and GND wires to connect to the DC cable adaptor. However, lucky for me I had a friend who had experience with the Arduino thermal printer and was able to guide me through it.

Assembly:

  • Plug in the GND (black) and VH (red) F wires into the printer
    1. Cut off the open end of the Red and black wires to expose the metal inside.
  • Using the DC adaptor put in the exposed black and red end of the wires
    1. Make sure they are oriented correctly
  • Plug in the GND (black), RX (yellow) and TX (Green) wires into the printer

  • Using the 3 MM jumper wires attach them to the open end of the GND, RX and TX cord.

  • Insert the TX (green) wire into the digital ~5 pin of the Arduino

  • Insert the RX (yellow) wire into the digital ~6 pin of the Arduino

  • Insert the GND (black) wire into the GND (any of them) of the Arduino

  • Download the Thermal Printer Library
  • Change the baud rate from 19200 to 9600 by accessing the source code.
    1. If your printer test page shows ‘BAUDRATE: 9600’, you’ll need to make a small change to the library source code.
    2. Go into your computer files where the  Thermal Printer Library is being stored and using a text editor (Notepad, etc.) open the file Adafruit_Thermal.cpp
    3. Ctrl-F ‘BAUDRATE’ and change this line from 19200 to 9600.
    4. Save and exit.

Though since this code has components that conflict with my capacitive sensor code I needed to make some adjustments. I changed the RX (yellow) input pin from ~6 to ~3.

Problems/Issues: Originally when I did this (change the pin from ~6 to ~3) the LED light and the capacity was working however after I tested the printer the LED no longer responded to the capacitor. Though, as stated in the video, the LED light isn’t essential to the project it is still a sign that there might be a problem with the physical system itself. As of right now I am looking at ways to integrate the capacitive code into the thermal printer code, but as a novice in coding I’m not sure how to do this syntactically correct. I have an appointment Friday (4/20 lol.) with the Learning Center to help me over this part of the project.

Play-Test Feedback:

To think about:

  • Who will you playtest with? I will playtest with anyone who is available and willing. There is not criteria or prerequisite that needs to be met by the participants.
  • How will you get their consent? Their willingness to touch the capacitive sensor is all that is necessary.
  • What feedback do you want? I want people to experience a mediocre serendipity. It’s the equivalent to a fortune cookie so I have kind of low expectations on their reactions.
  • What questions will you ask? I will ask whether they enjoyed their fortune and if they have any ideas on how I could enhance the experience and output.
  • What information do they need to know before starting? None.
  • How much will you help them during the test? I will tell them to touch the pad.
  • How will you debrief them? I will tell them that this is my final project for a class and that is it an interactive art piece.

 

Thermal Printer Library

Thermal Printer

Thermal Printer Setup  

Motors (Week 8)

Making things Move: Physical Computing Week 8

  • The three most common motors for Arduino include;
    • DC motors: Is the simplest of the motors. There are two terminals. When you apply direct current to one terminal and ground the to the other, the motor starts spinning.
      • DC motors are usually very fast, often spinning at several thousand revolutions per minute (RPM).
        • Will keep spinning until power is taken away
      • Depending on electricity the faster or slower it goes.
      • Gearhead motors: subset of DC motors that replaces speed for power.
      • Examples include computer cooling fans and toy wheels
      • Widely used in robotics because of their small size and high energy output.
    • Servo motors:Servo motors are small in size but very energy efficient and precise.
      • Consist of four components:
        • DC motor
        • A gearing set
        • A control circuit
        • A position-sensor (usually a potentiometer)
      • A servo motor can usually only turn 90° in either direction for a total of 180° movement.
      • Servo motor are controlled by sending electrical pulse width modulation (PWM).
    • Stepper motors:
      • The motor’s position can then be commanded to move and hold at one of these steps without any position sensor for feedback (an open-loop controller), as long as the motor is carefully sized to the application in respect to torque and speed.
      • Precise positional control, move 1 step each time
      • Slower than DC
      • Don’t need to get feedback during the rotation
  • To change direction change polarity.
  • How do they work: they work on the principle of electromagnetic induction. When you put an electric current through a wire- it generates magnetic field around the wire.
  • The blue and red portions are the magnet shields.

Objective: The goal of this project is to better understand how a servo motor can be controlled with a potentiometer through an Arduino. Goal of the project and/or desired interaction

Materials:
-Arduino + USB Cable
-3x M-F jumper cables
-3x M-M jumper cables
-Potentiometer
-Servo Motor
-Breadboard

Assembly:
Servo Motor:
-Connect power wire (red) to the 5V pin on the Arduino
-Connect ground wire (brown) ground pin on the bread board.
-Connect signal pin (orange) to pin 9 on the Arduino.
Potentiometer:
-Plug into breadboard with room for placing cables.
-Outer pins are connected to power (+5V) and ground via directly next to the (+5V) and ground on the bread board.
-Middle pin is connected to analog input 0 on the Arduino.
Download:
-Library Servo.h
-Code Servo Motor Code

Download the library, upload the code, and now you have control over the servo motor.

Thanks to this great Instructables I now better understand the motor components.

Week 11: Prototyping

Fortune Teller Final Project: Prototype

Capacitor Sensor: 4.10.18

My objective for today is to understand and make a working capacitive sensor.

  • Materials
    • Resistor (100k ohm)
    • LED (Red)
    • Breadboard
    • Arduino + USB cord
    • 3 Jumper Wires
    • Aluminum foil

Building it:

  1. First plug in the resistor in pin 4 and pin 8 of the Arduino
  2. Connect the touch plate (aluminum foil) to pin 8 of the Arduino with a jumper cable.
  3. Plug in the LED to the breadboard
    1. “-” to GND
    2. “+” to pin 7.
  4. Download library and sketch
    1. LED-Capacitive-Sensor Sketch
    2. Capacitive-Sensor Library

Conclusion:

So far this has been a successful second attempt at making a working capacitive sensor. As seen through the second video featuring the serial monitor and the code once the capacity passes a certain threshold (1000) the LED will turn on. Alone the capacity of the aluminum foil and the environment have stayed under the threshold, nevertheless the capacity has been changing frequently from 60s-90s to 250s-290s.

Next Step:

My goals for this week are to meet with a few people who are more capable of coding to show me how to set Boolean and if-statements according to the sensed capacity.  I’ve also ordered the Arduino thermal printer last week, now I am waiting for its arrival. 

Week 10: Project Timeline

  • Refined project description:

 

The Fortune Teller: Using an arduino, arduino printer, and a copper capacitive sensor I want to be able to give people a fortune based on the “random” amount of particles the sensor reads. Inspired by Mary Poppins measurement tape that collects the input of height and gives a corresponding description, “Perfect in everyway,” I want to design a fortune teller that reads its participants touch and subsequently gives them a corresponding fortune.

 

  • Interaction/systems diagram

 

I realize that capacitive sensors are widely unstable and inconsistent due to the incessant need for recalibration, but that is why I chose them. I like the random number of capacity because it considers so much; height, weight, if you just ate a lot, rubber shoes, lots of metal jewelry, and it able to reduce all this information to a “clean” and “concise” number.

Since I haven’t made the capacitive sensor yet I do not know the range return of capacitance number, but I acknowledge that I will have to code different responses if the number passes different thresholds. I imagine creating a mad-libs like formula for variables to be inputed depending on the number.

YOU *(ARE vs. NEED)* *(NOUN)*
Dependent on if the return variable is an odd or even number. Hopefully I can find a noun/ word library and have certain return numbers correspond to a word.

 

 

  • Timeline with milestones

 

Week 10:

  • Buy materials
  • Meet with learning center to compose the code
  • Connect Capacitive Sensor with Arduino

Week 11:

  • Connect Capacitive Sensor & Arduino with the Printer
  • Look for work library (noun)
  • Code the library and printer
  • Make plaster hand(s)

Week 12:

  • Begin to compose the entire project
    • Get/make a cloak
    • Make a stand

Week 13:

  • Final Touches

 

  • Materials list:

 

 

  • Precedents or references

 

  1. Use smoothing in your code.

If you followed the tutorial in step 3, you’ll notice that the signal from a cap sensor can be highly erratic. Therefore it’s a good idea to use some kind of smoothing function in your code. We used this one and it did a great job in stabilising the signal.

  1. Control as much of the environment as possible.

Everything from air humidity to electromagnetic noise to someone touching a cable will affect the signal strength. Eliminate as many variables as you can. Using shielded cables and making sure no other electronic equipment is operating in the immediate vicinity are two easy precautions you can take. Solid grounding will also reduce interference.

  1. Bigger surfaces = bigger signals.

The bigger the surface area of your sensor, the stronger your signal will be. A big surface area is also better for triggering the sensor at a distance.

 

http://www.instructables.com/id/Capacitive-Sensing-for-Dummies/

http://playground.arduino.cc/Main/CapacitiveSensor?from=Main.CapSense

https://www.arduino.cc/en/Reference/Libraries

Wireless Week 7

Video:

Goal: The goal of this week’s wireless assignment is to be able to control a RGB mood light via smartphone blue tooth.

Core Components:

Assembly:

RGB LED to Arduino:

  1. Red to Pin 3 of Arduino
  2. Blue to Pin 5 of Arduino
  3. Green to Pin 6 of Arduino
  4. Anode to 5V If Strip Gnd of driver to gnd of Arduino

Blue Tooth Connection to Arduino:

  1. Rx to pin 12 of Arduino
  2. Tx to pin 11 of Arduino
  3. vcc to 5v
  4. gnd to gnd

 

How it works: As the concept goes, via bluetooth and the correct smartphone app I will be able to control the color of the LED wirelessly. The designer of this project went into depth about the logistics of how the RGB LED actually changes colors by describing how the Arduino uses a digital representing Analog signal that varies pulse to mimic a PWM (Pulse Width Modulation). By using a digital representing Analog signal the colors are able to seem like they are gradually changing even when they are not.

Problems: I faced a plethora of problems with this assignment. From jumping to project to project trying to find a source that didn’t rely on Android applications or Google Play to simply the code refusing to upload onto the Arduino “programmer not responding.” To say the least I had many difficulties. Though I believe the most prevalent can be found in the fact the alternative applications I downloaded onto my phone (Iphone) to control the LED via blue tooth could not connect. I’m not sure if it was because of the code/ Arduino blue tooth or the app not being compatible with the program, regardless it didn’t work. I ended up accidentally burning out my RGB LED, so I will try again tomorrow with another application!

 

  Color LED Controller- screenshot

Images of Physical Circuit:

 

 

Sources: SmartPhone Controlled RGB MOOD Light

Continue reading

Sound and Light Week 6: Part 1

 

  • Brief: After this week’s lesson about light and sound I wanted to find a project that would further enlighten me to the logistics of how sound can be sensed and a subsequent automatic action can be taken. The first idea for a project that came to mind was to use a vibration/sound sensor to sense a sequence of wave lengths and subsequently signal this information to us by lighting up a line of LED lights with escalating levels of brightness. Though that was a bit much for a novice like myself. Ergo,  I thought pursuing something of a practical and simpler fashion could be very informative, like turning on a light fixture by clapping.
  • Goal: Conclusively, the goal of this weeks assignment is to assemble an arduino system that can sense a clap and automatically turn on an LED/light. Hopefully I will be able to personalize the clap rhythm or code that will turn on the light.

  • Assembly:
    • Materials:
      • Arduino Board, Relay Module, Sound Sensor, 9V Battery, F to M Jumper 6x, M to M Jumper 1x, Breadboard, Battery Cable, mini screw driver, wire strippers and two prong light fixture.
  • Clap Sensing Arduino Light Switch Tutorial (<– Really amazing)
    • 1) Using your light fixture, expose the live wires
      • you can leave the neutral wire alone, but it might make the length crooked.
      • The live wire is the side that runs along the the more narrow prong of the outlet head.
    • 2) After exposing the wire connect them to the relay open pins of the relay module.
    • 3) Using 3x of the F to M jumpers, connect the Relay GND pin will be connected to the GND pin of the Arduino.
      • The Relay VCC pin will be connected to the +5V pin of the Arduino.
      • The Relay INPUT pin will be connected to the Digital 5 pin of the Arduino.
    •  4) Connection of the Sound Sensor uses 3x of the F to M jumpers
      • The Sound Sensor VCC pin will be connected to the +5V pin of the Arduino.
      • The Sound Sensor OUT pin will be connected to the Digital 4 pin of the Arduino.
      • The Sound Sensor GND pin will be connected to the GND pin of the Arduino.
    • 5) Connection of the breadboard, using 1x M to M jumper
      1. Abreast from one another connect the M to M jumper to the 5v pin in the Arduino.
      2. Connect the relay module’s VCC: positive power supply M jumper end to the bread board (abreast the 5v connection).
      3. Connect the VCC: positive power supply of the sound module to the breadboard abreast the module jumper.
    • 6) Up load code:
    • 7) Connect 9V battery with cable to Arduino.
    • 8) Plug in light and turn on.
    • 9) Start clapping because now you got light!
  • How it works: Video
  • Problems:
    • The biggest problem I had with this project was due to my own lack of knowledge. In the very informative and simple video tutorial of how to make a clap sensing light switch the architect does not articulate which of the two wired cables are neutral and live (probably because most people know, but I didn’t). Accordingly, my first time around I didn’t connect the live to the relay module, instead I connected the neutral so initially my light didn’t turn on at all. I was stumped and very discouraged by the 2nd time I had taken it apart and put it back together again. The next day I did some research on how to fix cords chewed up from pets and during this tutorial I learned that in addition to my neutral and live connection problem I probably damaged the wires post stripping. By the third trial I had made a solid connection and miraculously the light turned on and could sense my clapping… snapping, and any high pitched double ” bang.”
  • Images:

    • 7) Insert the Read More quicktag, otherwise your post will go one forever.

UART Examination Week 6

Contrary to the assignment, a UART also known as the Universal Asychronous Receiver/Transmitter is not a communication protocol, but a physical circuit that transmits and receives data through the serial port. Though similarly to protocol like SPI and I2C, UART is another method to transmitting and receiving serial data from other devices. This transaction of serial data or dialog between devices is an electronics form of language, in other words communication protocols. UART (according to circuitbasics) is a relatively old communication method and like stated in its name, is asychronous language. In computing, Asychronous indicates a dialog between UARTs is defined by a start and stop notification in a data series versus a clock that synchronizes the output to the receiving UART. A UART and a I2C can send a limited amount of bits (1 start bit, 5 to 9 data bits, an optional parity bit, and 1 or 2 stop bits), these messages are called packets.

How a UART works is that it will receive data in a parallel form (all at once through multiple points) and the UART(1) will translate the data into a packet to which it will transmit the data to the receiving UART(2) in series (one after the other on a single line). The receiving UART(2) will then translate the data (discarding the start and stop bit) and send it in parallel to the external data bus.

One of the more popular advantageous attributes that UART features includes: it uses only two wires to transmit data to another device (TxD: Transmit Data –RxD: Receive Data), uses a parity bit for error checking, data packet can be changed, contains a serial buffer (extra storage space so it can do other tasks while waiting for data), and is a pervasively used and accepted method (found in most processors). These attributes make UART a great communication protocol/mode, nevertheless their convenience do have their foibles. Some disadvantages include the data frame is limited to 9 bits, does not support multiple slaves/ master systems, and the baud rates (reading speed) must be within 10% of the transmitting and receiving UARTS.

Most (all) processors have a UART because of their simplicity in communication transmission, some processors include Raspberry Pi and computers. Though in more sophisticated CPUs the UART chip has become dispensable because the software of the outputted transmission can regulate the process instead of hardware, this technique is called bit-banging.  (not completed yet)

Week 4: Update & Redo

Hello, after my initial two failures I’m back at it again with a copied code. This code is from my classmate Alyssa http://lizastark.com/physcomp/alyssas-combination-lock-week-4/ https://drive.google.com/file/d/1OlpTO_oNPYWVEbz0SmbbegJo1Oo0Lawy/view

My breadboard set up is still functional, though to match with Alyssa’s code I got rid of a button. Here are some videos of my experience:

In this video I am inputting the combination and finding that after the combination is inputted there is no way to get the Arduino to lock/ reset again.

Here I found that prior to putting in the correct combination, the buttons will reset themselves after 3 pushes.

 

Thank you.