Radio Networks
I had a really interesting conversation this evening with a pal who’s into electronics as much as me. I’ve been messing around with low-cost radio “mesh” networks which essentially give me the ability to read data and control outputs around the house wirelessly…
For some time now, ever since the oil company tried to give us a mobile phone based oil sensor at which point I had to tell them they’d just screwed up for half of the UKs rural community for whom there are no mobile signals… I’ve been wondering how to make a safe remote reading mechanism for the oil tank.
Funny how you don’t put two and two together sometimes… there are available (from China as our lot are too greedy) some cheap ultrasonic sensors – like the ones you have in cars to help you not run people over.. for a couple of quid you get a little board with a transmitter and receiver and you can take the signal and get accuracy of sub-centimetre bouncing off stuff for distance measurement. It occurred to me tonight – why not bounce off oil! So the next step was – how to get that info back to me – well I already have home control measuring temperature – modifying a board would allow me to return how full the tank was – so using temperature as the equivalent if it returned say 10 to 30c – that’s 20 values – that’s a tank accurate to 5% – good enough…. and finally how to power all of that – well – my friend suggested a super-cap – after all it only needs to wake up once an hour – take a reading, report back and go back to sleep – and a little solar panel to keep the supercap charged.
When the board powered up it would talk to my network – which up to now looks like it can reliably send data from unit to unit back to base – I’m looking at a test rig here for the network – I have a board in front of me – the “receiver” – two boards in the garden acting as relays – and one in the living room sending out incremental numbers as fast as it can. Right now I’ve just received 700,000 packages without issue and I plan to leave it overnight on test – hoping to hell it does not rain!!!
Could be onto a winner here… would be nice to add that to the armoury of info I have available at the touch of a button on my phone and tablet…. but it’s late at night – something for another day.
Radio Remote Decoding
Another one for the techies I’m afraid….
Do you need to turn mains lights on and off but want to do it from, say and Atmel/Arduino-type setup instead of the standard remote controls you get with plug-in-the-wall mains switches? Then this might be for you. This is a variation of a blog I just put up on WordPress – with my latest updates.
This article is about decoding radio remote controls using Arduino or similar hardware and a cheap 433Mhz radio receiver (£2 on Ebay for receiver and transmitter pair) – and then use that data to control the remote switch units using a similarly cheap transmitter – and was written to serve a purpose: NONE of the existing libraries I could find out there managed to detect all of my radio remote controls.
I’m interested in adding radio remote for mains control to my house control system which is basically an Atmel 1284 chip with Ethernet and radio network. You’ll find various articles on the subject at www.scargill.net
Although it is easy to make a remote switching unit that will be part of a network and control mains lights, it is overkill and it is also quite difficult to find dirt cheap mains to 5v supplies to go into one of the limited range of plug-in-the-wall project boxes along with a controller and a relay.
With that in mind I started to look at the many mains switch remotes available out there. These generally work using simple 433Mhz radio receivers and accepting a code which could be almost any length but is normally somewhere between 10 bits and 50 bits.. the encoding techniques vary. Generally speaking these do not use any kind of “rotating” encoding for security and simply use a block of data, repeated as long as you hold the remote button.
BUYER BEWARE: If you want to control lighting using plug-in-the-wall 433Mhz controllers you should be aware of two things…
[a] the cheap controllers you find in the likes of B&Q use a single frequency which is EASILY blocked by other, similar transmitters. I found when experimenting with a radio link at 433Mhz that it was easily blocked just by holding a button down on a mains remote controller.
[b] I found a nice cheap set of these plug-in-the-wall mains switches at ALDI recently, 3 remotes and a handset for £10 – what a bargain – but then looking at the fine print – you “train” them by turning them on and pressing a handset button within a few seconds – and that’s fine.. but, I thought, what about power cuts? Sure enough – you have to re-train them every time. What idiot came up with that brilliant idea? Going around the house re-training remotes every time the power fails? Surely not? But I tested them and that is how they work. They are boxed up ready to be returned – not “fit for purpose”. That is, to be fair, the first time I’ve come across this but if you order online – beware!
Ok, so what could be difficult the handset lets out a 433Mhz modulated signal when a button is pressed – and the mains blocks pick up this signal, decode it and turn the plug on or off – so all you have to do is read the signal coming off the handset and use Arduino (or PIC etc) existing libraries to record and play back, right? Wrong – I had at least two handsets that use a code which was so long the existing learning libraries could not handle them AT ALL.
Eventually after much reading and learning I decided to do my own thing.
So, easy enough, (both the transmitter and receiver which I’ve linked to below have ground, power and signal leads – nothing else – the receiver appears to have two signal leads but they are connected together – you need only use either one) assuming the output of the simple receiver is LOW on standby, press the remote and look for the start bit – capture the length of each change of state until the end? Right?
Well, no… the package is sent over and over – so you have to look for gaps between packages. Easy? Well yes except for AGC – automatic gain control. When the receivers are receiving “nothing” they get more sensitive and in my office the spikes coming out of the output were horrendous. I tried ignoring narrow pulses with limited results then I twigged.. if you run the remote control near the receiver – the noise goes away as the AGC (automatic gain control) kicks in…
So – press the remote control button – THEN start scanning – and store the gaps between pulses – say, 300 of them. I did this with some REALLY simple code looking for high and low using the micros() function in Arduino (millis() is way too course) and keeping the code tight by simply storing the actual value of MICROS() in a long array.. ok not efficient but for temporary storage it works and I can get consistent results.
I discovered that all the controls send repeated packages with a short absence of signal in-between. Given the noise issue, the first package often gets scrambled – the breakthrough came when analysing the stored values and realising the solution is to search for the first repeat – i.e. after the first BREAK –hence ignoring the first package – previous attempts to use that had yielded varying results at the start of the package. By the time the second package kicks in the AGC has adjusted and the noise has all but gone.
So this would give me an output like this typical one from a handset.
They vary of course in length (not from key to key in that case just the order of bits varies) but from handset manufacture to another model or manufacturer).
What I did notice were pairs of zeros… ie pulses twice the width of others. On reading up this is called Manchester coding (or a variation) – I chose to ignore this – but knowing there will never be more than TWO different pulse widths helps a lot… in reality I realise that there is only one period in this type of encoding.. see this for pictures and explanation if you are interested. http://en.wikipedia.org/wiki/Manchester_code
As you can see from that link, the clock and data are encoded into the one signal.
But for my purposes it’s really NOT important to either understand or use this knowledge. All that is necessary is to send that stream out – fixed width per pulse as per the original and if there are two identical adjascent values (ie 00 or 11, detected by longer and shorter pulses compared to a fixed value indicated by the first pulse) then obviously you simply send the status quo to the output bit for twice the length of time.
But this uses up a lot of storage. Looking at various handsets I discovered the largest signal seems to be around 40 or so bits… I made up a 12-byte array and wrote a routine to bit-shift the entire array by one bit – hence allowing me to convert the string above to a more sensible set of bytes.
In addition I added a byte at the start which represents the width of the basic pulse – as this could be as high as 1200us, I divided this by 10 to fit into a byte. In the example below you see 33 added to the start – ie 330us pulse width. On experimenting, that slight loss of accuracy seems unimportant and it saves a byte.
And so for any given button – we now have 11 bytes (in this case) to encode it. I decided that was GOOD ENOUGH. A little routine to read from the end backwards, sending out pulses (or no pulse) for the duration specified in the first byte – VOILA I was accurately switching mains lamps on and off via my cheap transmitter.
Most of the code is unique, some bits are variations on stuff I found on the web (thanks to all who’ve taken the time to put their ideas up on the web) – and is provided here UTTERLY without support – no comments on styling please – if you’re having trouble reading radio remotes for your purpose – I hope this is useful.
The transmitter and receiver are here
Change input and output pins to suit your project – any pin will do, if you get nothing having pressed your remote then sent A to the board via the Arduino serial monitor, then try messing with INTER_CMS-MS and MIN_POS_WIDTH but I suggest not before you do that, you check with a scope that something is actually coming in.
Clearly in any end gadget you make for your use, you’d not include the learning part or it’s huge TBUFF array. When I get a minute I plan to come up with a means to simply store the data in EEPROM and read from that… mind you – if you use a 1284 chip instead of the old 328, memory isn’t quite the problem.
If you need more range, you could consider putting the transmitter (NOT the receiver) on a higher voltage up to 12v. I tested mine at 12v and the signal from the 5v logic still worked perfectly. The increase in range is noticeable – I’d say 50% better coverage. If you blow up your board however, that’s your responsibility – don’t come back to me…
This is all suitable for short bursts to control stuff – don’t get any ideas about continuous home control signalling unless you can guarantee there are no other 433Mhz transmitters in use! I went down this route before realising it’s a non-starter and am now looking at the slightly more expensive frequency hopping chips for more sophisticated use – but if all you want to do is turn something on and off – this could be for you.
So – two programs – the first grabs the radio output and puts it up on the serial –it also has a test mode – the second is playback only…
Here’s the first with some test options…
// I used a simple 433Mhz tx and RX pair - 1 pin each needed. Output of radio assumed 1 when something there ie active high // No interrupts or clever tricks used // Using F() in strings merely to keep RAM down, and PROGMEM for arrays - that's the data you see on the serial display for one particular button press... // Could store this in EEPROM or whatever... for now could get a lot of these for a particular application into ROM without using up precious RAM // None of the PROGMEM stuff is essential - just there to minimise RAM use // Coding Peter Scargill June 2014. www.scargill.net #define PIN_DATA_IN 2 #define PIN_DATA_OUT 3 #define SERIAL_SPEED 115200 #define INTER_CMD_MS 100 #define CMD_REPEATS 5 #define COMPRESSED_ARRAY 12 // assume that's enough #define MIN_POS_WIDTH 200 // used before we have the period - assumed minimum acceptable PERIOD less than which we ignore - in Microseconds #define MAX_NEG_WIDTH 2000 // assumed maximum acceptable ZERO state in uS above which is assumed a gap between blocks of data #define READINGS 300 // For temporary storage while learning, need 4 bytes per reading... so WATCH OUT - 328 only has 2k of RAM #define TIMEOUT_VALUE 3000000 // Number of microseconds before we give up the ghost - ie 3 seconds - likely won't happen due to noise // Byron reports 39us*10 for period - didn't work - so I put in 59 - works a treat. const byte g0[]PROGMEM={59,77,211,36,73,146,52,73,210,52,1}; // Byron D2on const byte g1[]PROGMEM={59,217,150,109,217,178,45,91,18}; const byte g2[]PROGMEM={59,219,182,109,217,178,45,91,18}; byte tbuf; int remno=0; byte arr[12]; // Used to set a timeout unsigned long start_time; unsigned long timeout; unsigned long current_time; unsigned long calc; // Stores all the values read here unsigned long readings[READINGS]; int current_reading = 0; // Collect serial data into an array - or timeout as you prefer void readRadioPulses() { for (int a=0;a<COMPRESSED_ARRAY;a++) arr[a]=0; // wipe the eventual storage array for ( current_reading = 0; current_reading <READINGS; current_reading++) // store enough values for 2 or more packages - as long values for speed { // Waits until the input goes HIGH while (!digitalRead(PIN_DATA_IN)) { if (micros() > timeout) return; } // When the first value comes, save that period readings[current_reading] = micros(); digitalWrite(13, HIGH); // Wait until the input goes low while (digitalRead(PIN_DATA_IN)) { if (micros() > timeout) return; } current_reading++; readings[current_reading] = micros(); } } void shiftArray(int x) // move the entire array toward the highest offset by 1 bit and add least new significant bit to offset 0 { for (int a=sizeof(arr)-1; a>0;a--) { arr[a]<<=1; arr[a]|=(arr[a-1]&128)>>7; } arr[0]<<=1; arr[0]|=x; } // Sends the data to the serial port void displayRadioPulses() { int speed; byte pickone=0; for ( current_reading = 0; current_reading < (sizeof(readings)-1); current_reading++) { calc=readings[current_reading+1]-readings[current_reading]; if (((current_reading&1)==0)&&(calc<MIN_POS_WIDTH)) { current_reading++; continue; } if ((calc>MAX_NEG_WIDTH) &&((current_reading&1)==1)) { pickone++; if (pickone==1) speed=readings[current_reading+2]-readings[current_reading+1]; } if (pickone==1) // extract string here { if ((current_reading&1)==0) { if (calc>(speed+(speed/2))) { //Serial.print("1"); shiftArray(1); } //Serial.print("1"); shiftArray(1); } else { if (calc>(speed+(speed/2))) { //Serial.print("0"); shiftArray(0); } //Serial.print("0"); shiftArray(0); } } } // Serial.println(""); Serial.print("const byte g"); Serial.print(remno++); Serial.print("[] PROGMEM={"); Serial.print(speed/10); Serial.print(","); for (int a=0;a<sizeof(arr);a++) { if (arr[a]) { Serial.print(arr[a]); if (arr[a+1]) Serial.print(","); } } Serial.println("};"); } void sendRadio(const byte *m, int sz) // can't do sizeof a PROGMEM array so just pass the size { int scount; int offs; int period; byte tmp; period=(int)pgm_read_byte(m)*10; // get the first value, multiply by 10 and that is your period for (scount=0;scount<CMD_REPEATS;scount++) { for (offs=sz-1;offs>0;offs--) // start at the end and work backwards not including offset zero which is the (period/10) { tmp=pgm_read_byte(m+offs); Serial.print("."); for (int r=0;r<8;r++) { if (tmp&128) digitalWrite(PIN_DATA_OUT,HIGH); else digitalWrite(PIN_DATA_OUT,LOW); start_time=micros()+period; while (start_time>micros()); tmp<<=1; } } Serial.println(""); digitalWrite(PIN_DATA_OUT,LOW); delay(INTER_CMD_MS); } } // Listens to SERIAL for inputs A=read, B=write demo - when reading press and hold handset FIRST void SerialRequest() { char c; while (Serial.available()==0); c=toupper(Serial.read()); if (c=='A') { start_time = micros(); timeout = start_time+TIMEOUT_VALUE; readRadioPulses(); displayRadioPulses(); Serial.flush(); } if (c=='B') // try the example compressed code which includes (period/10) as first byte - can be any length { sendRadio(g0,sizeof(g0)); } if (c=='C') // toggle 2 codes back and forth for range testing { Serial.print(F("Test toggling...")); for (int a=0;a<200;a++) { sendRadio(g1,sizeof(g1)); delay(1000); sendRadio(g2,sizeof(g2)); delay(1000); } Serial.println(F("Done")); } } void setup() // set serial speed, set output for the radio output - and put something on screen to show it's working - use built-in F() to save RAM { Serial.begin(SERIAL_SPEED); pinMode(PIN_DATA_OUT, OUTPUT); digitalWrite(PIN_DATA_OUT, LOW); Serial.println(F("Send A to check or B to send example in PROGMEM")); } void loop() { SerialRequest(); // I could have just put the lot in here really }
and here is the second – playback only…
// I used a simple 433Mhz tx - 1 pin each needed. Output of radio assumed 1 when something there ie active high // Coding Peter Scargill June 2014. www.scargill.net #define SERIAL_SPEED 115200 #define R433_PIN_DATA_OUT 2 #define R433_INTER_CMD_MS 100 #define R433_CMD_REPEATS 5 // Byron reports 39us*10 for period - didn't work - so I put in 59 - works a treat. const byte g0[] PROGMEM={64,77,211,36,73,146,36,73,210,52,1}; const byte g1[] PROGMEM={64,73,211,36,73,146,36,73,210,52,1}; const byte g2[] PROGMEM={64,77,211,36,73,146,52,73,210,52,1}; void sendrad (const byte *code_buffer, int sz) // can't do sizeof a PROGMEM array so just pass the size { int scount; int offs; int period; byte enc; long mydelay; period=(int)pgm_read_byte(code_buffer)*10; // get the first value, multiply by 10 and that is your period for (scount=0;scount<R433_CMD_REPEATS;scount++) { for (offs=sz-1;offs>0;offs--) // start at the end and work backwards not including offset zero which is the (period/10) { enc=pgm_read_byte(code_buffer+offs); for (int r=0;r<8;r++) { if (enc&128) digitalWrite(R433_PIN_DATA_OUT,HIGH); else digitalWrite(R433_PIN_DATA_OUT,LOW); mydelay=micros()+(unsigned long)period; while (mydelay>micros()); enc<<=1; } } digitalWrite(R433_PIN_DATA_OUT,LOW); delay(R433_INTER_CMD_MS); } } // Listens to SERIAL for inputs A=read, B=write demo - when reading press and hold handset FIRST void SerialRequest() { char c; while (Serial.available()==0); c=toupper(Serial.read()); switch(c) { case 'A' : sendrad(g0,sizeof(g0)); break; case 'B' : sendrad(g1,sizeof(g1)); break; case 'C' : sendrad(g2,sizeof(g2)); break; default : break; } } void setup() // set serial speed, set output for the radio output - and put something on screen to show it's working - use built-in F() to save RAM { Serial.begin(SERIAL_SPEED); pinMode(R433_PIN_DATA_OUT, OUTPUT); digitalWrite(R433_PIN_DATA_OUT, LOW); Serial.println(F("Send A to N to send examples in PROGMEM")); } void loop() { SerialRequest(); // I could have just put the lot in here really }
The Brussels Trip–June 2014
Here I am in sunny Brussels again, this time for two different bodies, I came here at the start of the week to continue the work on ESCO with colleagues from around Europe – and I end the week at Microsoft HQ here in Brussels.
I’ve been staying at a very weird hotel called the Mozart near Grande Place – and I mean 2 minutes near. The rooms are a tad small but as you can see below they make up for it in sheer elegance – the whole place is done out like this…
I arrived Monday evening in time to meet my friend Kenneth from Sweden at the local bar, before heading into 2 days of intense meetings which finished last night. I headed back to my hotel and had a drink outside with another colleague George and we talked about data security which is his field – it really didn’t occur to me before but all this friend “tagging” we do on photos is giving the security forces tools they never before dreamed possible! The evening ended on a fine note as I met up with a friend who long ago was the FSB’s Policy Chairman, Brendan Burns (and now a member of the EESC) and he introduced me to a fine Thai restaurant a short walk down from the square – he has a flat here and spends a lot of time in Brussels so I always learn a lot of local info when we meet up.
Today I’d planned a trip to the Atomium and thereabouts but I simply didn’t manage to get out of
bed early enough and so decided to do the up-hill walk to Avenue Des Arts to attend a meeting put together by ESBA and SEAP to discuss the Transatlantic Trade Agreement – met some interesting characters there including one who gave me a whole new way to think about open source and who’s views on the future of 3D printing are similar to mine.
We had the American Ambassador to the EU there as well as a host of other relevant people and there was a very lively debate on the subject, including an amazing attack by an MEP who came over initially as quiet and announced he had no idea why he was here – then promptly launched a vicious and somewhat effective attack AGAINST the TTIP.
Great afternoon and many of the guys are meeting up tonight for a meal.
Tomorrow an AGM (I’m merely an observer in this case) then back home to see my wife and her broken foot.
Ok, Brussels is a big, noisy city – but given that, this is a nice place to be….back here in a month for another round of ESCO meetings.
La Weekend
Two very successful days in a techie kind of way… and sorry, this one is just for techies…
One of my big bug-bears with the Ethernet/radio interface for the home controller has always been the cheap short range radios as you know if you’ve followed my blogs. The NRF24L01 boards are just crap – ok, they work but only short range – and the RF24NETWORK network is great for what it is – but it’s not a true net and there is no chance of making into a true network – you have to have a master and spider-type network with hopping nodes. Their numbers have to be predefined as the hopping sequence is limited. In addition the radios can’t send and receive at the same time so the master really has to keep control at all times of the communication sequence… AND THAT’s FINE – I have it off to an art – but if only there was something better.
Well there is – the Atmel chip range include a pair with radio built in and they’ve developed a lightweight network – but a true network where any node can step in as a relay. Problems? Getting the things, having the software, defining the interface. Well getting them was the first thing we solved, thanks to my pal buying an oven to solder the chips to the boards (impossible with a soldering iron as the pads are underneath the chip), the software we now have working, due to a sensible approach… and the interface is now cracked.
You can get samples out of Atmel and that’s just what my pal Aidan did – well both of us, allowing him to make a series of test boards up. Until this weekend that’s about as far as it went – but yesterday we managed to get the network demos up and running and there is no doubt about it, the extendable network WORKS – we made the mistake of starting with on-board chip aerials which are pretty useless but we know from the demo boards that Atmel produce that they CAN have a decent range with the right stub aerial.
We have SCOURED the web and it is full of failed projects and promises due to people going down the wrong path either hardware or software wise in producing low cost radio networks. One set of guys in Canada thought they had the solution, a little radio board with USB on it – they needed 20k funding – and only got 6k – the project stopped this time last year and even their website has disappeared. WHY? Heaven knows but I suspect the USB interface – why would you want to fasten these to your PC when you already have WIFI…. surely a simple low cost interface for hardware projects using PIC, ATMEL or other chips is the answer, something compatible with he many cheap radio boards out there but considerably better? Well we solved that one today – the SPI interface – after a several blind alleys – we got it working. Making a stand-alone radio board avoids the hurdles of making the boards work with a particular chip. The final hurdle – antenna – the chip antenna designs are useless – few feet range – so we’re going to make 2 boards, one with on-board antenna and the other with a short stub aerial – either way we expect up to 30metres range. With 2 boards you have 60 metre range etc. etc… a true network.
We tested the network by having two boards talk to each other and moving them further and further apart until they were out of range. Merely introducing a third, arbitrarily numbered board in between the two, re-instated the link – we went up to 4 boards two of which simply sat there on the floor of a large house, battery powered and we managed to triple the working distance of our boards.
Nothing more will happen before June as we need some boards with proper aerials to test and I have holidays but we’ve cracked the back of this one. An excellent way to spend the weekend.
A week from Hell
It’s been a reasonably awful week this week. Firstly I’m in holiday mode – as we’re off to Spain next week to do some work on the cave – so I’m basically counting the days. I spent the start of the week battling with a new service provider, the one I’m using for this and other blogs. Just silly stuff like me not realising I could not add an email redirect until I’d actually set up an email account in the first place – makes sense really – but you don’t have to do that with 123-reg so I wasted a morning figuring that out.
The rest of the week was spent in FSB meetings. Tuesday morning I drove down to St Johns Hotel in Solihull – took me the better part of 5 hours as the traffic down there wasn’t too good – and what HAVE they done to the M6 down at that end? There are more bumps in the road than some of our rural roads… awful.
The hotel I have to say was about as nice as the weather – it’s a Principal Hayley hotel and the food was awful – others agreed. Thankfully at night there was a cracking Indian restaurant and a few of us spent our evenings in there. I can’t go into details in a blog but the meetings were hard – culminating in elections. I came out of it well, starting my 13th year as National IT Chairman and member of the Executive Board – not unexpected but then one should never take things for granted. Others didn’t do so well and two people I respect lost their posts.
The meetings finished yesterday afternoon and at 5pm I set off on the trip up North and stopped at the Welcome Break in Woodall which houses the slowest McDonalds on the planet. I then took a different route as I thought the A1M might be a little better than the overcrowded M6. BAD mistake – it was closed, or part of it was, so the traffic ended up being routed through a small town – thousands of vehicles – absolute nightmare.
The end result was that it took me 7 hours go get from Solihull to Wark-on-Tyne. I don’t mind driving FAST but slow journeys like that I find quite depressing.
I’d planning on spending the day here today preparing stuff for Spain but as it happened I ended up spending most of the day on conference calls or Skype, phone calls or emailing… to add to the damage, I’m involved in a European (EU) project and there is “trouble at mill” there which needed attending to – so I managed to get all of an hour or so to do my own “thing” as it were.
And to add icing to the cake, the only decent part of the trip away – the Indian restaurant saw me lose a filling so tomorrow it’s off to the dentist to get some repairs done before heading off to see a friend and his wife. That, at least should see a nice end to the week. More meetings ahead before we finally head off to the sun mid-week.
LED STRIP
A friend of mine recently asked me to provide some information on LED STRIP and I thought I’d put a quick blog item together as the subject is likely to be of interest.
“LED STRIP” is a name widely given to a product which is becoming increasingly important. As filament lamps are (thankfully) slowly being resigned to history, CLF (compact fluorescents) took over some years ago but there are a few problems with these lights also.
CFLs are the most abysmal colour but let me explain “colour” first for those raised in art class:
As far as light is concerned there is no such thing as white… white light is a combination of various wavelengths of light – and a commonly used method to minimise the complexity of this is to explain that you can make any colour of light with a combination of RED, GREEN and BLUE. Why not treat yellow as a “primary” colour as with paints? Well that’s because paints are different, mixing two colours makes a DARKER, not LIGHTER colour – it’s called subtraction, suffice it to say that a modern TV can show pretty much any colour – and they ALL come from a combination of red, green and blue. Red+green makes yellow, red+blue makes purple, blue+green makes cyan, all three with care make white – simple as that.
Another way to get “white” light is to generate another colour, let’s say ultra-violet (which is the far end of Blue, generally you can’t see ultraviolet at all well if at all) but use a powder that reacts to that and generates white light – that’s generally called a phosphor and that’s how CFLs work. You have a gas in a tube – you put electricity through it – generates UV – and a white powder on the inside of the tube glows WHITE.
Or kind of – the white you get out of CFLs is AWFUL. What do I mean by WHITE? Well, filament (old-school) lamps generate light by heating a wire. Essentially that generally gives a very bright yellow-ish light – you don’t notice this when you are in it – but try looking through a window from the outside where they have old-school lights – it’s yellow-ish. Then there are “daylight” lamps- these tend to be white with a hint of blue…. recall that in the evening sun, our atmosphere absorbs all but the red end so everything looks orange to red… (unless you live in England in which case the evenings are generally GREY). In the morning there is far more blue in the light – hence the term “daylight” to describe lights which veer to that end of the spectrum. Candles give off a light that is nearer to orange than to white.
Commonly available CFLs come in either “warm” or “daylight” varieties – Chinese manufacturers refer to “degrees Kelvin” to describe the colour – which is about as much use as an ashtray on a motorcycle, to the layman. 6500K is COLD or daylight….5000k is more like a fluorescent tube, 2700k is more toward orange and is your typical incandescent light. A match might be nearer 1700k. Simple – but not a lot of use in the supermarket.
Ok, so filament lights are old-school, inefficient but considered a “nice” colour. Xenon arc lamps as found on up-market cars are cold, clean light and CFLs are just, well, naff, really.
The CFL took off partly because at first, there was this thing about being “green” combined with the fact that everyone DISCOUNTED them – so for a while it was not unusual to see supermarkets selling them for under £1 – certainly we kitted out the entire house and no doubt saved a FORTUNE in electricity. The promise was that they’d last a long time – they do unless you buy them in Spanish supermarkets in which case they’re as likely to blow up or fall to bits on first use.
But now that the grants and discounts are all gone, your humble house light has gone back to to £2-5 quid – so the magic has gone and they’ve still never really solved the boring colour problem.
And so along came LED (light emitting diode). Everyone knows the phrase but what does it actually mean? Well, instead of heating up a wire or exciting a gas, the technology behind LEDS involves getting a piece of silicon to convert electricity directly to light! Not very efficiently I might add – but good enough.
LEDS appeared late last century… I saw my first LED on a Bond movie in a watch – I was so blown away I went straight out and blow all my money on a LED watch. In fact, the basics were sorted as far back as 1907 with the first practical devices appearing in the 1960s. You had a choice of RED, RED or RED.
What you don’t have, you seek and as variations appeared, puke yellow, gross green etc., what we all wanted was BLUE… and then at the very back end of the 20th century after much research we started to see the full range of colours – even purple – and WHITE. LEDs had an issue however, not that efficient, bright enough but as individual LEDS not really bright enough to light up the house.
Remember when electric motors were the poor relatives of the powerful petrol engine? All of that his history now as fans of the TESLA motor car will tell you – and so it is with LEDS – but BEWARE.
The first practical replacements for house lighting came in the form of GU10 and similar clusters of LEDs – maybe 20 to 40 LEDS crammed into a conventional light fitting. FORGET them – utterly useless – what LEDS hate the most is heat. Lamp manufacturers are prone to blindly copy the LED spec sheet claiming countless thousands of hours of life. Well, it’s bollocks. Heat them up, overpower them or any combination and you’re down to weeks or months never mind years. A trip to B&Q will confirm that –check out their overhead LED displays in the lighting section and you’ll find those particular types of light will invariably have several bust lamps amongst their midst.
Next came the new super high power leds – where one or 3 leds would do the job. These are current and are very good (notice the heatsink).. but like all lights follow a model of lighting that’s been around since the candle – the point source. Also these LEDS are STILL not immune to packing in – the light is still concentrated all in one place. Only the long fluorescent tube up to now has broken that mold – but today – it’s all change!
SURFACE MOUNT is a means of compacting electronic components – and you see this in almost all of today’s circuit boards instead of components with leads which need complex assembly we have little rectangle with solder blobs on each end. They are positioned along with solder paste onto a board – the whole lot is put in an oven in which the solder melts and forms connections – and Bob’s your uncle – easy to make, tiny circuits.
LEDS are available as surface-mount blocks and they are CHEAP – and the first use of this came in again GU10 and similar lights, instead of using 40 original LEDS with the associated heat issues and mounting problems, the LEDS could be mounted on a round plate with metal underneath, compacting the size (up to 60 SMT LEDS) and distributing the heat – problem solved. But a BETTER solution is emerging – that of LED STRIPS.
Remember the old 1/4” TAPES before we had compact cassettes. Well, LED STRIP comes on reels like the old tape – but this stuff is made out of a material that supports flexible copper sheet as wiring and surface mount LEDS – typically one LED every couple of centimetres, LED strip typically works on 12v DC (not mains). they are mounted on the strip along with an adhesive backing – and you can cut the strip into combinations of 3 LEDS – i.e. 3, 6, 9, 12 etc. That is because the LEDS work on around 3v (varies) – they mount 3 in series (i.e. head to toe) and use a tiny resistor to stop them blowing up so you can get away with feeding them 12-14 volts You can use strips as long as you like, the only limits being the amount of electricity the copper strip will support without loss over great lengths – and how much current you can get out of a 12v power supply.
Typically you might see a 5metre length of LED strip – powered from a 2 amp 12 volt supply. You can get red, green, yellow, orange, purple, blue, cool white and warm white – there are more variations but this covers the bulk.
But you need to know more in order to make a sensible purchase.
So you can put these strips simply in places that other lights can’t go – in cabinets where there isn’t ROOM for other forms of lighting – or areas where 240v would be unsafe. You can get straight-forward LED strip where the elements are exposed – or you can get a gel-covered version which is WATERPROOF.
You can also get various forms of RSB LED, the simplest has in it’s group of 3 LEDS, a RED, GREEN and BLUE led…. one after another – i.e. R G B R G B etc. There are also TWO sizes of LED which means in a 5 metre roll you might have a total of 300 LEDS – or in the more expensive versions up to 600 LEDS in the same space (the smaller ones are not as bright individually but with twice as many lights they ultimately win on outright brilliance).
That’s great so now you can make any colour including WHITE… erm… no. LEDs that well spaced will NEVER produce white – they produce a disco light with RED, GREEN and BLUE.
What’s needed is a chip with all 3 elements inside right next to each other – and that’s what the latest LED strip has. So now you can have all the colours including WHITE – not only that but with care you can achieve ANY colour temperature of WHITE, from candle all the way to that cold, blue-ish light we call “daylight”.
But now there is something new and exciting – a new form of these chips means they have not only power and ground (and these run on 5v, not 12v and they run individually, not in groups of 3) but also a “serial” input and “serial” output – i.e. 2 more leads… the first in the chain takes an instruction from a controller to tell it what colour and what brilliance to output. Subsequent instructions are simply passed onto the next LED in the chain.
So now it is possible to have a length of LED strip where EACH LIGHT is individually controllable at high speed. Been to an airport recently? Seen the HUGE full colour TV shop displays? Take a close look – each point of light in the very latest ones is a little white chip capable of any colour, any brilliance right up to painfully bright.
This then is the state of the art in LED lighting – strip that can be any colour you like, any brilliance within reason and can even change from one end to the other, producing soft, undulating colour rainbows that are quite hypnotic.
Is it cheap? No. Are current controllers up the mark? No – so this latest form of LED lighting is for the specialist only right now but it’s there – on EBAY if you are up to it.
Stepping back a little, RGB LED strip and single colour strip that WORKS RELIABLY and is inexpensive is there for the taking.
Unless, that is, you are in rip-off Britain and still shop retail for this stuff. Maplins the other day were selling a 5 metre roll plus simple infra-red remote controller – of an older version of the LEDS for a mere £39 – all you need is a power supply which they’ll happily sell you for a tenner no doubt bringing the total cost for 5 metres of lighting to £50.
And what’s wrong with that? Ebay will tell you that. You SHOULD be paying around 1/3rd of that. A single colour strip with power supply for a tenner, a colour strip plus controller for under £20 tops.
There are various buzz-terms around which make things difficult to understand. 5050, 3528 etc… well 5050 LED strip generally has 300 LEDS per 5m length, the smaller 3528 LEDS manage 600 per strip (if stated) – simple as that.
Adhesive – most quote 3M adhesive as if that was a mark of quality. My experience suggests that ANY dirt on the mounting surface or any irregularities – and the stuff won’t stick for long – also warm surfaces… best plan your own mounting method. I generally at least staple the ends (careful you don’t cause a short – this is easier on the gel-coated variety) or find some other way to secure the tape.
Control can be via the controllers they sell = any colour but only 256 combinations so the colour changes are a bit crude - if you expect however a super-smooth transition or brightness change – forget it – with only 256 steps your eyes can tell the change – I’ve no recommendations here as I do my own thing – but if you see a controller offering 16-bit (65k) levels of control – that’ll do the job.
The rest is down to imagination – now you know where to look (EBAY – look up “led strip” – most definitely NOT B&Q) you can have any colour combination – and light anywhere you like. I put a red strip around the doorframe of our front door – looks like a portal off Star Trek – in all the time it’s been up (maybe 2 years) no loss of brilliance – no duff leds. I put white strip on the underside of the roof of the garden hut – 4 years later – still working perfectly – not one single dead light.
Cat Poo and other Delights
I’m not NORMALLY prone to promoting particular brands – well, why should I? I don’t get paid… but in this case I’m going to make an exception – and I must clarify – this is purely for your information – I am NOT getting any benefit out of this nor do I even know the manufacturers.
I’m 60 and I’ve had cats all my life – I find them great companions and our two gingers are basically part of the family, they sleep with us (in shifts at the bottom of the bed for clarification) and spend their time when not chasing birds, in a corner always near where we are. They don’t smell, they don’t “have accidents” and they don’t need maintenance – just food, water and attention when you can be bothered. In return they give a LOT of affection – a good deal all around.
Our two “never” have accidents (I did forget about them once and lock them in the office for 48 hours – well, you can’t blame them, one came out cross-legged, the other didn’t) however cats don’t last forever and we now have a new ginger kitten – who is most adorable on the one hand, but on the other has to be the most efficient machine for producing “waste matter” (don’t want to put you off your breakfast) ON THE PLANET. He has come THAT far off being strangled a few times and I’v thought of some creative uses for corks but not implemented them. He is out and about now, having had “the chop” but until then he had to stay in the house and BOY could he make a mess.
Animal mess is something I find HIGHLY offensive and I can categorically say that every remedy I’ve seen on the web FAILS. People suggest vinegar and all other kinds of solutions that smell worse than the original problem – there are products all over the place and to the last one – all they do is mask the problem AT BEST.
Well, with the exception of one. Some time ago, Maureen found the product you see above – Simple Solution Stain + Odour Remover – an American product by the look of it – but available over here in the UK (see link later on) In desperation we gave it a shot. It works.
I could stop there really – it absolutely works. The general advice on the container is simply to clean up the mess and pour this stuff all over the location, be it carpet, tiles or whatever, leave for a while and mop up. Two things wrong with that scenario – mopping up might not be that easy and pouring it all over ensures your expensive and large container doesn’t last long not to mention rotting the floor underneath if it’s wood.
So with that in mind, a week ago I happened to have an empty hand-spray weed killer plastic bottle and filled it with the stuff.
Put it in a convenient spot and never thought any more about it until the other day I left my office door open – I do that as I get sick of the cats begging to be in – they have a tendency to do shift work coming in and out of the office for several hours at a time.The kitten who’s just been allowed out rushed in, found a corner full of cables and made the biggest mess you can imagine – GROSS. Well, after grabbing kitchen roll, convincing myself not to throw up and cleaning up as best I could, I was left with an office with un-breathable air. NOT happy. I did consider at that point drowning him but Maureen would never have forgiven me. After a few less destructive thoughts, like dropping him off in the next village, I decided to give the spray bottle a go. I simply drenched the area with fine spray – and went off to bed for the night, convinced I’d have to pull the workshop area apart even though I’d done a good clean up job.
The next morning – NOTHING – if anything a very slight odour from the cleaner – which is actually a kind of “spring fresh” smell – it’s actually quite nice. ABSOLUTELY no sign of anything visually or odour-wise and certainly nothing you would attribute to an animal.
The stuff REALLY works – I don’t know how it works – but it does. Similarly the little devil stained the carpet at one point – now that is REALLY a problem as it gets into the under-carpet and everything and basically you’re normally talking “carpet replacement”. Again, a good soaking, this time blotting up after a while – again – UTTERLY SORTED.
It is very rarely that I rave about products – but I’m sold on this stuff – if you have cats it could be a LIFE-SAVER.. well, you know what I mean.
There are variations – one with a dog on it – I have NO idea if it’s the same – and there are various size – we bought the 4 litre version… a quick Google failed to turn up the 4 litre version but I found this –
http://www.petsathome.com/shop/en/pets/simple-solution-stain-and-odour-remover-750ml
It’s the smaller spray version and definitely the same product we bought. If you have a cat and this is of interest – ENJOY! Life just got a lot easier.
Private Religious versus Public Religion
I am so glad I was not (even remotely) a lone voice in objecting to Mr Cameron trying to impose his religious views on the nation. With WELL over half of the country (65% according to YouGov) describing themselves as non-religious – last I heard, in a democracy that makes them the majority. Many of us are sick and tired of having this stuff rammed down our throats and not only at weddings and funerals but on TV, radio and now from our own supposedly worldly-wise Prime Minister. Yeah yeah, we know all about the history and how things WERE and where we would have been without…. etc. This is the 21st century – any spare teaching time needs to go into beefing up our science knowledge, not ancient belief systems – or we are going to lose!
Were it not for kids having religion fed to them on a plate before they are old enough to think, that figure for “non-believers” would be a lot higher (but you KNOW that’s not going to happen). I’ve no problem with anything anyone wants to do with their lives – none of my business – as long as it doesn’t harm others (I know at least one white witch) but it’s about time this organised endemic version was resigned to history. The job of Prime minister is to rule the country – not to spout off about his own version of one of the many incompatible mystical world views as if it were part of government policy. http://www.bbc.co.uk/news/uk-27099700
Still, it could be worse – at least we don’t (yet) have our own creationist museum. Bill Nye (the science guy) decided to tackle Ken Ham and pretty much wiped the floor with him technically, but if you look at some of the faces in the audience, they were not open to discussion – didn’t understand, didn’t want to understand – and fair enough, if you were brainwashed as a child by both your parents and their friends – and your peers were in the same boat – it’s probably pretty hard to kick that habit. Anyway, here is the (rather long) video of the recent debate in the USA. https://www.youtube.com/watch?v=z6kgvhG3AkI
Who has the moral upper ground? Well I know of VERY few non-believers in the 21st century who would stop religious people practicing in their own homes (one might object to organised religion but that’s another matter) – on the other side of the coin there are many countries where not having an invisible friend can get you killed or at a minimum, discriminated against – and some of those countries are nearer than you might think. http://www.thewire.com/global/2013/12/13-countries-where-atheism-punishable-death/355961/ as extracted here “”Our results show that the overwhelming majority of countries fail to respect the rights of atheists and freethinkers,” the study explains, noting that laws in some countries prevent atheists from marrying, attending public school, participating as a citizen, holding public office, or just existing at all.” How to ensure your version of the world survives – by BRUTE FORCE.
Worrying? – certainly is. Think about it – BECAUSE you don’t believe in an invisible friend, the existence of which has NEVER, EVER produced a shred of evidence no matter WHAT religion, you can be shot! Either you are as mad as the rest of us, or we kill you!
We may have smart phones but we’re still a bunch of savages in the main.
Aspirin in man-size bottles
I have never understood the need to sell Aspirin in ever-decreasing size packs in the UK – other than the need to make more profit. Thankfully there is always America and now, after our 1000-Aspirin bottle has finally run out, several years after we bought it, Maureen has brought back some more man-size bottles. The largest that BOOTS do is 56 (75mg) tablets – at £3+ a pack.
It appears even in America the 1000-unit bottles are no longer as easy to get hold of – however we’ll manage with 300 at a time. 900 pills – that should last quite a while..
Today’s project–Clothes-peg Gun
This guy’s description of how to make a tiny gun out of a clothes peg is brilliant. Took me less than 10 minutes to make one which worked perfectly.You might want to play with distances to get more power but I could get 15-20 ft out of a toothpick no problem. Below is my first attempt. Great holiday time-waster. Mine is outside now waiting for a quick coat of paint to dry… light blue!