Monthly Archives: March 2014

The Commodore executive mobile phone case.

This article is from retrotext. Click the title to go there.

perfect for my already defunct Nokia.

submit to reddit

Go to Source – retrotext

 


Duran Duran – The Reflex

 


Back to the 80s: Top Songs of the 80s with EYE in the Title + Bonus: 80s Eye Quiz – Kickin' it Old School

Top 10 lists used to be a regular feature here on <em>Kickin' it Old School</em>. <a title="Summary of Old School's Interviews" href="http://OldSchool.tblog.com… more from OldSchool…



A basic Arduino Solar PV Monitor.

This article is from retrotext. Click the title to go there.

submit to reddit

Hi, I have just completed my latest project.
I have just recently had solar pv installed, mainly to future proof my energy costs, I do not expect it to be like drilling for oil in my back garden, however the return looks to be encouraging.

The install gives you another single unit meter, from this you will see the total amount the panels produce, but that is about it.

I wanted to know how much the production was as it was happening, I discovered the light blinks on the front of the meter will flash 1000 times for each kWh of electricity which passes through. The rate of the flashing of the LED tells you how much power is currently passing through the meter.

Being a newbie to Arduino, I knew that this could be done, but did not know how!
After web searching I found many sketches that would have helped me, but they were for Data logging, a step that was too far for me at this time, but I did find the diagram on how to use AnalogRead.

from http://www.retrobunny.org/wp-content/plugins/wp-o-matic/cache/ea9e329ab5_arduino-LDR-photoresistor1-400×344.png

I thought of just a row of LEDs that would illuminate in correlation to the amount of output the LDR was reading, like a VU meter.

So I thought about it another way, what was I doing?  I am measuring a pulse and then stopping the measurement when the pulse occurs again, with those results I could then find stuff out.

My eureka moment was looking on the net again, this time for lap counters and timers! there were plenty and very simple.

The most understandable one I found was Claudiu Cristian’s Speed measurement with arduino with his code I began to set up my circuit and use a flashlight to experiment with some settings, changing when the LDR started to count was first, I n effect I needed to turn the  < and > inside out to count what I needed, as it would measure only when the light was on otherwise.

His sketch uses two LDRs on the premise that a car passes over LDR 1, starts a timer then passes over LDR 2 then grabs the timing and divides it by the distance to calculate speed.

Using the serial monitor and some breadboard I replicated his circuit and changed the code the not calculate distance, but to calculate seconds in one minute (3600) by the time counted.

While working on this code, I was also trying to find out how to reconcile LED output by using conditions so that if I was measuring 3600W I could perhaps illuminate four LEDs or if I was pulling in 1000W two LEDs would be lit and so on.

Meanwhile I posted a topic on the Arduino forum where I found extra insight. My thanks go to Rob Tillaart from the forum for giving me the conceptual code I needed to further the sketch from a lap counter to a meter reader he showed me how the IF statements work in C and work LEDs as a result.

In the mean time I was getting to grips with C and reduced the code to only require one LDR.

I managed to get the new code working the way I had intended, and I even managed to play with other types of output, I used the TV out library to display Watts and time on a standard screen, however the 7″ TFT monitor was not very suitable to use when I wanted to site the completed module so I did not pursue this option.This was a blessing in disguise.

Seeing how easy it was to include a module, I decided to import Liquidcrystal library and after a trip to Rapid electronics, set about improving the meter reader.

The pinouts were straight forward, I found the fact sheets easily on the web, and the Arduino pinout was described in the example sketches in the software.

from http://fritzing.org/projects/thermistor-output-to-lcd

I noted how the threshold on the LDR went from quite high (950) to 11 for the final build, this is because when I had just started with only a LDR connected to the Arduino there was more current as opposed to 4 LEDs or a LCD display plus relevant resistors.
As I had more space to display information, I included a ‘High’est reading readout. It works the same as a hight-score register in a computer game.

When trying this system out, It work nicely however I had to make some extra refinements.
When my meter produces no power, at night the Meter LED is constant, my reader would just read the light and never compete its loop thus shows mega power being produced and messes up my nice display and called a stupid value to the High register, so If I came home in the dark I would never discover what the highest value was in the daytime.
Also if the light is constant for one minute, the display shuts down to increase battery life.

