PEO – Personal Energy Orb

22 Comments

PEO is a little energy device that limits your computer usage time to a value generated from the distance you traveled with your bicycle in advance. It raises awareness for the amount of time spent in front of computers nowadays and forces its users to seek physical exercise in compensation for their “screen hours”.

The Idea

the concept poster

The excessive use of computers is a common problem in todays connected world. Many jobs require the use of personal computers throughout the work day and also our spare time is frequently spent at home in front of computers or similar technical devices, whereas our time spent on physical activities decreases. This can lead to a lack of social interaction and can ultimately cause health problems.

While it is not possible to simply reduce the time of computer use for anyone, e.g. computer scientists, a way of mitigating this problem is to find the right balance between computer use and physical exercise. However, as is generally known, regular sportive activities require a certain level of self-control, therefore our idea was to create something that supports people with keeping that balance between computer use and being outside and doing sports.

The Scope

Following the topic of the course “outdoor electronics”, PEO is mobile and even encourages its users to go outside and rewards exercise with a raising energy level. Furthermore, PEO combines the two subtopics “distance” and “energy awareness”:

  • Distance: The distance you travel with your bike has a direct impact as it increases your virtual energy level
  • Energy Awareness: The virtual energy level serves as a metaphor for time as a limited resource that is wasted in front of a computer which should rather be used more consciously.

The Interaction

PEO allows no direct interaction, but can be influenced in two ways:

  • By using the computer with PEO connected, PEO’s energy level is constantly decreased
  • When riding your bicycle with PEO attached, its energy level can be increased again

Trough color and luminosity change, PEO provides visual feedback about its energy level as well as the mode it currently is in (for a detailed explanation, see next paragraph “Technical realization“). A more precise feedback on the energy level change can be achieved by using the PC application. When PEO’s energy decreases, it slows down the mouse speed of the computer it is connected to. At zero percent, the mouse speed is set to the slowest possible mouse speed on Windows computers. While at this speed it is not entirely impossible to work, operating your PC becomes so annoying that you will want to stop using your computer and recharge your PEO again.

PEO’s color represents its current energy level (red = low energy).

The PC software shows the exact energy level.

Technical realization

PEO contains an Arduino (Uno) programmed to be in one of three states:

    1. Connected to the bike:PEO knows that it is connected to the bike thanks to a reed switch in its base plate. The bike mount holds three magnets that serve two purposes:
      • They hold the PEO in place when attached to the mount
      • They activate the reed switch connected to an input pin of the Arduino, so that it knows that the orb is connected to the bike.

When connected to the bike, PEO keeps glowing all the time. That serves as feedback that it is connected correctly and shows the current energy level so that changes can be seen without delay. Only in bike mode, the Arduino will listen to input from the revolution counter on the bike. The internal energy level is increased with every revolution of the wheel and PEO changes its color to represent the current energy level.

  1. Connected to the PC: When connected to the PC, PEO is powered by current from the USB port instead of its built-in battery. On the PC a little python program pings the Arduino in a short time interval over a serial connection. The Arduino checks for incoming messages and sends an answer back when it receives a ping. This ensures that Arduino and PC know that they are connected to each other. Both will switch to the “disconnected” state when they don’t receive messages for more than a few seconds. While the PEO is connected to the PC, the lights stay on all the time. The PC program sends a message to the Arduino every few seconds to decrease its energy level. The Arduino then sends back its updated energy level so that it can be shown in the energy level monitor application on the PC.
  2. Idle: PEO changes to this state when it’s neither connected to the bike nor to the PC. To save energy, the lights inside won’t stay on all the time, but will flash every few seconds to show the energy level.

To prevent a loss of your current energy level when the battery runs empty, PEO automatically saves its energy level to the non-volatile EEPROM of its integrated Arduino and restores it on restart.

The Circuit

PEO’s circuit (made with Fritzing)

The Code

Arduino Sketch

Python Program

Problems encountered

In its first draft, PEO was intended to consist of two orbs instead of one. One smaller orb should be kept attached to the bike and the bigger one to the PC at home. The idea was to only carry the smaller one to your PC to recharge the bigger one. Therefore we built two orbs at first, the first one with the bike logic integrated and the second one with the PC logic. We were looking into ways to transfer the data between both orbs without wires. That is why we chose to use XBees because they seemed like a good compromise between complexity and possibilities. Both Arduinos inside the orbs had XBee wireless transmitters connected to them to exchange the energy level.

