Page 1 of 1

pi-Beacon:16 NEO pixel LED

PostPosted: Sun Apr 09, 2017 4:00 pm
by kw123
setup:
1. create a pibecon/ neopixel device:
Screen Shot 2017-04-09 at 17.21.55.png
Screen Shot 2017-04-09 at 17.21.55.png (39.73 KiB) Viewed 12009 times

Screen Shot 2017-04-09 at 17.22.11.png
Screen Shot 2017-04-09 at 17.22.11.png (53.56 KiB) Viewed 12009 times


2. create an action
Screen Shot 2017-04-09 at 17.24.06.png
Screen Shot 2017-04-09 at 17.24.06.png (204.61 KiB) Viewed 12009 times

then you can switch the lines / pixel on / off through this action

you can also create a script:
Code: Select all
plug = indigo.server.getPlugin("com.karlwachs.piBeacon")
plug.executeAction("Neopixel" ,   props ={
   "outputDev":"22876764"
  ,"device":"OUTPUT-neopixel"
  ,"restoreAfterBoot":False
  ,"intensity":100
  ,"repeat":""
  ,"resetInitial":"[0, 0, 0]"
  ,"command":'['+
      '{"rotate": "", "delayStart": "", "rotateSeconds": "", "position": [2, 3, 5, 5, 100,0,55], "type": "line", "display": "immediate"}'+
     ',{"rotate": "", "delayStart": "", "rotateSeconds": "", "position": [4, 6, 7, 7, 55, 0, 100], "type": "rectangle", "display": "immediate"}]'
  })

and run that.

when you switch on output debug and you execute a regular be-pixel action. the plugin will print the equivalent script into the log file. Just copy that and continue editing in an action/script if you like.

Karl

Re: pi-Beacon:16 NEO pixel LED

PostPosted: Sun Apr 09, 2017 4:14 pm
by kw123
Sources:

1. Adafruit: They are pre canned, plug and play, but you need a level shifter (3.3 <-> 5V for the signal)
https://www.dropbox.com/s/55jeedm2e5fk78v/neocircle.MOV?dl=1circle 3 points rotating around
with the following action
Screen Shot 2017-04-09 at 18.47.17.png
Screen Shot 2017-04-09 at 18.47.17.png (85.12 KiB) Viewed 11990 times


2. pomoroni @ https://learn.pimoroni.com/tutorial/unicorn-hat/getting-started-with-unicorn-hat 8x8 and 4x8 hats that come ready to plug into the 40 pn header of the RPI, no wiring needed, but you need a level shifter (3.3 <-> 5V for the signal)
Screen Shot 2017-04-09 at 18.17.39.png
Screen Shot 2017-04-09 at 18.17.39.png (922.81 KiB) Viewed 11994 times
yellow = signal cable pin# 12 (GPIO18); green = V+5V pin#2; blue =GND = pin# 9

3. cheap ones e.g. : Kuman 100pcs WS2812B 5050 Addressable SMD . They go for $18 for 100 =$0.18 a piece. They are single pieces, still on the boards as the come out of the assembly. You need to solder them together. Not very complicated. connect V+ and ground all the way through and the signal out goes to signal in on the next LED (middle wire)
Screen Shot 2017-04-09 at 17.09.28.png
Screen Shot 2017-04-09 at 17.09.28.png (269.49 KiB) Viewed 12014 times

in total like this:
Screen Shot 2017-04-09 at 17.05.28.png
Screen Shot 2017-04-09 at 17.05.28.png (513.06 KiB) Viewed 12014 times
and you need a level shifter

4. Mongunkit. cheapest. they need a 470 ohm resistor in the data in cable after the level shifter, but quality seems to be good

Karl

level shifter e.g.: https://www.amazon.com/I2C-Logic-Level-Converter-Bidirectional/dp/B06XSC6D76/ref=sr_1_10?ie=UTF8&qid=1491775978&sr=8-10&keywords=level+shifter+3.3v+to+5v
Screen Shot 2017-04-09 at 19.03.13.png
Screen Shot 2017-04-09 at 19.03.13.png (104.06 KiB) Viewed 11990 times

