As things are slow at the moment. Here is a project that I have built.
The background is that I was given a number of strings of (tungsten filament) lights (as my neighbour thought that I was unfestive). Over the years the bulbs have burned out.
(The strings were of the US type 100 bulbs consisting of two set of 50 bulbs in series and the two 50 strings in parallel).
So what about replacing the bulbs with LEDs - even better bicolour LEDs.
The circuit is essentially a high voltage H-bridge (integrated H-bridges do not seem to go above 40V). By switching polarity the LED changes from red to green, they can even be switch fast enough to make a passing orange.
So attached is the circuit.
Caution: If you are unconfortable working with high voltages do not attempt this (it uses 170 DC which will kill).
Here is some code. I'm sure somebody can come up with better sequences.
Care should be taken not to have the wrong two halves of the h-bridge on at the same time.
#chip12F1840,16
#configOSC=INTOSC, MCLRE=Off, WDT=off, boren=off'trisa=b'00001000'dirporta.0outdirporta.1outdirporta.2outdirporta.4outdirporta.5out'lata=b'00000000'setporta.0offsetporta.1offsetporta.2offsetporta.4offsetporta.5offdimixasworddimiyasworddimiaaswordwait1secRandomizedorepeat100j=random/64ifj=0thenlata=b'00010001''REDwait1secendififj=1thenlata=b'00100010''GREENwait1secendififj=2thenrepeat200lata=b'00010001''REDwait2000uslata=b'00100010''GREENwait3400usendrepeatendifIFJ=3THENlata=b'00000000''offwait250msendifendrepeatrepeat5lata=b'00000000'wait1secforia=0to1000ix=ia*10iy=10000-ixlata=b'00000000''offwaitiyuslata=b'00100010''greenwaitixusnextilata=b'00100010''greenwait2secforia=0to1000ix=ia*10iy=10000-ixlata=b'00010001''fade green-redwaitixuslata=b'00100010'waitiyusnextilata=b'00010001''redwait2secforia=0to1000ix=ia*10iy=10000-ixlata=b'00010001''redwaitiyus'fade red-greenlata=b'00100010''greenwaitixusnextilata=b'00100010''greenwait2secforia=0to1000ix=ia*10iy=10000-ixlata=b'00010001''fade green-redwaitixuslata=b'00100010'waitiyusnextilata=b'00010001''redwait2secforia=0to1000ix=ia*10iy=10000-ixlata=b'00010001''redwaitiyuslata=b'00000000''offwaitixusnextirepeat20lata=b'00010001''redwait10seclata=b'00000000''offwait250mslata=b'00100010''greenwait10seclata=b'00000000''offwait250msrepeat2000lata=b'00010001''REDwait2000us'attempt at orangelata=b'00100010''GREENwait3400usendrepeatlata=b'00000000''offwait250msendrepeatendrepeatloop
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I got a lantern and a few "bulbs" that have a flame effect but they are so cheap in lidl or ebay why bother?
It's difficult to find something worth making that costs less on ebay.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
It's the joy of creation and I can say that mine is unique. I would guess that it probably is the only one in the world.
I spent a week in England recently and all I saw were flashy white led things I saw none with bicolour LEDs. Oh and I can program in any sequence I want.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
As things are slow at the moment. Here is a project that I have built.
The background is that I was given a number of strings of (tungsten filament) lights (as my neighbour thought that I was unfestive). Over the years the bulbs have burned out.
(The strings were of the US type 100 bulbs consisting of two set of 50 bulbs in series and the two 50 strings in parallel).
So what about replacing the bulbs with LEDs - even better bicolour LEDs.
The circuit is essentially a high voltage H-bridge (integrated H-bridges do not seem to go above 40V). By switching polarity the LED changes from red to green, they can even be switch fast enough to make a passing orange.
So attached is the circuit.
Caution: If you are unconfortable working with high voltages do not attempt this (it uses 170 DC which will kill).
Last edit: David Stephenson 2019-12-20
Here is some code. I'm sure somebody can come up with better sequences.
Care should be taken not to have the wrong two halves of the h-bridge on at the same time.
or go to poundland :)
I got a lantern and a few "bulbs" that have a flame effect but they are so cheap in lidl or ebay why bother?
It's difficult to find something worth making that costs less on ebay.
It's the joy of creation and I can say that mine is unique. I would guess that it probably is the only one in the world.
I spent a week in England recently and all I saw were flashy white led things I saw none with bicolour LEDs. Oh and I can program in any sequence I want.