element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Raspberry Pi
  • Products
  • More
Raspberry Pi
Raspberry Pi Forum How to solder fairy light strings
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Raspberry Pi to participate - click to join for free!
Featured Articles
Announcing Pi
Technical Specifications
Raspberry Pi FAQs
Win a Pi
Raspberry Pi Wishlist
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Not Answered
  • Replies 14 replies
  • Subscribers 662 subscribers
  • Views 6105 views
  • Users 0 members are here
Related

How to solder fairy light strings

scottiebabe
scottiebabe over 3 years ago

I have been experimenting with tri-state multiplexing with the Rp2040's PIO statemachine and have found good success.

The PIO code is quite interesting in that its quite different from how I might write it in c-code in a repeating ISR. I may write a blog about it in the future, but here is the code:

# Tri-state multiplexing with done with PIO statemachine
# -scottiebabe 2022
import time
from machine import Pin
import rp2

# Ensure pin pull-ups and pull-downs are disabled
# So pin is Hi-Z when set as input
Pin(0,Pin.IN)
Pin(1,Pin.IN)
Pin(2,Pin.IN)

@rp2.asm_pio(out_shiftdir=rp2.PIO.SHIFT_RIGHT,set_init=[rp2.PIO.OUT_LOW]*3,out_init=[rp2.PIO.OUT_LOW]*3)
def charlie():
    pull(noblock)
    mov(x,osr)
    # Set Pin0 & Pin1 as outputs
    in_(null,2)
    in_(osr,1) # output state of LED0 on Pin0
    out(null,1)
    set(pindirs, 0b011)
    mov(pins, isr) [7]
    in_(null,1)
    in_(osr,1) # output state of LED1 on Pin1
    in_(null,1)
    out(null,1)
    mov(pins, isr) [7]
    
    # Set Pin0 & Pin2 as outputs
    in_(null,2)
    in_(osr,1) # output state of LED2 on Pin0
    out(null,1)
    set(pindirs, 0b101)
    mov(pins, isr) [7]
    in_(osr,1) # output state of LED3 on Pin2
    in_(null,2)
    out(null,1)
    mov(pins, isr) [7]

    # Set Pin1 & Pin2 as outputs
    in_(null,1)
    in_(osr,1) # output state of LED4 on Pin1
    in_(null,1)
    out(null,1)
    set(pins,0)
    set(pindirs, 0b110)
    mov(pins, isr) [7]
    in_(osr,1) # output state of LED5 on Pin2
    in_(null,2)
    out(null,1)
    mov(pins, isr) [7]


# Create the StateMachine with the charlie program, outputting on Pins 0-2.
sm = rp2.StateMachine(0, charlie, freq=20000, set_base=Pin(0),out_base=Pin(0))

# Put bitmap into pio statemachine
sm.put(0b101)

# Start the StateMachine.
sm.active(1)

i = 0
while True:
    i += 1
    sm.put(i % 64)
    time.sleep(0.1)

I would like to try and make my own fairly light strings with three wires and 6 LEDs, similar to these

image

What do you think the best way to solder the LEDs to wires would be?

I'm thinking maybe use a piece of perfboard to hold everything in place while soldering

image

  • Sign in to reply
  • Cancel
Parents
  • dougw
    0 dougw over 3 years ago

    How about we cheat and just use 2 wires and no microcontroller....This is enameled wire where molten solder burns off the enamel. I stuck the LEDs to a piece of duct tape to solder them to the wire. Still very fiddly, although you could come up with a "production" method using tape. Basically stick the wires to tape patches on either side of an LED location, then burn off the enamel at the LED locations, then stick this wire ladder onto tape that has LEDs on it, then solder the LEDs to the wires. The wire costs about $1 for 10 m.

    You don't have permission to edit metadata of this video.
    Edit media
    x
    image
    Upload Preview
    image

    A whole string of these LEDs can run off of one coin cell.

    • Cancel
    • Vote Up +6 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Reply
  • dougw
    0 dougw over 3 years ago

    How about we cheat and just use 2 wires and no microcontroller....This is enameled wire where molten solder burns off the enamel. I stuck the LEDs to a piece of duct tape to solder them to the wire. Still very fiddly, although you could come up with a "production" method using tape. Basically stick the wires to tape patches on either side of an LED location, then burn off the enamel at the LED locations, then stick this wire ladder onto tape that has LEDs on it, then solder the LEDs to the wires. The wire costs about $1 for 10 m.

    You don't have permission to edit metadata of this video.
    Edit media
    x
    image
    Upload Preview
    image

    A whole string of these LEDs can run off of one coin cell.

    • Cancel
    • Vote Up +6 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Children
  • scottiebabe
    0 scottiebabe over 3 years ago in reply to dougw

    Heart eyes That is extra fancy! Although I think your solution might involve 6 state machines Wink

    I need to get some of those LEDs and make a string lol Its hard to compete with Dollar store price point, the only down side is the driver circuit (or complete lack there of)

    image

    They come with just a AA battery holder and a switch. Which is a very poor match to the Vf of white LEDs. Luckily the LEDs they use are reasonably efficient and are quite visible even at 1 mA.

    They has have color phosphor ones too Heart! 

    image

    • Cancel
    • Vote Up +6 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • dougw
    0 dougw over 3 years ago in reply to scottiebabe

    The 3-color LEDs I used each have a built-in chip that regulates current, and decides which color to illuminate and when. They are available in different flashing rate versions. The LEDs cost about $4 for 100 LEDs. Actually they aren't just LEDs, each device has 3 LEDs plus a driver chip in a 2 pin 0805 package..

    • Cancel
    • Vote Up +3 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • colporteur
    0 colporteur over 3 years ago in reply to dougw

    Are you able to share more details on the LED's? I'm looking for a replacement LED package and find that experience is the best feedback for picking something.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • dougw
    0 dougw over 3 years ago in reply to colporteur

    They seem to be hard to specify but if you search on Ali Express for

    0807 LED SMD Diode Slow Flashing Fast Flashing

    You will find  lots of them.

    I have no idea who the manufacturer is or what the real part number is.

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube