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
  • fmilburn
    0 fmilburn over 3 years ago

    I did something similar several years ago.  And by coincidence I have been thinking about adding LED lighting to Lego projects with the grandkids so I'm interested in how you end up doing it.  I used a scrap wood block and woodcarver's chisels to construct my jig which looked something like this, although not near this neat or precise:

    image

    I used a small V-shaped chisel to cut parallel lines to hold the wire in place.  Then I cut a rectangular slot for the LED to sit in with a small straight chisel.  Wood might seem like a strange choice but it worked fine for the dozen or so connections made and was still good for more use.  The jig was also handy for getting the right spacing.  The main issue was getting the wire to lay flat alongside the LED which is what the V-shaped troughs were supposed to do. I used painter's tape to help hold the wire in place while soldering.  I suspect your approach with the perfboard will work as well or better.

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

    That's very clever, I like it! I like your LED recess, there is no way for the LED to fall through Slight smile. Drilling a hole didn't end up being helpful for me. I found it easier to hold the led with tweezer and solder one wire.

    I did like that I could mash my soldering iron into the wire to tin the joint before attaching the LED.

    The painters tape tip was extremely helpful, thank you for the great tip!

    Your lego adventure sounds like a lot of fun Slight smile

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

    That's very clever, I like it! I like your LED recess, there is no way for the LED to fall through Slight smile. Drilling a hole didn't end up being helpful for me. I found it easier to hold the led with tweezer and solder one wire.

    I did like that I could mash my soldering iron into the wire to tin the joint before attaching the LED.

    The painters tape tip was extremely helpful, thank you for the great tip!

    Your lego adventure sounds like a lot of fun Slight smile

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

    Maybe put a tiny piece of Blue Tack down to hold the LED.  My granddaughter and I built the Lego "Andrea's Family House" kit a while back and lit it.  I'm thinking we might try something else.

    • 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