While we were able to get the XBees and the energy level transmission working, it turned out to be impossible to use the serial connection of the Arduino for both the XBee transmission and the transmission to the python program on the PC at the same time, because the XBee constantly interfered with the serial communication to the PC. After over one day of trying we decided to drop the wireless aspect and put everything into one orb.

At the day of the final presentation, we got everything running right on time, but realized that two minutes before the presentation, PEO’s battery ran empty, although we exchanged it with a new one two hours before. Apparently the Arduino needs at least 7V when connected to the external power supply. Fortunately we could power it over USB instead, but still that was a pity, because we therefore needed to keep it close to the laptop and people could not drive around and try the recharging process as we intended.

Photos

Prototypes & Project Progress

Final Project

Addendum:

Good looking Web interfaces for Arduino with Python

Designing a GUI for a project is always problematic. There are hundreds of different toolkits to create GUIs but learning them takes a lot of time. A very simple way to quickly create a nice looking interface to your Arduino project is pybottle.

Pybottle is a micro web-framework that simplifies creating a small website. Combined with pyserial to read Arduino output from the COM port this is a good way to prototype your GUI. We used it for PEO’s energy level monitor application in the PC.


import bottle
from bottle import static_file

@bottle.route('/')
def index():
return open('./html/index.html','r')

bottle.run()

This small peace of code already serves you the index.html file. The standard pybottle server starts on port 8080 so this page is accessible on http://localhost:8080/.

If your site contains images and other resources you should define a static_filepath:


@bottle.route('/html/')
def static(filepath):
return static_file(filepath, root='./html/')

@bottle.route also allows you to directly return JSON like objects by adding key, value pairs to a dictionary.


@bottle.route('/arduino/')
def getArduino():
dic = {}
dic['sensor1'] = sensor1
return dic

Now for the tricky bit. The Pybottle server is running in an endless loop this means that if we want to continuously read the sensor values from an Arduino we need
a separate thread.

First we need additional modules:


import sys, threading, time, os, signal, operator

And a little helper class:


class MyThread(threading.Thread):
def __init__(self, target, *args):
threading.Thread.__init__(self, target=target, args=args)
self.start()

In this thread we have another endless loop that reads from the COM port and updates the sensor values.


def arduino_serial_connection():
global credits

while running:
try:
serial_connection = serial.Serial(mySerialPort,9600)
line = serial_connection.readline()
print line
except SerialException, e:
print e

time.sleep(1)

To update the value on the HTML page we can use a simple jquery javascript function.


<script type="text/javascript">// <![CDATA[
var allVals = []; function getArduinoValue(){ $.getJSON('/arduino/', function(data){ if(data.credits >=0) {
$('#value').html(data.sensor1);
}
});
}

setIntervall("getArduinoValue()",500);
// ]]></script>

Just add your favorite HTML-Template a little bit CSS magic and presto you have a nice looking web interface for your Arduino.

A complete example can be found here.

W.A.M.P- Where are my People?

1 Comment

What is it?

This years topics for the sketching with hardware course dealt with outdoor experiences. We chose the subtopic “distance” for our Prototype.

Two thoughts lead to this idea:

Korbinian experienced a situation, in which he had a partynight with a friend, whose wife tried to track his position via his smartphone and was worried, as the signal showed a place on a lawn.
Thomas on the other hand, thought of an utopic tool, which would be able to find the position of anything you are looking for and showing the spot with an interactive flying arrow in the sky.
Also the Idea was concepted for couples. Recently being in love with somebody makes you think of that person all the time. What is she/he doing? Where is she/he at the moment? The WAMP is a concept to fix the physical gap between two people by displaying the position of the partner, which could satisfy the emotional need of being close.
Pretty soon we made up our mind to use a weather vane to show a person´s position. Its normal task is to show the direction of blowing winds and cardinal directions. The WAMP shows where you will find your girl- or boyfriend or other people you are tracking via their smartphone or computer. It is designed as a decorative wind vane with special features, standing on your balcony or terrace.

A simple sketch we made for the prototype while planning:

How does it work?

The basic feature of the WAMP is to show the direction to a place or a person. So if you follow the direction the WAMP displays, you will meet that place or person eventually.

For fix places it would just be necessary to save a gps-point in the code so far (as the prototype doesn’t offer an interaction interface yet, to save more directions or change them quickly). For the Presentation we saved the position of Marienplatz and London (because of the current olympic games).

If you want to know the position of someone, it is necessary that this person has a smartphone connected to the net, because you need its gps-location tracked.