depending on your level shifter you might not need the +3.3V,... only 3 cables: V+5, and and signal.
And ground can be picked up from any ground pin on the RPI. You could just use the even pin row V+5(pin2,4) and ground(pin6) and signal (pin12=GPIO18)

Re: pi-Beacon:16 NEO pixel LED

PostPosted: Wed Apr 12, 2017 5:18 pm
by kw123
neo pixel indigo RGB dimmer device

First setup a neo-pixel device where you configure the format (e.g. 8x8 or 1x10 LEDs), which pins , which RPI etc.

Second setup one or more pibeacon/ neopixel- dimmer devices. There you specify which of the LEDs of the just defined (firs step) neo-pixel device should be part of THIS dimmer device.
You could select all, or 1, or 3 of the LEDs. So you could for a 1x10 neo-pixel device have up to 10 dimmer devices, one for each LED -- or just one for all LEDs
Screen Shot 2017-04-13 at 14.11.18.png
Screen Shot 2017-04-13 at 14.11.18.png (64.54 KiB) Viewed 11878 times

. In the example:
The pin numbering format is y,x with y,x = 0,..n ; n=. # of pixels in row, # positions in row, so for a 1x10 that would be y=0 and x=0..9, for a 8x8 y=0..7 x=0..7
The * is a shor tcut for all LED, This field will overwrite the individual pins above.
to enter a list use e.g.
[[0,0],[3,2],[2,5],[7,7]] or a referencee to a variable with v%%:variName%% or v%%:variID%% and maintain the list there .

without the *, the pins
y=1,x=2
y=2,x=2
y=0,x=1
would be used

Then you can use standard indigo dimmer commands in the UI or scripts to set the LED RGW/W levels.
Screen Shot 2017-04-12 at 18.09.42.png
Screen Shot 2017-04-12 at 18.09.42.png (58.46 KiB) Viewed 11944 times

The neo pixel devices come with a warning on the brightness of the LED's , in fact a 10x10 for $19 ON gives light ~ 100W incandescent light.

if you have that many you must make sure that your RPI power supply can deliver the current 18mA / LED : 100LEDs = 1.8Amps )


Karl

Re: pi-Beacon:16 NEO pixel LED

PostPosted: Thu Apr 13, 2017 5:45 am
by johnpolasek
Can you use an independent external 5V supply rather than trying to push it all through the rPi's USB in and DIP out? I'd start worrying about the traces on the board frying with that level of current.

pi-Beacon:16 NEO pixel LED

PostPosted: Thu Apr 13, 2017 6:49 am
by kw123
I am using a 10x10 through a 2.5amp power supply --- USB -rpi- header - cable - neopixel And that seems to work fine.

But yes you can use an external power supply.

Sent from my iPhone using Tapatalk

piBeacon-16- neo-pixel II

PostPosted: Wed Jun 14, 2017 11:01 am
by kw123
this thread will be discussing NEO-PIXEL usage

1. neo-pixel CLOCK

2. neo-pixel Thermometer

3....

how to connect:

for most NEOpixel devices:
connect the NEO-pixel rings through a level shifter (3.3--5 V) to your RPI
V+5V pin2 , -- to V+5 on shifter , to V+ on NEO-pixel device (if current is < 0.5Amps)
GND- pin 6, -- to shifter GND to gnd on NEO-pixel device
Signal = pin 12 -- level shifter -- D-IN on NEO-pixel device
red =V+5, black = ground, yellow = signal
Screen Shot 2017-06-14 at 12.49.56.png
Screen Shot 2017-06-14 at 12.49.56.png (436.44 KiB) Viewed 11893 times


The PI-HUT NEO-pixel shields come with level shifter build in

if you need extra current you need to add an external power supply to the V+5 on the NEOpixel device and then do not connect the RPI +5 but the V+3.3 to the 3.3V pin on the level shifter.
here with 3 and 5 v separate
Screen Shot 2017-06-14 at 12.58.36.png
Screen Shot 2017-06-14 at 12.58.36.png (948.5 KiB) Viewed 11879 times



Karl

Re: piBeacon-16- neo-pixel -II

PostPosted: Wed Jun 14, 2017 11:06 am
by kw123
NEO-PIXEL Clock

create an indigo device pibeacon/ neo-pixel-clock and set the following parameters:

