Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

Lighting the stairs using a Netduino and a TLC5940


  • Please log in to reply
4 replies to this topic

#1 CharlesTucker

CharlesTucker

    Member

  • Members
  • PipPip
  • 19 posts

Posted 06 October 2012 - 02:40 PM

Hi all,

Last week I was chatting with Nevyn/Mark in the chatroom and thanked him for sharing his experience with the TLC5940, a 16 channel PWM driver, with the world. Obviously he wanted to know what I was doing with it, so here it is. The idea is to make a sort of dynamic LED lighting for the stairs. Underneath each step will be a part of a LED strip (white), a detector at the bottom and a detector at the top. If somebody approaches the stairs, the steps should be lighted, one by one. I need the TLC5940 because it is 16 steps, and I don't want the LED's to be just on/off, but I want them to fade in/out. I hope this idea is clear. If not, there are quite a number of examples on youtube.

What I have done so far is get the TLC5940 to work, thanks to Nevyn's blog. I did make some changes though. If you modify the PWM duty cycle linearly, the perception of the brighness of the fading light is far from linear. You could use another function to accomplish an apparent linear brightness, but I choose to make a lookup table, with 64 steps. This allows for easy tuning, in case I am not satisfied with the linearity of the brightness. My daughter made a little movie of the result so far, which can be found here:

Next things to do:

  • Code cleaning, it currently is a mess (although it works as intended)
  • Create the rest of the logic, that handles a multitude of options properly, like what happens when somebody goes downstairs, while another person is already on the way up.
  • Connect more LED's to each output
  • Get rid of the crystal timing circuit, to reduce the part count. There is a thread on this forum explaining that this is possible, and replace the timing circuit with output from one of the Netduinos PWM pins.
  • Select, acquire and implement actual actuators. I still need to decide what is best. Could be movement detectors, proximity detectors, pressure sensors on the steps, I still have to think this through
  • Install the whole thing on the actual stairs in our new house

I will be reporting progress here, but thanks to all kind of other stuff that keeps me busy (like work), it all will take a while.

Best regards, Peter

#2 Mario Vernari

Mario Vernari

    Advanced Member

  • Members
  • PipPipPip
  • 1768 posts
  • LocationVenezia, Italia

Posted 06 October 2012 - 03:06 PM

The idea is very nice, and I wonder if you'll able to install somewhere. Time ago, I thought something similar for the stairs in my condo, in order to save the lights energy. A people getting out its door presses the stairlight button closer. At this point only a small number of lamps should turn on. That people has three choices: get the elevator, walk upstairs, or downstairs. The people choice might be revealed through IR-sensors or else. Anyway, the stairlights should "follow" the people route. In my mind, the cost of that circuit should have to be much lower than the cost of the energy wasted on lighting 20 lamps uselessly. Peter, go ahead: you have all my support! Cheers
Biggest fault of Netduino? It runs by electricity.

#3 Joshk

Joshk

    Advanced Member

  • Members
  • PipPipPip
  • 72 posts

Posted 06 October 2012 - 05:25 PM

Sounds like a cool project. If you want more than 64 steps you can copy your table into Excel, easily make a graph of it, then righ-click the curve and do a "curve fit". This will tell you the equation that best fits your data. Then you can code the equation into the project for perfect fade control instead of steps.

#4 Nevyn

Nevyn

    Advanced Member

  • Members
  • PipPipPip
  • 1072 posts
  • LocationNorth Yorkshire, UK

Posted 07 October 2012 - 07:34 AM

My daughter made a little movie of the result so far, which can be found here: http://www.youtube.c...h?v=4Mvf8HGYedI

Big thumbs up - that looks to be an interesting project in the making. I'm looking forward to seeing how this progresses.

Regards,
Mark

To be or not to be = 0xFF

 

Blogging about Netduino, .NET, STM8S and STM32 and generally waffling on about life

Follow @nevynuk on Twitter


#5 CharlesTucker

CharlesTucker

    Member

  • Members
  • PipPip
  • 19 posts

Posted 10 October 2012 - 05:16 AM

Hi guys, thanks for the positive response. As I predicted, I did not get to spend much time on the project. So far there is no visual progress, so no new movie. Yesterday I did some rethinking on the "architecture" of the software, and made some significant changes. Originally I had planned routines that would "fade in" upwards, "fade out" upwards, fade in downwards and fade out downwards. This idea was flawed, as it would complicate things a lot when several people would be accessing the stairs while a routine would be running already, especially if they would come from different directions. So I replaced this idea with one "update" routine, which can have several states. I believe this will make it much easier to deal with such situations. So far the "going up" routine, as shown in the movie, is working again in this new architecture. I also included a timer, to trigger switching off again after a certain period of inactivity. After a discussion with a colleague, I acquired 2 ULN2803A Darlington transistor arrays, which should be able to drive the ledstrips under the stairs. Each chip contains 8 npn Darlington pairs, so the two chips is exactly enough to drive the stips for 16 steps. Best regards, Peter




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.