Pomodoro Lamp

For my final project, I created a Pomodoro lamp, Lucee. You can turn on the light by creating a task on your IOS reminder app. The light is turned on for 40 minutes for you to focus and it turns itself off for the 10 minutes of break time. Once you complete the task, and by hitting the complete button on the app, the light would also turn off.

 

The biggest challenge was working with the servo motor. My original intent to move the light bulb up and down was challenged. I may have to work with a lever or gear chain system to support and trigger the motor.

I enjoyed working with Arduino and the internet of things. I learned how to use the Power Relay and connecting it to AC circuit.

For the next step, I would like to dig into the mechanical engineering of the movement and play with the idea of dimming of the light as the time goes on.

Here‘s the link to my instructable.

Final project progress (Pomodoro Lamp)

Hello!

I started drafting instructible instruction.

Here’s the starting paragraph about my project.

Pomodoro Lamp uses movement and light of a light bulb to increase your productivity. When you start a task, the light bulb rises up as the light turns on for 40 minutes. After 40 minutes, the light bulb falls back down and turns itself off for 20 minutes. The lamp repeats this on and off process until after the task is completed. You can also track how many 40-minute sessions it took to complete the task.

 

Step1  – Parts, Tools, Supplies

Step 2 – Circuit Diagram and codes

IMG_8708.JPG

I was able to get the micro servo motor (where the light bulb would go) to go one way for 40 mins and then the other way for 20 mins to display the Pomodoro effect.

Step 3 would be about construction. I am working on connecting the shaft to the servo motor and I would include the process in this step. Moreover, I would include the CNC cut file and any adjustments I would make to keep the circuits in place.

Step 4 would include using Power Relay to turn the light on and off along with connecting with IoT for task tracking. For the IoT, I would like to create a work flow like this:

  1. Google Calendar Applet ‘If any new event added on Homework, then send data to create a task feed’.
  2. This turns on the light and raises the bulb.
  3. When you complete the event or task, turn off the light.

I am still exploring different applets to get this to work smoothly, as I found out that there are no such applets that end an event. So I am planning to look into ios reminders applet.

 

The following are the next obstacles that  I need to tackle:

1) Attaching the shaft to the motor

2) Making the power relay to work with IoT integration

 

 

Week 11 homework

Hello,

Here are my Arduino exercises.

Lesson 5 – CIRCUIT DISPLAYS INTERNET DATA

Whenever I create a data for the weather ‘cloudy’, ‘clear’, or ‘rain’, the neopixel lights up in different ways.

IMG_8644IMG_8645

Lesson 6 – COMBINING INPUTS AND OUTPUTS

This was tricky but we figured out that we needed to use the same Adafruit IO id and key.

When my friend hits a button on her circuit, the LED lights up on my circuits.

 

For my final project, here’s the bill of material.

  1. hobby DC gearbox motor or servo motor? (move the light bulb up and down) https://www.youtube.com/watch?v=kUHmYKWwuWs
  2. Power Relay FeatherWing (turn on and off the light)
  3. Stacking Headers for Feather – 12-pin and 16-pin female headers https://www.adafruit.com/product/2830
  4. wires
  5. breadboard or microcontroller
  6. resistor
  7. transistor
  8. lightbulb and socket

 

 

Week 10 Homework and final project ideas

Hello! I was able to get the Huzzah light to blink and also was able to connect to the wifi and google.com too. However, now I am failing to connect to wifi. The arduino board doesn’t turn on.

IMG_8548IMG_8549

 

For my final project, here are my three ideas.

  1. A Pomodoro lamp. This lamp has a lightbulb installed on a rod and rotates up and down. When the light bulb is up, it lights up for 40 mins and then falls back down for another 10 mins. The time is set up so that during the first 40 mins, you would diligently work, and you can take a break for the next 10 mins. Inside the box of the lamp, I would like to display the list of tasks or interesting articles to read as a reminder.
  2. The second idea is a yoga mat. It would wake you up with an alarm and the alarm won’t go off until you finish a yoga routine. I am thinking of using capacitive sensor to detect pressure or touch. I would like to use music as an alarm. This would require recording the yoga routine beforehand; when you wake up you do the same routine to turn the alarm off.
  3. A mirror that turns on when you move in front of it. After 20 squats in front of the mirror, it finally turns on. This would also require recording the gesture beforehand. I was also inspired by this project. https://www.instructables.com/id/Infinity-Mirror-Table/
  4. The last one is related to food detection. Since I have been dealing with the issue of snacking too much, and as an effort to eat healthier, I would like to create a product that helps you eat healthier. I was inspired by this project. https://create.arduino.cc/projecthub/crispylel/food-detector-6178cc?ref=tag&ref_id=monitoring&offset=31

 

