element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • 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
  • About Us
  • 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 663 subscribers
  • Views 6226 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
  • scottiebabe
    0 scottiebabe over 3 years ago

    This turned out to be quite a bit more challenging than I had thought.

    Marking the wires with a green/black sharpie (colors not important) was helpful.

    image

    Drilling a hole to hold the led didn't end up being helpful. Perhaps its wasn't the perfect size, not sure. The perfboard would hold the wires steady and I could hold the LED with tweezers and solder to one wire. Then move the nudge the other wire over and solder the second joint.

    Watch out for cheap LED lead frames. I started with white leds, but their mounting leads kept breaking off. So I switched to amber leds that had a solid plastic base surrounding the lead frame.

    0603 LEDs are small, 0805 would be much easier to work with.

    The lead frame fiasco threw off my groove, and forgot to pay attention to mounting polarity.

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

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

    This turned out to be quite a bit more challenging than I had thought.

    Marking the wires with a green/black sharpie (colors not important) was helpful.

    image

    Drilling a hole to hold the led didn't end up being helpful. Perhaps its wasn't the perfect size, not sure. The perfboard would hold the wires steady and I could hold the LED with tweezers and solder to one wire. Then move the nudge the other wire over and solder the second joint.

    Watch out for cheap LED lead frames. I started with white leds, but their mounting leads kept breaking off. So I switched to amber leds that had a solid plastic base surrounding the lead frame.

    0603 LEDs are small, 0805 would be much easier to work with.

    The lead frame fiasco threw off my groove, and forgot to pay attention to mounting polarity.

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

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Children
No Data
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