connect the NEO-pixel rings through a level shifter (3.3--5 V) to your RPI
V+5V pin2 , -- to V+5 on shifter , to V+ on NEO-pixel devcie
GND- pin 6, -- to shifter GND to gnd on NEO-pixel device
Signal = pin 12 -- level shifter -- D-IN on NEO-pixel device. If the neo pixel device does NOT have a 300-500 Ohm input resistor you need to add one between the level shifter and the neopixel
The Adafruit device all have it on board,50% of the china direct import / no name do NOT have it.

with 3 rings you can get this:
Screen Shot 2017-06-14 at 12.08.43.png
Screen Shot 2017-06-14 at 12.08.43.png (838.88 KiB) Viewed 11903 times

11am 58 minutes and6 seconds, make at 0/15/30/45 secs (dim blue) and dim red on the HH rings at 0 (not well visible in the pic)


with the following config and a 9 ring device http://www.ebay.com/itm/1-241-Bits-WS2812B-5050-RGB-LED-Ring-SK6812-RGBW-RGBWW-with-Integrated-Drivers/311818425481?ssPageName=STRK%3AMEBIDX%3AIT&var=610685425533&_trksid=p2057872.m2749.l2649
Screen Shot 2017-06-20 at 19.59.52.png
Screen Shot 2017-06-20 at 19.59.52.png (212.57 KiB) Viewed 11708 times
Screen Shot 2017-06-20 at 20.00.05.png
Screen Shot 2017-06-20 at 20.00.05.png (100.47 KiB) Viewed 11708 times