Two Fridas

The photos from the parade!

The parade was a lot of fun and definitely worth the effort we put into make the costume.

IMG_8462P2290614IMG_8422img_8391.jpg

IMG_8389

Embroidering the heart – we created the graphics in vector and used the embroidery machine to stitch the outline of the heart on the fabric. We learned that the density of the stitch is very important as it broke the needle while stitching! Testing the density and how stable the tension is imperative.

DSC_0086

img_8368.jpgTesting the circuit for two LEDs fading

 

The code used for the two fading hearts and LED strip in between the hearts that goes back and forth.

 

#include <Adafruit_NeoPixel.h>
#ifdef __AVR__
#include <avr/power.h>
#endif

#define PIN 4

LORA pixels, not v2)
//   NEO_RGBW    Pixels are wired for RGBW bitstream (NeoPixel RGBW products)
Adafruit_NeoPixel strip = Adafruit_NeoPixel(30, PIN, NEO_GRBW + NEO_KHZ800);

// IMPORTANT: To reduce NeoPixel burnout risk, add 1000 uF capacitor across
// pixel power leads, add 300 - 500 Ohm resistor on first pixel's data input
// and minimize distance between Arduino and first pixel.  Avoid connecting
// on a live circuit...if you must, connect GND first.

int led = 9;// the PWM pin the LED is attached to
//int led2 = 3;
int brightness = 0;    // how bright the LED is
int fadeAmount = 8;    // how many points to fade the LED by

void setup() {
// This is for Trinket 5V 16MHz, you can remove these three lines if you are not using a Trinket
#if defined (__AVR_ATtiny85__)
if (F_CPU == 16000000) clock_prescale_set(clock_div_1);
#endif
// End of trinket special code

pinMode(led, OUTPUT);
//pinMode(led2, OUTPUT);

strip.begin();
strip.show(); // Initialize all pixels to 'off'
}

void loop() {
// Some example procedures showing how to display to the pixels:
colorWipe(strip.Color(255, 0, 0), 50); // Red
colorWipe(strip.Color(0, 0, 0), 50); // Red
colorWipeReverse(strip.Color(255, 0, 0), 50); // Red
colorWipeReverse(strip.Color(0, 0, 0), 50); // Red

}

// Fill the dots one after the other with a color
void colorWipe(uint32_t c, uint8_t wait) {
for(uint16_t i=0; i<strip.numPixels(); i++) {

//analogWrite(led2, brightness);
analogWrite(led, brightness);

// change the brightness for next time through the loop:
brightness = brightness + fadeAmount;

// reverse the direction of the fading at the ends of the fade:
if (brightness <= 0 || brightness >= 255) {
fadeAmount = -fadeAmount;
}
// wait for 30 milliseconds to see the dimming effect

strip.setPixelColor(i, c);
strip.show();
delay(wait);
}
}
// Fill the dots one after the other with a color
void colorWipeReverse(uint32_t c, uint8_t wait) {
for(uint16_t i=strip.numPixels(); i>0; i--) {

//analogWrite(led2, brightness);
analogWrite(led, brightness);

// change the brightness for next time through the loop:
brightness = brightness + fadeAmount;

// reverse the direction of the fading at the ends of the fade:
if (brightness <= 0 || brightness >= 255) {
fadeAmount = -fadeAmount;
}

strip.setPixelColor(i, c);
strip.show();
delay(wait);
}
}

// Input a value 0 to 255 to get a color value.
// The colours are a transition r - g - b - back to r.
uint32_t Wheel(byte WheelPos) {
WheelPos = 255 - WheelPos;
if(WheelPos < 85) {
return strip.Color(255 - WheelPos * 3, 0, WheelPos * 3);
}
if(WheelPos < 170) {
WheelPos -= 85;
return strip.Color(0, WheelPos * 3, 255 - WheelPos * 3);
}
WheelPos -= 170;
return strip.Color(WheelPos * 3, 255 - WheelPos * 3, 0);
}

 

TWO FRIDAS – Seona and Pantea

Here are our initial brainstorming.

IMG_8161IMG_8162

Frida props:

  1. Hearts pulsing – We created a code for our hearts and here’s the video of the two LEDs fading in and out.

int led = 9; // the pin that the LED is attached to
int led2 = 8;
int brightness = 0; // how bright the LED is
int fadeAmount = 5; // how many points to fade the LED by