Via Google Latitude, this location will be send to the operating computer connected to an Arduino. A Python-Script translates the position of the signal into a vector and sends an angle to the Controller.

A servomotor on top of the prototype turns an arrow towards the right direction, depending on the position of the WAMP. Because the Servo-Motor turns only within 180°, we needed a gear ratio of 2:1 to get the full 360°.

As the tool has 3 possible directions to show, you find 3 colored buttons, in the middle of the bar. A visual signal on top shows you, which signal you are tracking at the moment.  Pushing the red button for example, which could be linked to the gps-signal of Max Mustermann, will color the arrow red and turns it towards the location of the person.

If there is no button pressed, the arrow turns slowly around, from north pole to north pole. A tightly installed compass rose makes it easy to adjust the system to the north after moving it.

The original idea was also to display the distance of a person. Concerning the software it would have been no problem to calculate this, but concerning the hardware, we decided to leave this feature out, because of the multiple circuits we would have had to install. Unfortunately we ran out of time for this.

Values and Potentials:

Disregarding the modern and unique design of that toy, it satisfies the human curiosity. As a lot of people are addicted to spread information about their current status like on facebook, this tool also gives information about the location of people – if they allow it by offering their Google-ID. That might be interesting when you think about coming together with friends. Maybe you use the WAMP and recognize that a person is just two blocks away. So why not trying to catch him for a short meeting?

And there is still the emotional aspect for couples. You touch the bar and you know exactly into which direction you can send your kitschy little thoughts.
And you could also learn to estimate directions better. I recognized that people tend to depend on buildings and streets, when they try to figure out a cardinal direction. The WAMP could also be a practice-tool to get a better feeling for directions.

Next Steps:

In lack of time and because of hardware issues, this prototype does unfortunately not apply all the nice features we planed to build up at the beginning. So there are still some improvements. The biggest one would be the distance-display. We thought about using a LCD-display, which could show the distance between the vane and tracked aim (person) in numbers. We also thought that it might be more elegant to display this information on the direction arrow on top. So maybe if the whole sign is lightened, it means the aim/person is very far away, let’s say more than 1000 km. Two third lightened, means between 100 and 1000 km. One third means below. With better LEDs, one could install even finer display bars like this or a very simple, but well designed code system like roman numbers.

Source-Code:

Feel free to download our Source-Code.

Blowfish – Don’t scare it, or it puffs up!

Leave a comment

What is it?

This years theme in “Sketching with Hardware” was Bionics. Consequently, the task was to rebuild or reuse a natural and biological method. Our team decided to imitate the behavior of Tetraodontidae – that’s the family of fish with the ability to inflate their body to a ball-like shape in order to defend itself. In an outburst of pure creativity, we named our prototype Blowfish!

Blowfish is designed to puff up when users come too close or are too loud. Somebody clapping hands loudly will find Blowfish doubling its surface. As puffers don’t like people coming too close, Blowfish inflates if one approaches it’s face.

To put it in a nutshell, Blowfish is an ambient display visualizing noise and distance in a striking way. Just put it in one of your room’s corner and you’ll always know whether or not your shouts about an exiting soccer game will disturb your neighbors.

[ Skip to Video-Demonstration ]

How does it work?

The basic building blocks of the prototype are:

  • umbrella
  • printer slide
  • metallic arm that pushes the umbrella
  • relay, switching the motor direction
  • front emergency button to switch the direction
  • clap sensor
  • distance sensor
  • microphone in combination with processing
  • serial connection → Arduino → control motor power

The basic concept is to push the umbrella open, by moving the carriage of a printer slide.

In order to extend the reach, a metallic arm is mounted on the moving carriage.

In the same way a real blowfish deflates it’s body after a certain amount of time, our blowfish has to reduce it’s surface area. This is achieved by moving the printer slide backwards which in turn drags the umbrella shut. On a more technical level, this means that the motor powering the printer slide has to reverse it’s direction. The exact components of how this was achieved are detailed in the next section Lessons learned.

As the motor power is controlled via an Arduino, it was possible to install an emergency button at the front end of the printer slide that notifies the Arduino each time the umbrella is opened completely.

Animation showing the movement of the printer slide. Note: This is not the way the carriage moves in the final blowfish prototype.

After a fixed amount of delay, the Arduino switches the motor direction and gives power to the motor in order to close the umbrella.

