Final Project Update – Gambling Lamp

Prototyping Update – 20190425

I’m fascinated by gambling concept, which depends on luck and we do not have control over it. Though most of the time it is a random event that it is theoretically equal possibility to get any result which might be good or bad. Some people believe that they are born with good or bad luck. So I start my idea with a gambling lamp, which is a lamp plus camera and three dices. If you want to change the brightness of the lamp, you have to roll the dice and the camera will pick up the number you get and sum them up to set the brightness of the lamp.

Original Sketch -> Determine brightness based on gambling dice!

Use open CV to detect signals and send to Max through osc
Detecting dices with openCV


Rolling dice testing
Sending signal in max through OSC
Building simulation model in c4d

0503 Update – Multi-dice detection

After demoing in expo 74 science fair, I found that if I can only get total amount of the dice dots, it will be very boring and less control ability. Thus I play with contour detection. I grab out all the contours, make a masked image for each of them and count the dots inside each masked image. The result is great! There are some points worth mentioning – zero-dot areas and white area that are too big (over 1/20 of screen are width) e.g. the desk is hidden from the screen and data, which makes the dice control more stable.

Update at 5/3 – individual dices recognition

Final Project Idea – Gambling in life

I’m fascinated by gambling concept, which depends on luck and we do not have control over it. Though most of the time it is a random event that it is theoretically equal possibility to get any result which might be good or bad. Some people believe that they are born with good or bad luck. So I start my idea with a gambling lamp, which is a lamp plus camera and three dices. If you want to change the brightness of the lamp, you have to roll the dice and the camera will pick up the number you get and sum them up to set the brightness of the lamp.

As some extensions, I though it is also fun to have a cashout machine, you have to get three 7 to stop the alarm, when you wake up late in the morning, it might be funny that you do not have enough luck to close the alarm.

Also, everyday life, not so extreme, I think the random playing feature of music apps are interesting. If we can have some fun gambling mechanic that trigger different playlist of Spotify, it is more fun than just clicking the button cause we can actual see the physical ball rolling on the plate that decide the final result.

It is fun to think about money through gambling, as an extension of this idea, I thought that out civilization is constructed based on money and capitals. What will it be like if we can make a small simulation that when people put some money into the machine, it will accelerate the city’s development and it will gradually turn from a forest into a busy city. It can also be an internet art that people can pay through PayPal to play this game online together and see how much funding is imported in to the city.


For the last part of extension, when human the city in developing, the other side of the activity cause the deconstruction of the nature environment. I’m thinking that it is quite irony if we invest money into the machine, the deconstruction process of our world is also happening on the other side of the world.

Some Cool reference I found : Social Swipe

Midterm Project – Spider

As I mentioned last week, In my midterm Project, I want to make a spider that can climb up and down when someone approach and make noise, it will climb down from the ceiling and observer what is happening then report to the master.

Spider and the microphone

Physical Holder part

For the physical device part, I use cardboard + laser cutting to make my wheeling holding device, After the fifth iteration, I finally succeeded to integrate the microphone, the turning wheel, and the motor together. I found that if I want to assemble the components without glue, I have to calculate the burn-out width of the holes and it is hard because each time I cut, I get a different result.

First version that cannot even stand well
Final version that can be assembled and has a nice looking

Micro controller: Stepper Motor and Sensor

I use a stepper motor and cannot get it working in both directions for 3 days. Finally, I found that the motor 28BYJ-48 have to use a different library which is <CheapSteaper> or it will not output the correct signal, which causes the motor to work both clockwise and anti-clockwise. Originally, I plan to use motion sensor for detection, but I didn’t have one so I change it to the sound sensor borrowed from the Arduino kit.

In my Arduino code, I use a state machine structure to control the spider’s motions. There are four modes – “waiting”, “down”, “waiting2” and “up” which are correspond to the complete cycle of spider waiting for some noise, climb down when it hears something, stay at the bottom to observe and climb back to the top. It is very playful that when the spider hears some noise. Also, there some small challenge in the development process, e.g. I have to sample analog input from the microphone 50 times and get it’s average to avoid instant peak, and I also find that I have to at yield twice inside for loop which allows aREST library to get and response to new requests during manipulating the stepper motor.

p5.js Interface for monitoring

I made a small p5.js sketch that shows the spider’s status. When the spider climbs down to see what happened, it will show a rotating eye animation on the screen. After 5 seconds, if there are no additional sound, the spider will report it is safe then climb back to the top to keep monitoring.

Rotating Eyes

Demo

If I have more time in the future, I want to make a spider that carries an ESP8266 and can remotely control by the computer and has some default state inside the micro controller. It’s a very playful experience for me to work on the prototype for such a long time and conquer the lazy and fear to improve the structure again and again.

Midterm project: Frightening Spider

In the midterm project, I want to make a spider that will be scared by noise. If someone opens the light or shout in front of it, it will roll up and make itself roll up the line to climb toward the ceiling.

I want to make some sound for the spider and make it notify the master of the house when someone comes by it. Though spider is not a great choice of cute pet, it might be your great friend that protect your house and keep silent and not disturbing you.

Network Part

Spider
3-min Spider Prototype lol

I try to use DC Motor, output PWM signals to control the clockwise and anti-clockwise turn of the motor, but the power seems not strong enough to drive the motor, then I suddenly remember that I need to add a control board for my motor to control with enough power. Digital write HIGH+LOW is not working also, I think it’s because of the current of HUZZAH is too small to push the motor to rotate.

DC Motor is not workinggggg when directly output from HUZZAH

Wanna write a control function that converts -1~1 to left turn and right turn

DC motor control module

Restful API

  • /spider/moving/1
  • /spider/moving/0
  • /spider/reset
  • /spider/roll/up
  • /spider/roll/down
  • /spider/sleep
  • /spider/dance

Homework #4 – Bouncing Sunny Goat

For homework 4, I made a bouncing goat which will observe the sun. When the photocell detects more light, the sun in the background will become less transparent. After the light exceeds the threshold, the goat will start bouncing and running.

First I create the website in Codepen, then minified by an online compressor, then make the goat move and the opacity of the sun change based on the photocell sensor value.

Ternary judgment for adding class
Calculate and replace the opacity value by CSS

I add a “move” class to the goat to start the jumping animation and change the sun’s opacity by CSS. It is very playful and I think seems awesome just using some online images to make the animation collage.

Bubble Switch

Bubbles are always my childhood dream. I try to make a switch with bubbles, which are two circles holding the bubbles and then people can blow some bubble to connect them. The water mixed with dish soap, hand soap in the bathroom and salt to increase conductibility is extremely conducive to connect the circuits.

I made one version prototype which is not suitable to solider. So the second version I use the paper clip to be the bubble-holding material. It works like an adjustable resistor when the bubble is fading! Though it seems fun, its a messy switch which will cause chaos after trigger it lots of time in front of the desk.

Conducted