House of Hacks: LED
Showing posts with label LED. Show all posts
Showing posts with label LED. Show all posts

Friday, June 12, 2020

How to make a binary clock: design

Description

Want to make an Arduino project a bit more complicated than blink? In today's episode of House of Hacks, Harley starts a project on how to make a binary clock. This project will use an Arduino and be presented in multiple parts. Today, the first part will be the overall requirements and design. In future videos, the software, circuit and finishing it off with an enclosure will be covered.

Resources

  • All the information to make this project: https://www.house-of-hacks.com/p/arduino-project-binary-clock.html
  • If you just want to buy one: https://amzn.to/3eGXFVD (Amazon affiliate link)
  • Get a digital version of the new Arduino poster by signing up for the House of Hacks newsletter: https://list-optin.house-of-hacks.com/arduino
  • Or a printed copy of the poster can be bought on the House of Hacks store: http://store.house-of-hacks.com

Contents

  • 0:00 Project introduction
  • 0:59 Welcome and about House of Hacks
  • 1:19 Description of BCD
  • 2:14 BCD for binary clocks
  • 3:05 Project requirements
  • 4:02 Controlling the LEDs
  • 5:45 Tracking the time
  • 6:18 Adjusting the time
  • 7:23 Arduino selection

About

Here at House of Hacks we do tutorials, project overviews, tool reviews and more related to making things around the home and shop. Generally this involves wood and metal working, electronics, photography and other similar things. If this sounds interesting to you, you may subscribe here.

If you’re interested in learning more about the House of Hacks' values, here’s a playlist for you.

And here’s the most recent video.

For a written transcript, go to How to make a binary clock

Here's a list of the tools I use.

Music under Creative Commons License By Attribution 4.0 by Kevin MacLeod at http://incompetech.com.
Intro/Exit: "Hot Swing"

Transcript

A number of years ago, at a software conference, one of the evening activities as an outing to a hands-on science museum.

While there, I noticed and picked up this binary clock.

It uses something called BCD encoding and I thought it'd be kind of cool to make my own version of this as a project.

Technically, it could be done with some simple logic circuits and a timer.

But this would involve more hardware design and wiring than I wanted to be involved with and so I'm going to go the easy route and use an Arduino.

This is going to be done in four parts.

Part one today is the basic requirements and design.

Than as I'm waiting for parts to come in, I'll go over the software design and how to actually do some testing without having a complete circuit finished.

The third video I'll assemble all the circuits and get it running.

And then the fourth video will be creating an enclosure for it.

Welcome to the House of Hacks. If we’re just meeting, I’m Harley and I make stuff out a variety of materials.

For example, in this project, we're doing design discussions, and software and electronics and mixed media for the enclosure.

If making a things out of a variety of materials in the workshop is something that's your thing, consider subscribing and you won’t miss future episodes.

BCD is an acronym for Binary Coded Decimal and this was an encoding system that IBM came up with nearly a 100 years ago in the 1920s for use in their early mechanical devices.

As early computers came on the scene, they took this basic coding that they used and expanded upon it to use in the computers.

It was called EBCDIC at the time and was actually used until relatively recently.

Interestingly, early in my career, I had to write an ASCII to EBCDIC conversion routine for use by our business partners.

Before going to the whiteboard, a couple notes.

First, the code and schematics for this project, is available for free download off of GitHub.

And second, a commercial version of this clock, kind of like the one that I picked up at the conference, as well as all the materials I'm using in the project are available on Amazon. I’ll leave links for everything down in the description below.

In BCD, each column represents a decimal digit, coded in binary. The first column is the tens digit for the hours, the second is the units column for the hours. Next, we have the tens and units digits for the minutes and the tens and units digits for the seconds.

In decimal, we need four bits to cover the all digits 0-9 in binary. So all the units columns on the LEDs have four LEDs. Because on a clock, none of the tens digits go all the way to 9, we don’t need a full 4 bits for each of the tens columns. Hours for example only go to 2, so we only need 2 bits for a 24 hour clock. The minutes and seconds only go to five so we only need three bits for those.

So, to make this, what are our requirements?

For the LEDs, we have 3 groups of 4 and 2 groups of 3 for a total of 18 and another 2 for a total of 20 LEDs that we need to control.

Second, we need a way of keeping track of the time.

Third, we need a way to set the time.