As blowfish is sensitive to noise, the prototype requires some kind of sensory input to recognize sound volume.
The Arduino is connected via USB to a laptop which functions as the power-source. In addition to providing current, this connection can also be used to control the Arduino’s program logic from software, for example by using Processing.
The principle of operation is as follows:

Microphone input → Processing → check threshold → notify Arduino via Serial (USB) Connection → Arduino initiates ‘alarm function’ (starts motor) → umbrella opens

In addition to volume sensitivity, blowfish also react to physical distance. This ability is reproduced using an IR sensor which is directly connected to the Arduino. The Arduino’s software computes median values from the sensor’s raw input in order to dampen the signal’s oscillation. Finally, a threshold check is performed and the ‘alarm function’ called when the signal is above the set threshold.

Lessons learned

How to switch the direction of a DC motor?

As stated above it was crucial for the blowfish project that the device is capable of closing the umbrella, in order to deflate the blowfish body. That means that the motor of the printer slide has to be able to move forward AND backward. This can easily be achieved by consecutively supplying positive and negative voltage to the DC motor. Theory is often so easy … while bringing this concept to life in a working prototype is not, especially not for non Electrical Engineering students.

After further research, we discovered that it’s possible to use an H-Bridge to apply voltage across a load in either direction. We implemented a circuit using relays to allow the DC motor to run forward and backward. In fact, two relays are used. One to stop the motor and one to switch the current flow.

Use 2 axicom d2n relays to turn on/off and switch the direction of a DC motor.
Pin 9 controls the running direction of the motor while pin 8 turns it on or off.

The basic idea is to use a DPDT (double pole double throw) relay which separates two differently polarized circuits. Without activating the relay, the motor is +/- connected. When voltage is applied to the relay (the switch inside changes its position) the motor gets -/+ connected and runs in the opposite direction.


Oil and measuring matters

Designing the lever or arm pushing the umbrella open or pulling it shut guided us to the field of solid handcraft. Metal bars needed to be cut, bended and drilled. We soon found that accurate measuring simplifies mounting and unmounting of components. But if it comes to grinding metal devices due to not perfectly matching screw holes oil helps you out.

Parallelize your work

As we were a team of three students with a rather challenging project, it was necessary to split the work between each of us. We had to carefully think about which step could be done at what time. Team organization included classifying the steps into mechanic, electronic and informatic work. Thus each of us could work at the same time at a different desktop. For example one team member implemented the clap sensor, while another one was soldering the electrical contacts and the third one designed and cut the materials for the final casing.

Values and potentials

The most apparent use case for our prototype is it being installed as an ambient display.
Using it’s distance and noise sensors, the blowfish reacts to noise by inflating and deflating it’s volume.
Congruent to this use case, it could be employed as a funny danger sign, expressing:

Don’t come too close!
(near a freshly painted wall, a wet floor, a hot surface …)

Next steps

To further increase the social component of the protoype, we plan to implement intermediate steps of inflation. This way, the blowfish can express his mood in a more differentiated way.
These intermediate steps of inflation could also be used to simulate breathing behavior.
This feature would dramatically increase the prototype’s impression of being alive.
Another attachment which will possibly be added to the prototype are movable fins. These would enable further forms of social interaction, for example expressing a ‘greeting gesture’ by shaking the blowfish’s fin.

Video

And finally: A video summing up the development process as well as the final presentation of the blowfish!

Some more photos showing the final installation:

Ambient Stack Machine

Leave a comment

What is it?

Inspired by the Turing machine described by Alan Turing and other simple computational models like the lambda calculus or rewriting logic we’re providing a simple device that explains theoretical computer models to the normal non-geek guy or gal in an easy to understand and visible way.

Final Presentation

Well, at least that was the idea. The real implementation turned out to be painstakingly difficult, so we settled on something more achievable in the given frame of time: A primitive sorting machine that can separate black and white wooden tokens. The idea behind this was to keep the original plan of the computational machine, while simplifying the software and cutting the necessary hardware in half. The machine in its current state can therefore be seen as a proof of concept that could be connected with an identically manufactured copy of itself, requiring only minimal software changes to simulate simple computational models in a physically observable form.

http://www.veoh.com/swf/webplayer/WebPlayer.swf?version=AFrontend.5.7.0.1281&permalinkId=v22903234KGxeGwHy&player=videodetailsembedded&videoAutoPlay=0&id=anonymous
Watch The Ambient Stack Machine in Tech & Gaming  |  View More Free Videos Online at Veoh.com

How does it work?

