Twitter mood lamp

for this weeks task I wanted to create a mood lamp inspired by this post:
https://www.hackster.io/KaustubhAgarwal/world-mood-lamp-0634cb

the idea is that whenever you post a tweet with a particular hashtag the lamp will light up, it made use of IFTTT and Blynk and I thought it would be fun and simple to do but I was very wrong.
I first set up a basic circuit with an RGB light and tested to see if that was working which it was. Then I moved on to setting up accounts for both IFTTT and Blynk. I really like IFTTT it’s really fun and easy to use thank you for introducing me.
I linked my Twitter account and created a trigger. This was where things started to get confusing. If you follow the link the tutorial is quite vague and so I struggled a lot with trying to set up Blynk and link it to my Arduino. I think the main reason was due to the fact that I was trying to do it through USB and most tutorials use Wifi. I tried just figuring out how to use Blynk with Arduino using a USB and it wouldn’t work, I then tried to connect IFTTT to Blynk and again I couldn’t figure it out. I don’t think I’ve ever been more confused in my life and I’m slightly upset I couldn’t figure this out. My mood light was a failure 🙁

Arduino remote

This was a complete failure and I’m not sure why, at first I thought it was because I hadn’t entered in the correct ports for the code but it still didn’t work after I made that correctio :(. It kept showing me this instead of hexadecimal numbers when I pressed a button on the remote.

“The function decode(&results)) is deprecated and may not work as expected! Just use decode() – without any parameter.”

#include <IRremote.h>
 const int RECV_PIN = 7; 
 IRrecv irrecv(RECV_PIN);
 decode_results results; 

void setup(){
 Serial.begin(9600); 
 irrecv.enableIRIn(); 
 irrecv.blink13(true); } 

void loop(){ 
if (irrecv.decode(&results)){ Serial.println(results.value, HEX); irrecv.resume(); 
 } 
}

it has come to my attention that past me did not take any pictures of the circuit for some reason :// this is truly disastrous

processing penguin

This was really cute and fun to do, I was a little confused at first on how to set things up but it worked out well in the end I played a little with the code to see how to make the penguin bigger and smaller, It’s interesting to note that when you change the number from a decimal to a whole one the change in size isn’t very dramatic when you move the light.

also realized that this is supposed to be an owl and I’ve been calling it a penguin this entire time…

Processing code

//March 28, 2017
//Earl Mark
//Make an owl Grow according to the light level
//Owl modified after Reas and Fry Intro to Processing Text
//Exercise:
// 1. Make more than one owl
// 2. Have the owl(s) adjust according to sound detector values (tutorial 15 of the arduino 101 tutorials)
// 3. Make the owl(s) eyes blink such as when someone claps their hands
import processing.serial.*;
Serial myPort; // The serial port
String inString; // Input string from serial port
int lf = 10; // ASCII linefeed
String[] photoSensorRead; //for text array for output from arduino
float n; //for raw value from arduino
//int brightness; //for adjusted value from arduino
void setup(){
size(1280, 720);
myPort=new Serial(this, "COM20", 9600);
myPort.bufferUntil(lf);
}
void draw(){
background(150,200,255);
//read photosensor value from serial port
photoSensorRead = split(inString, '='); //subdivide text string at " = "
//println("photoSensorRead " + photoSensorRead);
//parse text value of photosensor value
if (null != photoSensorRead && photoSensorRead.length > 1) {
String num = photoSensorRead[1];
n = float(Integer.parseInt(num.trim()));
}
randomSeed(0);
float scale = map(n, 0.0, 1025, 0.12, random(1.5, 2.75));
owl(width/2.0, height - 10, int(random(50, 120)), scale);
}
void owl(float x, float y, int g, float s) {
pushMatrix();
translate(x, y);
scale(s); // Set the size
stroke(138-g, 138-g, 125-g); // Set the color value
strokeWeight(70);
line(0, -35, 0, -65); // Body
noStroke();
fill(255);
ellipse(-17.5, -65, 35, 35); // Left eye dome
ellipse(17.5, -65, 35, 35); // Right eye dome
arc(0, -65, 70, 70, 0, PI); // Chin
fill(51, 51, 30);
ellipse(-14, -65, 8, 8); // Left eye
ellipse(14, -65, 8, 8); // Right eye
quad(0, -58, 4, -51, 0, -44, -4, -51); // Beak
strokeWeight(1);
popMatrix();
}
void serialEvent(Serial p) {
inString = p.readString();
}

Arduino code

//Earl Mark 3/23/17
int photocellPin0 = A0; // the cell and 10K pulldown are connected to A0
int photocellReading0;
void setup() {
// initialize serial communication:
Serial.begin(9600);
}
void loop(){
photocellReading0 = analogRead(photocellPin0); //read photoresister
Serial.print(" _ Analog reading 0 = "); //output value to serial port
Serial.println(photocellReading0);
}

slightly chaotic thoughts on physical computing ethics

As we live in such a consumerist, capitalist culture I feel it can be quite difficult to do things completely ethically. However, I do think it is important to still try. I would like to be ethical in sourcing resources so knowing where everything comes from and the conditions workers are working in. I don’t feel our current way of doing things is right or sustainable however I don’t really know if it is really ever going to change. Yes, consumers should be more responsible with our choices but it’s not always easy and we do not always have that option. Like with the issue of the production of not just smartphones but also technology in our society right now you can’t just not have a smartphone you know.
Also, I feel like we need to think more about the kind of technology that is being put out and the implications that it could have and how it affects other people. for example, deepfake technology now I personally do not believe this should exist as I feel it does more harm than good. Facial recognition is another one I’m more on the fence with this as I think it could be very useful but I also don’t trust a lot of institutions that implement it. Humans often do things because they can but never think maybe we shouldn’t lol.

Let there be sound

This was also quite easy to set up one issue I did have was when I tried to add a button ( yes again :() it just wouldn’t work and I just do not know why :(.
If you play around in the code and change the frequency that changes the sound it makes, I put mine up to 25000 Hz and my dog was not amused.
This also reminds me of the voicebox that is put into things like stuffed animals and children’s toys I feel that would be a really cute concept to explore

Tilt sensor!

You tilt the breadboard and the light switches off!
I did this with the same layout of the dice one and it worked perfectly 🙂

working with the tilt sensor reminded me a lot of videogame controllers. In certain games, you can control actions by tilting your controller. I think it would be interesting to attempt to make a makeshift game controller with arduino.

My failures :(

There was an attempt to create the lie detector test and it did not turn out very well. I started first by testing to see if the lights would come on and they did not… I tried reconnecting it a couple different ways and it just wouldn’t function? I also think I still need to get use to graphical representations of circuits. rather than real pictures. Also when I connected to v5 the circuit just would not come on and got really hot which I don’t think is good. I will try this again with the fresher eyes.

I simply do not understand how to get buttons to work again I realize it’s probably an issue with how I’ve connected it but I just don’t know how to fix it. The closest I got was in the second picture where I pushed the button went to go pee and when I came back the light was on. I think it was a fluke though because the button did not switch the light off and the light did not come on again after I had disconnected and reconnected from my laptop.

RGB lights

This was made using similar wiring as the knight rider one but replacing the led lights with the RGB one. Had no issues lights are pretty 10/10 would do again.

doing this reminded me of the lights I have hanging in my accommodation. I think it would be fun to try and make some lights like that.