with 9 rings(1/8/12/16/24/..48/60 rings you get this:
Screen Shot 2017-06-20 at 20.28.41.png
Screen Shot 2017-06-20 at 20.28.41.png (804.11 KiB) Viewed 11706 times

this is how the cabling looks like:
Screen Shot 2017-06-20 at 20.05.36.png
Screen Shot 2017-06-20 at 20.05.36.png (1.97 MiB) Viewed 11708 times

4 cables from RPI to level shifter(and, signal, +5V,+3.3V); 3 from level shifter to device (signal through a 470 Ohm resistor) The cable do not have to be big as not many LEDs are lit.

You can select 1/3 pixel to show per HH/MM/SS and show HH/MM/SS one several rings . Then each of the pixels can be stead or blink once per 1,2,5,10,15,30,60 seconds. e.g. at SS=0 or 10,20,30,.. or 0/15/30/45 seconds etc .

Karl

Re: piBeacon-16- neo-pixel II

PostPosted: Wed Jun 14, 2017 11:24 am
by kw123
NEO pixel thermometer
1. define a NEO pixel device in pibeacon:
Screen Shot 2017-06-14 at 12.17.32.png
Screen Shot 2017-06-14 at 12.17.32.png (88.63 KiB) Viewed 11902 times


2. creta an action / pibeacon/ thermometer
Screen Shot 2017-06-14 at 12.16.41.png
Screen Shot 2017-06-14 at 12.16.41.png (198.99 KiB) Viewed 11902 times

Screen Shot 2017-06-14 at 12.16.52.png
Screen Shot 2017-06-14 at 12.16.52.png (128.58 KiB) Viewed 11902 times


3.then you get:
Screen Shot 2017-06-14 at 12.15.47.png
Screen Shot 2017-06-14 at 12.15.47.png (207.03 KiB) Viewed 11902 times


you need to create and indigo variable "tempDisplay" hat should contain the current temp in F (for this setup)

then trigger the action when the variable changes and you will have a very large thermometer going from blue (=0 FÂș .. green 70F .. red 120F) and a white dot where the current temp is
and dim white dots at 20/40/60/80/100 F

Karl
and also here connect to RPI V+5, signal through level shifter and GND as described above

Re: piBeacon-16- neo-pixel II

PostPosted: Wed Jun 14, 2017 5:08 pm
by kw123
Example script to
1. read current neo pixel intensity [0..100]
2. set device property intensity if < 60 to 70
3. send update to RPI where the NEO pixel is attached to.
you can use the Devices name or device ID to get / set the properties

it takes 1-10 seconds for the neoPixel to dim or increase light -- depending on when the RPI reads the new config file

Code: Select all
import datetime, time, json
plug = indigo.server.getPlugin("com.karlwachs.piBeacon")
limit               = 60
newIntensity        = 70
PiserverToSendTo    = "13"
neoPixelClock       = 667725192

# get currenbt intensity settings
data   =json.loads(plug.executeAction("getAnyProperty",props ={ "deviceNameOrId" : neoPixelClock ,"propertyName":"intensity"}))
intensity = int(data["intensity"])

if intensity > limit: return

indigo.server.log("setting intensity of Neopixel from"+ str(intensity) +" to : "+str(newIntensity))

plug.executeAction("setAnyProperty",props ={ "deviceNameOrId" : neoPixelClock ,"propertyName":"intensity", "propertyContents": str(newIntensity)})
time.sleep(0.1)
# then send config to RPI
plug.executeAction("sendConfigSocket",props ={ "configurePi" : PiserverToSendTo })

Re: piBeacon-16- neo-pixel II

PostPosted: Wed Jun 14, 2017 8:56 pm
by kw123
tested neo pixels devices:

they must state WS2812B 5050 RGB 5Volt
the 12V have 3 RED 3 GREEN and 3RED LED insures, so you can not address single LED's
They might work but I don't know how the level converter works with them

1. PI-HAT neo pixel, very good quality, they fit directly onto the Rip. they come in various forms, 2x8 .. 8x8
2. simple long strips, water proof or "naked" from 10 .. 240 (tested that one. you can get them from china for
300 for $9
http://www.ebay.com/itm/5m-300-LED-Flexible-Strip-Light-Black-PCB-5050-SMD-RGB-Waterproof-tape-lamp-12V-/232352508544?var=&hash=item361949ea80:m:mNPYd0vVHLmFTbzmNlix8Aw
3. rectangles in all kinds of forms and shapes, some raw from the production line, not wired others prewired.

4. rings:
http://www.ebay.com/sch/i.html?_from=R40&_trksid=p2047675.m570.l1313.TR0.TRC0.H0.Xneo+pixel+rings.TRS2&_nkw=neo+pixel+rings&_sacat=0 single rings to a whole set of rings with up to 60 LED in the outer ring ==> good for the clock

They all seem to work fine. it is a commodity and likely not worth paying for "quality"

Re: pi-Beacon:16 NEO pixel LED

PostPosted: Tue Jun 20, 2017 9:36 pm
by kw123
if you see flickering and random patterns when you use a neopixel device you must disable 3.5 mm audio output in sudo rasp-config:
1. advance options
2. Audio
3. "Force HDMI" and absolutely not" force 3.5mm "

and reboot

that audio output channel use the sam hardware as the neopixel device

normally you don't see it but when you start the x11 window (graphical user interface) or other programs it enables some drivers and they are active.
Then you get random pattern on your neoPixel

Karl

Re: pi-Beacon:16 NEO pixel LED

PostPosted: Wed Jun 21, 2017 1:50 pm
by johnfdl
Heck, I don't even know what the things for and part of me wants to buy one. I'm curious.....what are folks are using these NEO pixel LED things for?

Re: pi-Beacon:16 NEO pixel LED

PostPosted: Wed Jun 21, 2017 3:41 pm
by kw123
A) Nice analog/digital clock, my sister wants to have one too and wife is cool with it
B) Thermometer (1 meter long) for temp and status
C) background lighting

Re: pi-Beacon:16 NEO pixel LED

PostPosted: Wed Jun 21, 2017 4:24 pm
by johnfdl
Reminds me of those souped up cars with the green lights on the undercarriage. Might make nice under-cabinet lights, but I already have LEDs under there, attached to an occupancy sensor so they come on when you enter the kitchen and go out after 5 mins or no motion. In fact, many rooms in my house have this approach (laundry room, powder room, nearly every room in the basement, study, etc). I put these inexpensive switches in when I shut down my X10 many years ago. These work great, but are not connected in any way to Indigo. That said, they really don't need to be. Ever since I put them in, I no longer worry about the basement light being left on for days on end (as no one goes down there often). A zwave version of them would be nice.

Sorry.....getting off-topic! Thanks for the use-cases. Interested in folks have other use-cases.....still trying to find a reason to pull the trigger on them.