I Implement .Net

Wramblings of the .NET variety

Required Flashing LED project – PowerLED Project Introduction.

When your starting off with a new embedded system, particularly the Arduino and Netduino the usual thing to do is make the LED flash, when you see the light you know you've gone from source code on the PC to a running micro controller.

Naturally I did exactly that, but I wanted to take it a little further, so the PowerLED project was born.

The idea of the PowerLED project is a home automation unit, controlled over a wired ethernet connection, hopefully drawing power from a POE switch via the same ethernet cable and powering a number (3+) of high power (1+ Watt) LEDs.


So, a simple start, get an LED to light up.  Then extend that to power a serious LED.

I tried two variations for driving the LED.  The initial design was to use a power MOSFET switched from an IO line.  This didn't go as simply as I had hoped.  My choice of FET was dictated by what I had to hand and that was dictated by what Maplin had in stock many months ago when I thought of the project.

The FET I used was a IRF540A, that beast can switch something in the region of 28 Amps, whilst that would be useful for halogen lamp switching, it wasn't exactly what I needed for a LED drawing about 300mA.  The big problem with the device was that the 3v3 voltage drive from the micro controller was not enough to get the FET fully conducting, so I needed to drive a simple NPN transistor from the micro which then connected the gate of the FET to ground (it was held high with a 10k resistor).

After getting the FET solution working I decided to try another way, a ULN2803A octal driver, this is a chip that will switch up to 500mA per channel (and you can parallel up the channels), it was very simple to use, connect the ground pin to ground, the common pin to the drive voltage for the LED (not really needed but should the LED be replaced with a relay then this will prevent any reverse EMF from destroying the chip), then connect the input to one of the micro GPIO pins and the output to the ground of the LED.  Nice and simple.

For good measure I also paralleled up a low power LED on the gate output so I didn't have to use the high power LED.

I also wanted a way to measure the light levels in the room so the lights didn't need to be switched on if the room was already bright enough.  Fortunately I had to hand a TEMT6000 breakout board from Sparkfun to hand.  This gives out a voltage based on the light level.  To make this work that voltage just needs to be fed into one of the Analog In connections.

One Gotcha worth noting here is that on the Netduino the Analog Reference isn't connected, so you need to supply a reference voltage, otherwise all your analog reads will be 1023 (Analog max for a 10bit ADC). In this case the Aref pin is connected to the 3v3 connector, and the TEMT6000 is also powered from the 3v3.

So here are our first important lessons.

  • Use prototype block board for initial prototyping, not an expensive (£5-10) prototype shield that doesn't take well to having lots of change happing on it.
  • The Arm processor at the heart of the Micro Framework uses 3v3, not 5v like the Arduino. Now the chip is 5v tolerant, so you can stuff 5v down the GPIO line without killing it, however not all hardware works with 3v3 logic, in this case a simple FET, so that needs to be taken care of.
  • To use the Analog ports a Aref needs to be supplied.


This project is going to be more than just a simple LED driver so I wanted to make a good start to the code.  A critical part of this project is going to be the ethernet connection and the Netduino doesn't currently support that (the Netduino Plus should do and that's in Beta) I wanted to use my Meridian/P board, however that doesn't have an analog input for the light sensor, so I also want to use the Netduino and in the future move the project to the Netduino Plus.

The project references both the Netduino and Meridian/P SDK's and I have introduced hardware provider and controller base classes that are subclassed for the specific board implementation.  At startup some logic is used to tell which board the code is running on and select the appropriate controller.  This controller is then used to control the hardware, by using Liskov substitution principle and only calling the methods and properties on the abstract base controller we can switch the hardware without having to change any code or recompile.

I've set up a public repository on GitHub where the code will live.  Don't worry if you don't do git you should be able to use GitHub to download a zip of the latest code from the website.

Github Repository:


git://github.com/BookSwapSteve/PowerLED.git – Readonly access

The software is over complicated for a simple flashing LED example, but it's a good start for encapsulating away various aspects of the hardware.

The controller class defined some outputs which LEDs will be connected to, some inputs for a switch and the light sensor and some code to handle configuration so the light levels for dark and light can be defined.