// the setup routine runs once when you press reset:
void setup() {
// declare pin 9 to be an output:
pinMode(led, OUTPUT);
pinMode(led2, OUTPUT);
}

// the loop routine runs over and over again forever:
void loop() {
// set the brightness of pin 9:
analogWrite(led, brightness);
analogWrite(led2, brightness);

// change the brightness for next time through the loop:
brightness = brightness + fadeAmount;

// reverse the direction of the fading at the ends of the fade:
if (brightness == 0 || brightness == 255) {
fadeAmount = -fadeAmount ;
}
// wait for 30 milliseconds to see the dimming effect
delay(30);
}

Here is the image of the heart we are going to embroider onto each of our hearts.

53b3dd0fc5b9d3f48c5da575b9a5a335.jpeg

 

2. LED Strips – we are still working on the code of the LED lights going back and forth between the hearts.

3. Flower hairband

 

Supplies

We are going to be using one small LittleTiny Arduino board, red LEDs, 5V NeoPixel Strips, a tube to link up the LEDs. We may choose to get another arduino board for the separate heart LED if we think the link between the LEDs doesn’t work. We are also going to be using the power bank instead of the battery packs.

 

 

Halloween Costume Ideas

IMG_8143

  1. Sparkle leopard dress – my first idea is using my latin leopard dress and adding lights on the skirts so that it sparkles when I dance in the dress. It will have the led lights along the lining and also around the hip and waist area where the Latin dance movement is often emphasized. I wanted to make something that I would like to wear while dancing and I think it would be helpful to have lights to show how much you are moving while you practice! I plan to use Flora accelerometer and mainboard but fiber optics seem really cool too for adding some flair to the skirt.
  2. The second idea is inspired from the fairy tale by Christian Andersen, The Little Match Girl. I saw the Adafruit tutorial of a candle and a fire pouch which I would like to use to carry. I would also make a match that has an led light at the tip of the match.

Week 6 Arduino Homework

Here are my Arduino homework videos for this week. I think i’m getting used to working with the Arduino board now and enjoy seeing how the lights turn on. Also, soldering is getting better.

Analog Input Output

Motor

Placing the diode and transistor in the right place was a bit confusing. So is the diode being used to control the voltage of the motor? It seems like it’s being used to allow current to move through it in one direction. Why does it connect to the power, not the ground, while the other end of the motor also connects to the ground?

The diode prevents the transistor from dumping any blowback voltage anywhere it shouldn’t (something motors are prone to doing).

Neopixel Strip

 

 

Plush night brain

My plush is a brain! This brain lamp is for anyone who likes to use their brain, but also for those who want to take a break and keep calm. The switch allows you to turn on and off the light. It diffuses the light to help you relax or keel calm, carry on thinking about your next big idea! You can also pat it like your teddy bear when you need a break from thinking too much.

If your brain is constantly thinking, it is a reminder to stop working on your brain muscle but move your body muscle. Also, it is a reminder to think smart whenever you are working at your desk. It can be either put on your desk, your coffee table or hang from your ceiling of your front door.

 

IMG_7871IMG_7832IMG_7838IMG_7849IMG_7852IMG_7860IMG_7869IMG_7863

 

I failed a lot in soldering but I learned so much about the best practices. I’m still learning about the circuit diagram and working with the resistors to make the light brighter. It also turned out blue or yellow LEDs are better than the white ones, which I thought would be good. Failing served good for me to learn!

Arduino Homework #3

I had a hard time understanding pull down and pull up resistor. I took some notes from my research to understand how it relates to our study, but hope we could go over this in class!

Digital Input

Serial Monitor

Fading Away

const int buttonPin = 2;

const int led = 9; // the PWM pin the LED is attached to
const int led2 = 10;
const int led3 = 11;

int brightness = 0; // how bright the LED is
int fadeAmount = 5; // how many points to fade the LED by
int buttonState = 0; // variable for reading the pushbutton status
// the setup routine runs once when you press reset:
void setup() {
// declare pin 9 to be an output:
pinMode(led, OUTPUT);
pinMode(led2, OUTPUT);
pinMode(led3, OUTPUT);
pinMode(buttonPin, INPUT);
}

// the loop routine runs over and over again forever:
void loop() {
buttonState = digitalRead(buttonPin); // check if the pushbutton is pressed.
if (buttonState == HIGH){
analogWrite(led, brightness);
analogWrite(led2, brightness);
analogWrite(led3, brightness);
}

// change the brightness for next time through the loop:
brightness = brightness + fadeAmount;

// reverse the direction of the fading at the ends of the fade:
if (brightness <= 0 || brightness >= 255) {
fadeAmount = -fadeAmount;
}
// wait for 30 milliseconds to see the dimming effect
delay(10);
}

 

