July 31, 2014

Temperature Sensor: It Works! Sorta...

Sorry for the delay, orientation at Drexel and work have kept me busy.

I finished up the temperature-sensitive Arduino circuit last week. Each individual component works the way that I wanted it to. The only problem is controlling the temperature to get a good video.

Here's a video. Not the greatest, but it is what it is:


I also started to try out my new BeagleBone Black! Here's one of my first test runs:


Obviously there is much to come from my BeagleBone Black. I hope to set up a web server that can let me control BeagleBone Black pins from web apps! And someday I will probably make serial networks between the BBB, Arduino boards, and maybe even a Raspberry Pi someday!

July 22, 2014

Temperature Sensor Day 2

Today's the second day where I added to my temperature sensor. I didn't do any coding, but I wired the circuit together completely. It was quite a task, as there were many components and scores of wires to connect.

Here's a picture:

I've also been programming for my part-time job, as well as continuing to try the roguelike tutorial I found. All is going well so far.

July 21, 2014

What's That Whirring Noise?

Today I tried out the first portion of my temperature dependent circuit! I tried using a motor with my Arduino for the first time. It's also the first time I've used an external power source in addition to the Arduino's 5V output pin. All went well, no fried circuits!

Here's a video:

I also started a roguelike in Linux today! It's going to take a long time to get visual results, so I will focus mor on my Arduino thermostat!

July 20, 2014

Plans for a Arduino Temperature Sensitive Device

Today I didn't get to do any programming, but I planned out my next Arduino project! It will use an analog temperature sensor. Here is what it will do:

  • An RGB LED will light up blue if the temperature is below room temperature. the LED will light up red if the temperature is above room temperature
  • The current temperature will be displayed on a 4-digit 7-segment display
  • A switch will let the user choose between °F and °C for the display
  • If the temperature goes above 80°F, a button with a built-in LED will start blinking
  • If the button is pressed while the LED is blinking, a motor will turn on.
  • The motor will be have an attachment to make a makeshift fan. The fan will blow on the temperature sensor to try to cool it down
  • Once the temperature reaches 75°F (or some temperature between room temperature and 80°F), the fan will turn off.
Expect to see some demos in the near future as I try out the 7-segment display I soldered, the temperature sensor, and a 6V motor!

July 19, 2014

Lorenz Attractor Finished, What Next?

In the past two weeks, I have been busy with programming. First of all, I managed to find myself a part-time programming job, and secondly, I was working on a serial library for both Arduino and Processing. the Processing half of the library went well, but the C++ version for Arduino was excessively complicated. In the end I decided to put the idea on the backburner and finish up my Lorenz attractor program.

Here is the result:
With the added joystick and potentiometer knob, this controller now controls every aspect of the program in the same way as the keyboard and mouse!

What next? Good question. I really do not know, I have several ideas and new electronics to try. Here is a list of possible ideas:

  • Try more fractals! I have a whole book of fractals to try!
  • Try new electronics parts! I have a temperature sensor, a hall effect sensor, a rotary encoder, a rotary switch, remote controls, even a Wii nunchuck! I have yet to try any of the above!
  • Try new microcontrollers/single board computers! I recently bought a Parallax Propeller Quickstart development board and I ordered a BeagleBone Black to try! Eventually I plan to get a Raspberry Pi to add to the computers I've tried!
  • Try to make a roguelike! Roguelikes are text-based RPG games characterized with random dungeons and permadeath. I've always wanted to try one, and I think I've found a library for making them!
  • Try to make cellular automata! Akin to fractals, they can be anything from cool patterns to falling sand games!
If anyone's reading this and wants to see anything of the above, just let me know in the comments!

July 6, 2014

RGB Rainbow + More

Yesterday, I decided to test out my newly-soldered RGB LED. I made a simple animation that cycles through every possible hue. Here is a video:


Today was a rather slow day compared to last week. I did manage to solder one of my 7-segment displays to a circuit board to make it easier to work with. It is still untested, but here are a couple pics:



Besides this, I mostly did some organization of my code. I'm starting to make a large index of every program of mine that I can find. The goal is to make a well-documented programming portfolio to have for the future.

In terms of the Lorenz attractor, I did get some work done on it. The basic program is functionally complete, though I have much to do to make it better. I will save the video of the program for another day as a surprise!

July 5, 2014

Lorenz Attractor: Dependence on Initial Conditions

Fractals have a heavy dependence on initial conditions. That means that if you change anything about the initial conditions, even something so small as changing the millionth decimal place, the resulting motion will take a completely different path than the original.

