Animated Model Railroad Building Lights with Arduinos!
HTML-код
- Опубликовано: 26 авг 2024
- Connect with me at ddrrcommunity@gmail.com
Support the Channel on Patreon - / diyanddigitalrailroad
Code and Schematic
github.com/DIY...
1-2-3 blocks
amzn.to/3pS1xuA
Tamiya Cement
amzn.to/3QYUBHF
Starbond superglue
amzn.to/3AVx1pY
Styrene
amzn.to/3PUFo9d
Building kit
www.modeltrain...
Arduino nano
amzn.to/3AQORdB
Nano shield
amzn.to/3pS2d36
LEDs
amzn.to/3CA3EKP
Wire
amzn.to/3RdpCYR
Amazon Store - www.amazon.com...
Etsy Store - www.etsy.com/s...
Facebook - / diyanddigitalrr
Instagram - / diydigitalrailroad
TRAIN SETS
N Scale Train Set - amzn.to/33TzsbS
HO Scale Train Set - amzn.to/311N17g
O Scale Train Set - amzn.to/3lAZCGu
G Scale Train Set - amzn.to/312Cn09
3D PRINTERS
Elegoo Mars 2 - amzn.to/3yopRaS
Creality Ender 3 V2 - amzn.to/3DOuKei
CAMERA
Sony ZV-E10 - amzn.to/3IK9pX1
MICROPHONE
Rode Wireless Go - amzn.to/33ipqDf
Rode Smart Lav - amzn.to/3dN6ChI
LIGHTS
Aputure Amaran 100D - amzn.to/3ELlysm
Aputure Amaran MC - amzn.to/3ER8Vfw
GVM 480LS 2 Light Kit - amzn.to/3EOTTGY
MOTION CONTROL
MOZA Aircross 2 Gimbal - amzn.to/3oNb4TG
MOZA Slypod E - amzn.to/3dMWtkQ
Channel Merch - teespring.com/...
Consider donating the PCOS Challenge to help women everywhere with PCOS
pcoschallenge....
“The godly may trip seven times, but they will get up again.
But one disaster is enough to overthrow the wicked.
Don’t rejoice when your enemies fall;
don’t be happy when they stumble.
For the Lord will be displeased with you
and will turn his anger away from them.
Don’t fret because of evildoers;
don’t envy the wicked.”
Proverbs 24: 16-19 NLT
You could also add a photocell sensor to start turning the lights on when darkness falls (i.e. you turn out the lights).
This video is about 2 years old and I dont know if anybody pointed it out already - but maybe the leds with the wires you use there already contain resistors. I have bought a few bags of them a few years back, prewired warm white LED with resistors included - so I could attach them directly on up to 16V. Works well on 12 V as well - if the interior walls are white like in your case it should even work from as little as 5 V on (resistor is 1kOhm iirc). The funny part ábout the LED I got .. they have a cylindrical shape at the end of 1/10 " - and are wider at the base so you could put them through the ceiling where they work similar to real light sources and the electric connection is hidden in the lighted room. On the other hand the wire is thin enough to hide it in corners or like you did in hidden rooms
You're doing awsome, Jimmy ❤️🔥❤️🔥❤️🔥
As a newbie, I'm really enjoying this series, for it applies instruction with application that bridges the esoteric thereby making it easier to understand the purpose of the code statements and the logic being utilized. From there, that understanding can be applied to all sorts of other instances not even related to model railroading. The scale of model railroading is very useful to this type of instruction, immediate application, highly visual, sound, motion, timing, responses to proximity, response to counted values, signal strength, etc... for a good grasp of micro-controlling or AI in general, not to mention the exercise of logic flow. It would be great if every school could have an area dedicated to model railroading for this purpose... for building, and programming as you tutor it. Students could then better understand the relationship between their code and result, instant feedback for best guidance. From there, the sky's the limit! Thank you so much. That said, I'm gonna click that Patreon link to support my appreciation and benefit from your channel. Learning with immediate application, is a very solid way to learn. The old saying, "If I only hear, I'll probably forget. If I see, I might remember. If I do, I'll understand." So far, I've enjoyed 2 out of 3 ... and it's time to get busy with the doing! Cheers! Keep safe, healthy, and happy!
My father, who worked for Ma Bell maintaining the switching equipment, taught me to use the side of the soldering iron barrel to make the shrink-wrap shrink.
Nice project and keeping it simple helps understand integrating microcomputers to scenery.
Awesome. Thanks!
Jimmy, this is a GREAT video illustrating how easy it is to add interior lights to a structure. I see a lot of models that look beautiful, but are not lit - even on the outside - and, in my opinion, this ignores a wonderful way to make our structures come to life. A few comments:
First, check out Roomettes lighting kits. They make very simple building interiors printed on cardboard and they include surface mounted LEDs. Many of their kits are designed to fit various DPM structures, and the others can be modified easily. That way, when the lights come on, you see an actual room, not just a white box. The LEDs they supply are compatible with Woodland Scenics Just-Plug lighting system, but they work just fine on 5 volts from the Arduino.
Second, your if statement should be a while statement: while (randomlight1 == randomlight2) { randomlight2 = random(3,7);} This guarantees the two lights will be different and you can skip the else if statement.
Third, you CANNOT use int timeon; if timeon will be larger than 32,767 (about 32 seconds)! If you want your light to be on for longer as you mention, you need to declare timeon as a long integer, like this: long timeon; Now, timeon can be as large as 2,147,483,647 - about 600 hours.
Fourth, I know that using delay() in the loop() function makes things easy, but it puts severe handcuffs on the Arduino: the processor cannot do ANYTHING else while the delay() statement is running. Suppose I want to turn a random room light on for a random length of time, then do the same thing for the other four rooms? This is a much more realistic animation, and absolutely impossible to do using delay(). The solution is easy to use, but too lengthy to show here. I will email two files to you; you can choose whether your audience would be interested.
If I saw the lights going on and off so often I’d be telling the kids to stop playing with the lights :)
Very cool video!! Now I have more choices in lighting my buildings
I'm now an Engineer Patreon... Gotta find me an Engineer's hat. Whoot ... Whoot!
Jimmy a good addition to any modelers kit is a set of brad point drill bits. By design they cut the outer edge before the full center so they have a smaller chance to get hung up and spoil the work.
You might explore the mili function rather than delay for timing as it does not stop the rest of the program while waiting.
Mahalo
Very cool Jimmy
Sorry - forgot to mention the Roomettes kits are only available in HO scale, but it would be easy to copy them at 54% to get N scale interiors.
A flickering blue LED could simulate a TV being on in a room!
Nice job Jimmy!! Some modelers give the interior and structure walls a quick spray of flat black to block light. BTW, if you increase the "on time" by using great big integers larger than 2 bytes with most Arduinos, you might have to declare them as long integers to get 4 btyes.
Really nice, like how you did the interior setup. I didn't realize you could use 12V leds and skip the resistors. One last thing did yu use an HO building to demonstrate the lighing on a building. My buildings are all DPM building and they sure look smaller than your building. Either that or my eyes are deceiving me ... Great video always a pleasure to tune in and learn new stuff !!!
It was easy to miss but he mentioned right at the beginning of the video that it was an HO scale building. LOL your eyes are fine!
@@garrettswoodworx1873 I guess it was my ears then.. I didn't catch it. It bytes getting old. Bummer!
@@edwardaudet8367 Trust me Edward I understand! (Getting old does beat the alternative, however!)
You may have noticed that the LEDs in the link are prewired with a resistor.
Cool
Outstanding episode, Jimmy! A bit of everything in this nice salad mix to turn into a finished product. The Sketch did a nice job of allowing each area to act independently, as well as together at times as it might in a real world. Really liked the clever way you handled separation for the random cases, by forcing a go back if equal. Well played. Curious.. Is that work surface mat specific to RR scale dimensions?
Looks great Jimmy! Can you add other things to that Nano (sp?) or is it now committed to that structure and lights only? Would you have to purchase another Nano for another structure?
I really enjoy your projects. Have you ever used the UNO to create engine noises on a diesel locomotive?
Nice job Jimmy, thanks to posting all the links of the products you were using in this build. How long did the Tamiya glue take to set and dry. Did you use an accelerator? Thanks.
May I know what tools are needed in this video?
Looking Very nice ! It looks like I might eventually get there, almost ready to top out on my layout. Does your square convert inches or mms to HO & N scales? If you turn your project 90° & put it parallel to the front edge of your workbench you can use a pair of clamps to hold it in place (yes, I’m truly OCD).
Great video, I just put together some structure lighting but added four more lighting pins (total eight) I'm also using an Arduino Uno. The code you wrote worked great, just modified for the additional outputs however noticed the random lighting stops when it reaches the end, is there additional coding required to keep the random lighting sequence continually going?
Another interesting segment....forgive me if I ,issed a bit but was wondering...can these Arduino bus units be programmed for flickering and dimming your leds? Cheers in advance.
It's a nice little project Jimmy but you lost me at the coding 😵💫