I’ll talk about all these requirements in detail but first I’m excited to announce that I’m working on some Arduino training materials. I have an Arduino reference poster available now and am working on a book for people new to digital electronics and programming the Arduino. A digital version of the poster is available by just signing up to the House of Hacks mailing list where I’ll keep you updated on things happening here. I won’t bombard your email with a bunch of stuff. Just occasional updates when products are released and an occasional news item that I think you might find interesting related to making things. If you’re interested in this, there’s a link below in the description below.

Now, back to the design...

Looking at controlling the LEDs, my first inclination was to think about this as a single string of 20 bits where each digit in each group was put inline with the rest of the bits. The common way of working with large numbers of LEDs is to use a '595 based shift register. This only requires three pins on the Arduino but provides a number of digital outputs. This is so commonly used that there’s a shiftOut command built into the Arduino ecosystem. ‘595 chips typically only work with 8 bits (although there are variants that have more bits) but they can be daisy chained together so you can have an almost arbitrary number of digital outputs, all controlled by only three pins.

Since there’s 20 bits needed and each ‘595 provides 8 bits, I thought about using three shift registers, daisy chained together. This would give 8 times 3, or 24, bits. The first 20 bits would be used and the last 4 bits would be ignored.

I coded up a prototype sketch using this idea but it ended up being more messy than I really liked. All the code was one big blob with a bunch of dependencies spread throughout the whole thing. Some of that mess could be cleaned up with some refactoring, but it was still going to be more messy than I really liked.

Upon reflection, I realized each group of two numbers only needs at most 7 bits and I have three groups. For the purposes of this project, I could still use the three ‘595s but instead of daisy chaining them together, I could connect each one to the Arduino directly. This would help make the code cleaner. Each ‘595 needs three pins, so that’d be a total of 9 pins for the LEDs instead of 3. Let’s look at the rest of the requirements and see if there are enough pins.

To track time, the most reliable would be to use a clock module. A real time clock module, also called an RTC, is designed to interface with micro controllers and has it’s own battery backup. There are a number of different models. I selected to use a DS1307 because they can be had inexpensively and communicate with the Arduino using only three pins over the I2C bus.

It would also be possible to use the Arduino itself to track the time although I’m not to sure how accurate that would be. It would provide a software only solution though.

Finally, we need a way to set the time.

The commercial unit I have uses two buttons. One increases the hour each time it’s pressed. The other increases the minute each time it’s pressed and if they’re both pressed at the same time, the seconds are increased.

This could work, but I don’t have any good buttons that’d be appropriate for mounting in an enclosure and, in my spare parts bin, I have a rotary encoder.

Rotary encoders come in different styles. This particular one allows the user to spin it in either direction without any limits. It can also be pressed to indicate an event. The micro controller can detect which direction it’s turned and take appropriate action.

I think this would be easier to make accessible to the user in the enclosure, so I’m going to use it. It uses two pins to the Arduino to communicate the rotary action and one pin to communicate being pressed.

So, all in all, I’m looking at using 9 pins for the three ‘595s, 2 pins for the clock module and 3 pins for the rotary encoder. A total of 14 pins.

Since I want to keep this pretty compact, I’m going to select the Arduino Micro. It’s only about 2 inches long and about 3/4 inch wide and designed to go in breadboards and pre-made circuit boards with standard hole spacing. And it has 18 digital I/O pins. Four more than then 14 that we need.

I think it should work well.

So, I’ll go order the parts and, while waiting for them, I'll show you the software in this video.

If that video hasn’t been released yet, I’ll see you in this other video where I do an Arduino project simulating wind to make wind chimes sound indoors.

After watching that, go make something.

Perfection isn't required. Fun is!

Friday, September 13, 2019

Lights For Sewing Room - Get a Massive Improvement


Description

Wondering about installing lights for sewing room? Is your craft room lighting in need of an upgrade? In this episode of House of Hacks, Harley shows how to upgrade sewing room lights for a massive improvement. Adding several LED lights in room improved the overall usefulness of the sewing space and for craft work.

Check out Diane's channel Delightful Light: https://www.youtube.com/channel/UCqeC5EK8VMuFCK5t268H4eA/videos

Here at House of Hacks we do tutorials, project overviews, tool reviews and more related to making things around the home and shop. Generally this involves wood and metal working, electronics, photography and other similar things. If this sounds interesting to you, you may subscribe here.