Here is a video of the Lorenz attractor with three particles (red, white, and blue). They all appear to start at the same point and take the same path. However, it does not take long before the particles diverge and take completely different paths.


Here's the most surprising bit: The initial positions of the particle differ by 0.0000006 units! that's 6 ten-millionths of a unit! This was the smallest change in position I could use with my program without suffering the effects of rounding error.

To make it more clear that the particles are moving in different paths, here is another video with the lines turned off:

More Arduino Sketches and Fractals!

Progress on my Arduino sketches and the Lorenz attractor fractals has been so good this week, I have two videos I have yet to post and even more to make!

Yesterday, I found some time to do some soldering. The board on the left is an RGB (red/green/blue) LED complete with three resistors. The other board is an adapter for a Wii Nunchuck.
I already started trying out the LED today (video will be posted tomorrow), it works well. The nunchuck adapter I probably will not use for a while, I have other things to try out first. 

Next, we have a test of a numeric keypad that I recently bought. I used two Arduino boards in order to try out serial communication between Arduino boards. The first Arduino determines what button was pressed, assigns it a numeric value, and sends said value over serial connection to the second Arduino. The second Arduino then sets the LED to that brightness level.



I also have another video of my Lorenz attractor program. I will explain more in my next post!

July 4, 2014

Yet Another Cool Thing

Recently I found a library called proTablet, which allows a Processing sketch to read information from a graphics tablet like the Bamboo tablets from Wacom. One of the variables you can read is the pressure of the pen pressing down on the tablet.

I decided to send this value over serial connection to my Arduino board. From there, I sent the value to an analog pin with a jumbo LED attached. The result? An LED that gets brighter the harder you press the pen down on the tablet. Here's a video:


Lorenz Attractors: The Basics

A Lorenz attractor is a chaotic system that simulates a simplified weather pattern. It describes convection currents in a a block of air heated from below and cooled from above. Here is a picture of a Lorenz attractor:



What does it mean to be a "chaotic system?" Put simply, the system must never follow a pattern that repeats, and it must have a strong dependence on the initial conditions. I will explain more about the latter in a future post.

To help explain the fact that chaotic systems follow a non-repeating pattern, watch this video of the above Lorenz attractor as it is drawn on the screen:



The motion appears to be random, for the particle switches between the two sides unpredictably. For most intents and purposes, you could call that "random." However, there is a difference between chaos and true randomness. Chaotic motion, while unpredictable, follows a clear formula. True randomness cannot be described by equations.

July 3, 2014

More Dot Matrix Magic

Today I made two last demos with my dot matrix before I clear my breadboard to try out some new things that I recently ordered!

The first is a simple animation of diagonal lines, made for a friend:


The second is something of my own design to try to use a photoresistor with my Arduino. A photoresistor is a simple type of light sensor. It can detect how much light is falling on the sensor. When the sensor does not detect much brightness, the display shows a green moon. When a light is shone on the sensor, the display switches to a red sun! For a simple sensor demo, this is probably my favorite one so far!

July 2, 2014

Lorenz Attractor Day 1

Today I did some major work on the Lorenz Attractor program. It's far from done, but I was able to draw the fractal on the screen in 3D. Here are a few nice intermediate screenshots:






I finished transcribing the code from the book I have, and then started rewriting it for a number of reasons:
  1. The original code calculated positions component-wise; the code was repeated three times for the x, y, and z direction. In my version of the program, I used vectors which do all three directions at once.
  2. The old code was repeated three times for three different 2D projections of the 3D system. In my program, I drew the curve with 3D graphics, so most of the old code was irrelevant to me. 
  3. The old code had a bad coding style. Numbers were entered into the code directly, which by modern standards is bad coding practice. I am fixing this with named variables and constants in my program.
I realize that these problems are due to the book being about 25 years old. It's an interesting programming challenge to update the code to modern standards.

Tomorrow I will discuss the Lorentz Attractor in more detail to explain what this fancy chaos really means!

Today I also got another order of electronics parts. I ran a test of one of two infrared (IR) sensors to see how they work. Here are the results:
Eventually I will use the sensor in tandem with my Arduino board. However, I have a few last tricks up my sleeve for my dot matrix! Stay tuned!

July 1, 2014

Digital Fire

Today I managed to plan out my digital fire program, and it works really nicely! Here's a screenshot...


...and a video:

I did not get much work done on the Lorenz Attractor, the code is a little out-of-date so it's harder to interpret. It's also funny how bad the author was at making readable code. I'm not even a professional programmer and I could have made the code neater and a bit more efficient.