Sunday, January 11, 2015

Simple Circuitry Projects: Make a Lightbulb Necklace!

Note: This is a more seasonally appropriate version of my  Holiday Bauble Project - both projects can be made from the same parts, and are put together in a similar way, and are great as a first project for individuals or groups interested in circuitry!




Here's what you'll need: 

1 Miniature Glass Ornament
Some silver ribbon (I used Easter Basket filling)
2 Pieces of Wire
1 Lithium Coin Battery

1 LED

A hot glue gun
A pencil
Some tape (electrical tape works best)
Scissors




How to make your ornament:
Carefully pull the silver top off the glass ornament, then pull the pin out.



Use a pencil to push the silver ribbon into the ornament.
Put a piece of tape on the inside of the silver ornament top so that it covers the two holes. Poke one of the leads of the LED through the tape and through the hole so that the bulb is UNDER the ornament top.



Use the hot glue gun to secure the LED to underside of the lid so that the bulb sticks out by about half an inch. 



Then glue the lid back to the top of the ornament so that the edge of the lid touches the top of the glass neck of the ornament, and wrap both in your choice of duct tape. 




Make sure to test it! If the LED doesn't light, it could mean that you need to wiggle the leads so they aren't touching the lid of the ornament. 



Loop one of the metal ends of the black wire around the shorter lead on the LED, and secure it with hot glue or tape.  Make sure the wire is directly touching the lead! Then, do the same with the red wire on the longer lead.

If you're interested in doing the experiments (which require 2 or more baubles), here are the instructions I'm giving out with the kit below:

PARALLEL AND SERIES CIRCUIT EXPERIMENT




Series circuits are created by wiring all the components of a circuit in a line. The electricity moves straight from one component to the next. They’re useful when you want a circuit to shut down completely if it’s damaged. 

Just connect the wires red to black for series, and make sure the red wire goes to the positive side of  the battery, and the black to the negative. 

What happens when you add more ornaments to the chain? Try touching a paperclip to both leads of an LED in the circuit. What happens? Why is this? 


Parallel Circuits are created when each component gets its energy directly from the same energy source. They’re useful when you want each component to work independently of each other, or if you don’t want damage to one component to affect the others. 

For a Parallel circuit, the black or red wires for each ornament connect with the black or red wire leads of the next LED. The last black wire in the chain goes to the negative side of the battery, the last red wire to the positive. 

What happens when you add more ornaments to this chain? Try touching a paperclip to both leads of an LED in the circuit. What happens? Why is this? 








Finally, to finalize the lightbulb, tape the other end of the red wire to the positive side of the battery, and the black wire to the negative. The LED should light up. If it doesn’t try swapping the wires or moving the LED’s leads. If they’re in contact with the metal of the ornament top, the LED won’t light.

Now you can use your lightbulb as an ornament, a necklace, or whatever strikes your mood! And don't be afraid to personalize it with further decoration.

And if you happen to make one, please, send me a picture at rach.s.thompson@gmail.com. I'd love to see it!

Monday, January 5, 2015

More Web Design: Learning Rails Online

So, if you haven't seen my other post, as a part of the application process for a more advanced Tech Theatre class in 11th grade, I need to have a digital portfolio.*

Now technically I could just have my every project hard-coded into each page using html and CSS, but that sets off every alarm bell I've got. It's just bad code. I don't want to have to type all that out over and over again! It would be much easier if I could create and projects without having to program each one in individually.  So, I visited my good friend Codecademy again to take a crack at one of their newer, longer, tutorials: Ruby on Rails.



* I have since been informed that a powerpoint would have been fine, but where's the fun in that?

I picked Rails over PHP or the other options because I've had more experience coding in Ruby than any other language (except possibly Java, through iTunes U's Stanford CS101 course, but that was a while ago). I wanted at least some sort of base to start from because, and let me make this very clear: I had no clue what I was doing. I'd never done any sort of web applications before. I'd never done any programming projects where I had to juggle multiple files or languages. So I figured if I was going to take my trial by fire, I might as well wear some sturdy shoes.

I installed Rails through Homebrew (a package manager that mimics linux) for my mac. All the files I  created defaulted into Xcode and not Textmate, which surprised me, and then I used Brackets to edit my views and stylesheets.

So like this, but with at least seven more windows open, and a cat lying on the keyboard.


The rails tutorial has a very, VERY slow start, especially if you already know how to code in Ruby. It's essentially a Ruby and a Rails intro all in one, and I couldn't find any way to skip. Prepare to spend a good hour on 'hello world!' type lessons before getting to the good stuff. And the good stuff is good, but I had one major problem through the tutorial - some of the code doesn't translate well to building your own app because it leaves out bits to simplify the tutorial.  Which meant I saw an awful lot of this:

Add your own hair pulling and incomprehensible screeching.

And don't get me started on associations. For the basic structure of my web app, I want each project to belong to a category, and each picture to belong to a project. It turns out that Codecademy's take on explaining how to create these associations... assumes a lot, in the best of cases. In the worst, trying to replicate the code structure just doesn't work because they leave pieces out.

Sometimes though, it's your own fault and you know it.

So, I supplemented my learning with this Rails Guide. The great thing about this guide is that it can act as a sort of cheat sheet. Every time I looked at something in the codecademy tutorial  and had no clue what was going on, I could look back to this page, and find the no-fluff method to getting done what I want to do. In my opinion, it does a much better job of explaining the structure of Rails than Codecademy. But the benefit of Codecademy is being able to type in the code for yourself and see the different files side by side in the simulator. For better or for worse, I really needed both.


Of course, neither of these things stopped me from spending hours on stackoverflow because my CSS wasn't updating as I refreshed the page, or my migration wasn't taking, or every single one of my pictures was apparently owned by every single one of my projects. That's just part of the learning process: you can't really, truly learn a programming language until you start to program something in it.

So now my website is finally coming together functionally!


CSS could still use some work though.

 I've started to look at options for hosting. I'm going to try out Heroku, because it's free to start out, and I've heard good things about it so far. Any thoughts or suggestions? Questions about the tutorials, or where to learn more? Ask away!