Attempts trying to turn on the LEDs using a button

I think i’m having a hard time with the looping that turns off one LED and then the other. I was googling to figure out how this might work but I think loop is a bit harder to do when there is a button involved.

Code 1

// constants won’t change. They’re used here to set pin numbers:
#define button 2
#define led1 12
#define led2 13
#define led3 11

int state = 0; //integer to hold current state
int old = 0; //integer to hold last state
int buttonPoll = 0; // integer to hold button state

void setup() {
// put your setup code here, to run once:
pinMode(button, INPUT);
pinMode(led1, OUTPUT);
pinMode(led2, OUTPUT);
pinMode(led3, OUTPUT);

digitalWrite(led1, LOW);
digitalWrite(led2, LOW);
digitalWrite(led3, LOW);
}

void loop() {
buttonPoll = digitalRead(button); //poll the state of button
if(buttonPoll == 1){ //check if it has been pressed
delay(50); //wait 50ms
buttonPoll = digitalRead(button); //poll button again
if(buttonPoll == 0){ //if its 0 considered one press
state = old + 1; // increase state by 1
}
}
else{ // if the button has not been pressed
delay(100);
}
switch (state) {
case 1:
digitalWrite(led1, HIGH);
digitalWrite(led2, LOW);
digitalWrite(led3, LOW);
old = state; //set old state as current state
break;
case 2:
digitalWrite(led1, LOW);
digitalWrite(led2, HIGH);
digitalWrite(led3, LOW);
old = state;
break;
case 3:
digitalWrite(led1, LOW);
digitalWrite(led2, LOW);
digitalWrite(led3, HIGH);
break;
default:
digitalWrite(led1, LOW);
digitalWrite(led2, LOW);
digitalWrite(led3, LOW);
old = 0; //reset to all off/state 0
break;
}
}

 

Code 2

const int buttonPin = 2;
const int led1 = 12;
const int led2 = 13;
const int led3 = 11;

//variables will change;

int buttonState = 0; //variable for reading the pushbutton status
int buttonPressCount = 0;
int numberOfLED = 3;

void setup(){
pinMode(led1, OUTPUT);
pinMode(led2, OUTPUT);
pinMode(led3, OUTPUT);
pinMode(buttonPin, INPUT);
}

void loop(){
buttonState = digitalRead(buttonPin);
if (buttonState == HIGH){
if (buttonPressCount % numberOfLED == 0){
digitalWrite(led1, HIGH);
}else{
digitalWrite(led1, LOW);
}
if (buttonPressCount % numberOfLED == 1){
digitalWrite(led2, HIGH);
}else{
digitalWrite(led2, LOW);
}
if (buttonPressCount % numberOfLED == 2){
digitalWrite(led3, HIGH);
}else{
digitalWrite(led3, LOW);
}
buttonPressCount++;
//delay(400);
}

}

 

Some of my notes for my own sake 🙂

Modern digital logic gates, IC’s and micro-controllers contain many inputs, called “pins” as well as one or more outputs, and these inputs and outputs need to be correctly set, either HIGH or LOW for the digital circuit to function correctly. circuits can only have one of two logic states, called the logic “0” state or the logic “1” state. (Logic Level of Pull Up:1 / Pull-down: 0)

Why???? Pullup resistors are used in electronic logic circuits to ensure that inputs to the arduino settle at expected logic levels if external devices are disconnected or high-impedance. ‘Just because you have nothing at all connected to an input pin doesn’t mean it is a logical zero.’

The difference between them is whether the resistor is connected to VCC or GND. Pull up resistor is when it’s being pulled up while it is being pulled down to connect to GND.

When a switch is closed (on), input is connected to ground and at this time, the logic level is 0.  To prevent accidental switching of digital circuits, any unconnected inputs called “floating inputs” should be tied to a logic “1” or logic “0” as appropriate for the circuit. We can easily do this by using what are commonly called Pull-up Resistors and Pull-down Resistors to give the input pin a defined default state, even if the switch is open, closed or there is nothing is connected to it.

As the input is now effectively unconnected from either a defined HIGH or LOW condition, it has the potential to “float” about between 0V and +5V (Vcc) allowing the input to self–bias at any voltage level whether that represents a HIGH or a LOW condition.  ->>>> this must be the floating stage..

——————

So it sounds like, by using what are commonly called Pull-up Resistors and Pull-down Resistors to give the input pin a defined default state, even if the switch is open, closed or there is nothing is connected to it.