If you’re interested in learning more about the House of Hacks' values, here’s a playlist for you.

And here’s the most recent video.

For a written transcript, go to How to start a muscle car that has been sitting - 1965 Buick Skylark - Part II

Music under Creative Commons License By Attribution 3.0 by Kevin MacLeod at http://incompetech.com.
Intro/Exit: "Hot Swing"
Incidental: "Mining by Moonlight," "Motivator," "Rocket," "Chipper"

Transcript

Coming soon...

Saturday, September 16, 2017

How to convert fluorescent tubes to LEDs using ballast bypass (Part 2)


Description

Want to see how to convert fluorescent tubes to LEDs while bypassing the ballast? In a previous video, Harley showed a very easy but expensive way to convert fluorescent tubes to LED tubes. In this video, Harley shows a more involved, but typically less expensive, way to convert a fluorescent fixture to use LEDs involving a ballast bypass.

Ballast bypass, also called direct wired, involves removing the ballast and using LED tubes that run off of line voltage rather than the high-voltage from the ballast. Typically these bulbs are less expensive because they don’t have to deal with the higher voltage used by fluorescent tubes. This video gives instructions for how to wire the fixture to use these bulbs and provides a wiring diagram.

Convert fluorescent tubes to LEDs with the ballast (Part 1)

Subscribe for more DIY videos.

Watch my most recent video.

For a written transcript, go to How to convert fluorescent tubes to LEDs using ballast bypass (Part 2)

Music under Creative Commons License By Attribution 3.0.
Intro/Exit: "Hot Swing" by Kevin MacLeod at http://incompetech.com
Incidental: "Acid Trumpet" by Kevin MacLeod at http://incompetech.com

Transcript

Today at the House of Hacks, we're going to go from this to this.

[Intro]

Hi Makers, Builders and Do-it-yourselfers.

Harley here.

In a previous video, I explained how to convert 8' long fluorescent fixtures from fluorescent tubes to LED lights in a very quick and easy way.

However, this way was pretty expensive. It involved just getting some ready-made 8' LED lights and those things are really pricey. For some reason, the 8' LED tube replacements are a whole lot more expensive than 2 4' LED replacement tubes. The 8' tube replacement are $60 each whereas I picked up a 4 pack of 4' ones for $24. I have no idea why. And they've been this way for quite a while. I picked up two pair last year I think it was, and they were $60 and I just picked up two pair yesterday and they're still $60. Same price. It hasn't moved at all. And it's pretty much the same price whether you buy it online or retail like I did. There's usually a few dollars off buying online but of course you have shipping and handling costs added to it so it ends up being a wash.

It's a real quick way to do it because you don't need to replace ballast, you don't need to rewire anything, you just plug them in in replacement of the existing bulbs. So, it's really quick. It's more expensive getting the bulbs that are designed for ballast.

However, in the 4' market you can buy tubes that work either with ballast or without ballast. And I have a fixture that needs some work on it. The ballast is making noise and the tubes are flickering and so I wanted to replace them with LEDs.

But because the ballast is making noise, I want to do a ballast bypass and remove the ballast altogether. And so I'm going to be demonstrating that in today's video. It is a little bit more work because you have to take the ballast out and rewire things a little bit, but it's not a whole lot more work and you do remove one more component that could possibly fail on you. So let's get started.

First remove the old bulbs.
It'd probably be a good idea to turn off the power before doing this.
Yeah, do as I say, not as I do.

Now take the fixture down. This will vary depending on how it's installed.
In my case, it's just sitting between the joists on some 2x4s.

Next disconnect the mains power.
Be sure to have the power turned off.
You don't want to be working with live power at this point.

On the bench, the fixture needs to be opened up.
This will vary depending on the type of lamp you have.
In my case, it's just a matter of removing two nuts.

And then the case just opens up.

Here we see where the sockets are connected to the ballast.
Since we're removing the ballast, all these connectors get taken apart.
We need to do this on both sides of the fixture.

And we need to remove the mains wire from the ballast input.

Once all the electrial connections are separated, we can physically remove the ballast.
In this case, there are two screws with nuts on them.
Other designs may have a single sheet metal screw on one side and a slot on the other.

Now we need a short piece of wire to run from the center where the mains are connected to one end of the fixture.
I'm using some scrap 14/2 TPS cable I had in the parts bin.
If you have to buy some, 3 feet should be plenty.