The original idea of two LEDs one operational and one to blink was a drain on a 9V battery, so I omitted the operation light, and left only a blink LED.

Then finally thanks to my Friend, Andy Ward who looked at my hacked up code decided it needed a good tidy up, and thanks to him I am able to give you the final code here.

I used some protoboard to make the build, the soldering was straight forward, although I had to employ some tricks to use both sides of the board, here is the board with the Arduino on one side and the LCD mounted to the front, like one big shield.

This project has taught me loads about C programming, and I am glad that I discovered things for myself so that when help came I knew why and how a solution would work, its tempting to go out and get an off the peg solution, but it’s more satisfying to get the answers for yourself.

/*
RetroText Meter Pulse Reader 
inspired by  a Lap counter Written by Claudiu Cristian from his blog http://kumuya.blogspot.co.uk/2012/02/speed-measurement-with-arduino.html
Thanks to Rob Tilaart for valuable input.
Final Code and rewrite by Andy Ward. 
*/
#include <LiquidCrystal.h>

// Constants
const int mirrorLedPin = 13; // LED pin to mirror the monitored one
const int photocellPin = 0;  //  sensor is connected to a0
const int threshold = 11;    // value below sensors are trigerd

// Global variables
LiquidCrystal lcd(12, 11, 5, 4, 3, 2); // LCD
unsigned long highWatts;               // Highest watts recorded

void setup(void) 
{
  // Set up serial debugging
  Serial.begin(9600);

  // Set up the LCD number of columns and rows: 
  lcd.begin(16, 2);
  
  // Set up indicator LED
  pinMode(mirrorLedPin, OUTPUT);   // Set pin to output
  digitalWrite(mirrorLedPin, LOW); // Switch off
}

void loop(void) 
{
  unsigned long startMillis;
  unsigned long offStartMillis;
  unsigned long curMillis;
  unsigned long elapsedMillis;
  int generating;
  unsigned long watts;
  lcd.display();  //display on

  // Wait for the LED to go off
  startMillis = millis();
  generating = 1;
  while(analogRead(photocellPin) > threshold){
    // LED is still on
    if(generating){
      curMillis = millis();
      elapsedMillis = curMillis – startMillis;
      if(elapsedMillis > (60UL * 1000UL)){
        // Not gone off in 60 seconds Display off
        generating = 0;
        lcd.noDisplay();          // no display after a min
        Serial.println(“NODISP”); // debug
      }
    }
  }

  // LED is now off
  offStartMillis = millis();
  digitalWrite(mirrorLedPin, LOW); // Switch on
  
  // Wait for LED to go on again
  while(analogRead(photocellPin) <= threshold){
    // Do nothing, just wait
  }

  // LED is now on again  
  curMillis = millis();
  digitalWrite(mirrorLedPin, HIGH); // Switch on

  // Display results
  elapsedMillis = curMillis – offStartMillis;
  watts = 36000 / elapsedMillis * 100;   // convert timing to watts
  if(watts > highWatts){ // is watts higher than top reading?
    highWatts = watts;   // remember for next time
  }

  // Output serial debug
  Serial.print(“TIMING: “); 
  Serial.println(elapsedMillis);
  Serial.print(“watts”);
  Serial.println(watts);
  
  // LCD output
  lcd.begin(16, 2);
  lcd.print(“Production Watts”);  // catchy title
  lcd.setCursor(0, 1);            // Cursor
  lcd.print(watts);               // watts output
  lcd.setCursor(6,1);             // cursor
  lcd.print(“High:”);             // top reading
  lcd.print(highWatts);                // high output
}



thanks, as ever for reading!

Go to Source – retrotext

 


Back to the 80s: Interview with Tom Whitlock, co-writer of 'Take My Breath Away' & more – Kickin' it Old School

As I still feel the need to say each time, I am so delighted that interviews continue to be a legitimate part of this little blog of mine! When the opportunity presents itself to ask a few questions t… more from OldSchool…



Do You Remember?

staticI came across this rather nicely put together web page called Do You Remember? the other day that contains a lot of nice 80s (and a few 70s) memories which I think you’ll probably enjoy. Lots of images and info about some classic old TV shows, but the thing that brought back the most memories to me was seeing the static image that appears whilst the page is loading. You don’t tend to see that on TVs any more, they usually detect there’s no signal and show a blank screen instead.



Next page →