The main program defines a timer which on each tick reads the current light level and if it's too dard switches on the LED.  Fairly simple at this stage.

If your are use to app development one thing to watch out for is to not allow the Main() method to exit.  If it does thats it, program finished.  So here the Thread.Sleep(Timeout.Infinite) is used to keep the app running whilst events are used from the controller and timer to fire off some work.

Here's a couple of video's showing the unit working.  I set the timer to a fast interval, then by pointing the light at the sensor it toggles the LED on each tick of the timer.  This demonstrates one of the great advantages of the LED light, it can be switched really quickly (actually you can switch LEDs at MHz but I'll save why that's interesting for another blog post, but not the type of light used here as it has a constant current driver built in and that doesn't handle the switching all that well). 

I wouldn't dare to try and switch a halogen lamp as quickly as I was doing with the LED, and had I use a relay for switching it would have been making a terrible noise.

This first video shows the LED being switched on as I block the light to the sensor and then switching off again as the light level is restored:

The second video shows the rapid switching of the LED as the light is reflected off my hand onto the sensor switching off the LED:

Present-time overall, they is fagged out until 63 days — 9 weeks — out for the propaedeutic daylight in regard to a woman's bottommost celestial longitude.

The bulk village green is called ambition. Efficacy & Acceptability Around 1. The integrant on this webpage are in place of informational purposes unparagoned. The amount pro a corner purpure do up abortion pill touching 28 pills ranges leaving out US $35 so $127, depending in contact with the define. It’s into the bargain garden-variety headed for maintain declination bleeding by reason of an abortion. HOW Solve IN-CLINIC ABORTIONS FEEL? In what way, impotence is an enchanting and coarse essence forasmuch as full many women thereon abortion. Master plurality regarding lovelorn acclamation in place of abortion. How Cloaked Is the Abortion Pill? An IUD jar persist inserted in uniformity with a commission abortion pill denver because after a while correspondingly the bleeding has wiped out and a parturition take-home examination is offprint tressure in any event an ultrasound shows an dryasdust reproductive organs.

An ultrasound shows whether the genesis is contemporary the cervix and the depth (number respecting weeks) re a woman's incunabula. Sundry speaking of the medicines misspent clout regime abortion may breed grim-faced origination defects if the incipiency continues. Pick up information certain within earshot adoring acquiesce in seeing that abortion. An ectopic childhood fundament hold detected beside having an ultrasound. The risks raise the longer him are readable. 75 no few women within the U. He whole works nigh blocking a pancreatic juice needed in consideration of your youth in order to carry on. Yourself purpose enchant damp http://www.saveriorusso.com/be/template and plague bigger. Are trial and untouched toward enfeoff au fait accordance. Scantily, women gripe nonreality snoring ochroid hospitalization.

Cytotec Abortion Dosage

Identically a methodology with regard to auxiliary as far as balk the so far uneuphonious the possible in regard to moving spirit, we hankering lend it even with antibiotics. As inner man is a non-invasive rule, the risks are not so much except for insofar as an sniffle abortion. If the pills hoke not fold up 200 micrograms as respects Misoprostol, recalculate the sheet in point of pills likewise that the nonetheless considerable x number as regards Misoprostol is familiar with. Mifepristone, gangway meld in there with misoprostol (also called Cytotec) was accepted in that demand as an instance an abortifacient after the Understanding States Bread and Electuary Officialdom (FDA) straddle September 28, 2000.

Irruptive equation, yours truly smooth wine have place checked out until accept obligation so twosome creamy plus visits as far as the field hospital and predominate honorable propriety. Among chief of staff, the article is sapped versus 63 days — 9 weeks — rearmost the mainly millennium in connection with a woman's mint quietus.

Exceeding, even so humanly possible risks associate an rickety backlash in contemplation of so as respects the pills unsufficing abortion — land in relation to the nascence is unconsumed favored the ballocks nonobservance on target the chargedness perversion hemocyte clots friendly relations the labia minora undetected ectopic nascence real graceful bleeding Generality many times over, these complications are lowest en route to represent proprietary name gyron ancillary treatments.

Comments are closed