In our scenario we’re working with black and white mill stones known from the famous mill board game. The mill stones rotate in a carousel and are being sorted out under certain circumstances. Our very first goal was to just sort out the black mill stones and leave the white ones within the cycle. So how did we accomplish our goal and how does the machine work?

First prototype made out of cardboard

First of all we cut a round perspex plate on where the stones can rotate in a cycle. Several layers of perspex plates follow on top of that, each with a different shape to provide borders and sockets for the rest of the machine to build upon. In order to push the mill stones there’s an electric motor (actually extracted from an old printer) in the center of the platform which drives a small gear on the outside of the machine, which then drives a giant gear in the middle of the plate, thereby transforming the motor’s fast but weak spin into a slow but powerful movement. On top of the bigger gear we’ve installed something like a broom that pushes the stones. We would’ve never thougt that this simple mechanism turned out to be the most time consuming part of our project, but compared to the electronics and the software, the mechanical construction took up most of our time.

The motor spins - but waaay to fast...

But once the carousel was up and running, we needed to figure out the sorting algorithm: In order to remove the appropriate stone from the carousel we labeled every token with QR-Bar-Codes. Then we cut an exit at one point of the perspex plate and placed a web cam over this position. Finally we built a little gate and a kick-mechanism to kick the mill stone through the gate out of the cycle.

Example tokens with QR codes

For instance when a black mill stone comes across the web cam reads the QR-Code, the carousel stops and the kick-meachnism kicks the stone through the open gate. Then the gate closes and the carousel starts rotating again. After a few rounds all black stones are removed and just the white ones remain. As a funny feature we installed a push button known from game shows to be able to start and stop our carousel.

Values and Potentials

While the value of separating white and black tokens may seem dubious at first, the prototype in its current incarnation does indeed offer a lot of potential. It has been proved that the hardest part (the mechanics and general construction) can be made to work, which enables further experiments with the software. The separation of the tokens was the only application that could be implemented in the remaining time after construction, but it should be seen as a placeholder rather than as the final destiny. With the QR code camera recognition and the sorting actuators in place, the machine can after all act like any kind of (primitive) computer. It therefore bridges the gap between the rather theoretical, complex underpinnings of modern software and the physical world. A user could place any sequence of tokens in the loop, which represent functions or instructions from the perspective of the computer. These tokens/instructions are then read and processed by the camera – just like in a real personal computer – but the evaluation of these tokens instructions can be witnessed by the user in a way not possible in circuits.

The machine in action

The possible underlying computational models are many: A primitive stack machine makes a lot of sense, where tokens represent instructions and the sequence of tokens is the computer’s stack. Instructions can then be pushed/popped from the stack until evaluation halts. Another possible model would be term rewriting, where tokens represent mathematical functions and for every turn of the machine one expression is reduced. Such a kind of term rewriting could even explain abstract theoretical concepts like the Y combinator in a fashion that is immediately understandable for non-computer scientists. A computation becomes a form of play where the computer can be influenced by the placement of simple tokens and no syntax error is ever possible.

Next Steps

Even though the mechanics of the machine worked good enough for the final presentation, the most important next step would be a refinement of the whole construction. Less tape and more perspex would enable a construction that is much more solid, durable and most importantly reproducible. With two identical copies of the machine, the original plan of a stack machine / rewriting machine could be turned into reality without “faking” the buffer of unused tokens by manually adding and removing them from the loop. A different software behavior could then easily simulate different kinds of computing metaphors simply by changing the program and using different QR codes.

3D mockup of decorative stack machine

The ultimate goal would be to turn the machine into some kind of an “ambient computer”: A stylish object with changing patterns of wooden tokens in the two loops that would constantly “rewrite” these patterns. An observer could then appreciate the whole mechanism simply for its aesthetics without any knowledge of the correspondence to a real computer. Whenever the observer removes or adds tokens, the pattern would change, sometimes coming to a halt (= the evaluation/rewriting has finished), sometimes changing constantly (= an infinite loop/recursion). The possibility to “look behind the aesthetics” always remains, but the user does not have to. The machine would therefore transform the abstract concepts of theoretical computer science into a form of decorative art and close the chasm between these two seemingly unrelated fields.

Video Impressions

Leave a comment

Hey folks,

we’ve been kind of busy the last few days. You know, hacking around, storming the brains out and buying stuff for our projects. But we know it’s cool to look at what we do all day long. So here’s what’s going on:

CUL8A

Follow

Get every new post delivered to your Inbox.