Now I prepare all the ends by stripping off about 3/4" of insulation from each wire and twisting the strands so they don't fray as easily.

I also strip the insulation from the 14/2 cable.

Now comes the most technical part of this project.
Here we see each socket has two wires coming out of it.
On one end of the fixture, we want to connect one wire from each socket to the white wire and the other one to the black wire.

It's probably easiest to see this in a pictoral diagram.
Hit pause on the video if you need to study this.

Because I have four sockets on this fixture, I used some pigtails to keep from having a huge number of wires all in one wire nut.
When it's all put together, it looks like this.

The sockets on the other end of the fixture don't need any connection.
I just put wire nuts over the ends of the wires to keep them from potentially shorting anything out.
And then zip tied them together to keep them neat and tidy.

Finally I stripped the insulation back from the other end of the 14/2 cable.

We can see here, I'm not using the copper ground from the new cable, but the existing ground that goes to the fixture.

And now it's a matter of reassembling the fixture.

And reconnecting the mains.
Again, make sure the power is off before doing this!

Reinstall the fixture.
In my case it's just a matter of dropping it back into place between the joists.

Finally, install the bulbs.
These particular bulbs have only one end that connects to the sockets with power, so if they don't work the first time, turn the bulbs around end for end.

Turn on the power and enjoy your new lights!

So give me a thumbs up if you found that helpful. I really appreciate it.

And I really thank you for joining me on this continuing creative journey that we're on.

Until next time, go make something.

Perfection's not required.

Fun is!

Friday, February 26, 2016

How to measure fluorescent and LED light flicker


Description

Fluorescent tubes flicker because of their inherent design. LED lights may or may not flicker depending on how well their power supply is designed. How do you measure the amount of flicker? In this episode, we quantify the flicker in the fluorescent tubes and after an LED light conversion.

How to easily convert fluorescent tubes to LEDs: https://www.youtube.com/watch?v=_YROz2AekkA
Electronupdate video: Measuring Light Bulb Flicker with Nothing More Than a Cell Phone: https://www.youtube.com/watch?v=Qym5-126BDY

For a written transcript, go to How to measure fluorescent and LED light flicker

Music under Creative Commons License By Attribution 3.0.
Intro/Exit: "Hot Swing" by Kevin MacLeod at http://incompetech.com

Transcript

After seeing last week's episode about converting fluorescent lights to LEDs, David Terry asked "do they flicker the same way fluorescent tubes do?” I wasn’t sure, so let's measure and find out, today at the House of Hacks.

[Music]

Hi Makers, Builders and Do-it-yourselfers. Harley here.

Fluorescent tubes are powered by AC current and flicker based on the speed of the power cycles. Here in the United States, our power cycles at 60 hertz. This means the hot lead varies between positive voltage and negative voltage 60 times a second. The tubes don’t really care about positive or negative values, just the absolute value and so will flicker at twice that rate, or 120 times a second.

This is too fast to bother most people, but a non-trivial segment of the population are affected by this and have problems working under fluorescent lights. The flicker can also cause artifacts when shooting video at certain frame rates. And, as the bulbs age, they may not go on and off at every cycle, causing the flicker to slow down and become more noticeable.

To measure the flicker, I've got this simple setup. I have just a solar cell and the oscilloscope. The flicker in the lights will cause the output of the solar cell to oscillate in sync and the scope allows us to see that variation. At 120 times a second, we expect to see each cycle to be around 8 milliseconds so I have the scope set to 10 ms per division.

Now I'm going to connect the scope to the scope to the solar panel. And we’ll see what we have here… and that's exactly what we expect to see; each cycle is about 8 milliseconds.

So now I'll go over into the room other room and check it out with the LEDs.

I still have exactly the same setup as I had before. Let’s connect the scope to the solar panel and see what we get.

Ah, a straight line. So, to answer David’s question: no, there is no flicker with these LEDs. Thanks David for asking the question.

And coincidentally, a couple days ago an electronics channel I subscribe to, electronupdate, uploaded a video showing how you can use a cell phone to detect this flicker. I thought you might find that interesting.

If this is your first time here at House of Hacks: Welcome, I’m glad you’re here. We’d love to have you subscribe. Through this channel I hope to inspire, educate and inform makers in their creative endeavors. Usually this involves various physical media like wood, metal, electronics, photographs and other similar types of materials. If this sounds interesting to you, go ahead and subscribe and I’ll see you again in the next video.

Thanks for joining me on our creative journey. Now, go make something. It doesn’t have to be perfect, just have fun!

Friday, February 19, 2016

How to easily convert fluorescent tubes to LEDs


Description

There are several ways to convert a fluorescent tube fixture to using LED lights. In this episode, Harley shows the fastest, easiest, but most expensive option to retrofit T8 and T12 fluorescent lights to LEDs. At the end, measurements are taken of the light output to see the effect of the new lights.

How to count in binary: https://www.youtube.com/watch?v=ZCFcuVHB1sI

For a written transcript, go to How to easily convert fluorescent tubes to LEDs

Music under Creative Commons License By Attribution 3.0.
Intro/Exit: "Hot Swing" by Kevin MacLeod at http://incompetech.com

Transcript

Today at the House of Hacks we’re going to go from this to this. Oh, yeah!

Hi Makers, Builders and Do-it-yourselfers. Harley here.

The general illumination in my shop is all fluorescent lights and for quite some time now I’ve been wanting to upgrade them to LEDs. Recently I’ve had two bulbs that were kind of on the way of going out and today they just didn’t come on at all. So I went down to the home store and decided to bite the bullet and convert a couple of my fixtures, two of the fixtures, a total of four bulbs, from fluorescent to LED.

In all my investigation I’ve found that there are kind of three principal ways of doing this conversion: the first is very quick, very easy and expensive, the second is less expensive and also a little bit more work, and the third way is the most amount of work but also the least expensive. So, today, because of time pressure, I decided to go, on these, with the first option of the most expensive but the fastest and easiest to do.

For cost comparison, these bulbs are $60 apiece and I have four bulbs to replace. So that means the total cost on this conversion today was $240. Now to put it in perspective, I think I paid $200 for the whole fixtures originally, including fluorescent tubes. So it is quite a bit more expensive but now I have LED lighting with all the benefits thereof.

Today I want to look at what it takes to install them and what the difference is in the light output. So let’s get to it.

These come in four foot long packages. There’s two tubes that snap together to make an eight foot section. They’re made by Feit Electric, Feit electric, I don’t know how you really pronounce that. They replace both T8 and T12 bulbs and the advantage of these is they work off the ballast voltages so you have to do is take out the old bulb and replace it with the new one after you put everything together and unpackaged it.

It says it’s rated for up to 50,000 hours of life. We’ll see how that actually works itself out. It uses 44 watts and has a color temperature of 4100 Kelvin. So it’s sort of in the middle of the color temperature range.

Here we have one set of ends as packed. A cap is over one piece for shipping to cover the open middle where the two pieces will be joined together. It can be removed and discarded. And the other end contains the power pin that will connect to the light fixture.

Here’s the other set of ends. One end has a clear plastic piece over it that contains a magnet. This will stabilize the center of the light. Remove it for now and set it aside. This is the other pin that will connect to the light fixture. The other piece has a connector with two spring loaded pins. Pull this out until the pin locks into place.

Now slide the clear plastic support over the end without the connector but don’t cover the small hole for the locking pin. Slide the two pieces together until the pin locks into place. Finally slide the plastic piece over the joint to help support the connection.

We can see half the tube is aluminum extrusion to provide support and heat dissipation. The other half has a curved frosted diffuser.

Installation is just like a normal fluorescent tube. Once both ends are in place, push the middle up so the magnet sticks to the fixture for support.

And that’s really all there is to it. Snap the two pieces together, take out the old bulbs and put in the new bulbs. Short. Sweet. Simple.

I really like it. It seems to work out really well.

Now let’s go take a look at what the actual light output is.

The measurement of tubes is on the left and the LEDs on the right. There is 1 EV difference between the two. In photographic terms this is one stop, or twice the amount of light out of the LEDs.

So you can see, the light output from these is quite a bit more. It’ll be nice having consistent color temperature across all my bulbs too. Working in the shop should be much more pleasant for me.

If this is your first time here: Welcome! We're glad you’re here. All my videos have to do with maker related types of topics: woodworking, metal working, shop projects in general, kind of like this. If that kind of thing sounds interesting to you, go ahead and subscribe. We’d love to see you again in the next video.

Now, go make something. It doesn’t have to be perfect, just have fun!