Тёмный
No video :(

Easily Add Sensors & Outputs To DCC++ 

Toms Trains and Things
Подписаться 29 тыс.
Просмотров 15 тыс.
50% 1

Two part series on how to easily add sensors, and outputs to your DCC++ Bast Station. In this first video, we cover adding the sensors and outputs directly to the base station through the serial monitor in the Arduino sketch.
These values are not entered into the sketch, but stored in the EPROM on your Arduino device. In this case it's a Mega 2560.
I'm using a Sunfounder Mega, DF Robot Sensor Shield, and a Deek-Robot motor shield. These are all generic devices that can be purchased for under $30. There are links om my Amazon/Arduino Projects page, but they can be purchased cheaper through DF Robot & AliExpress.
Sensor Shield:
www.dfrobot.co...
Deek Robot Motor Shield:
www.ebay.com/i...
S U P P O R T THIS C H A N N E L
LOCALS: trainofthought...
Rumble: rumble.com/c/T...
Amazon Link:www.amazon.com...
PayPal : paypal.me/toms...
Membership:
/ @tomstrainsandthings
Music on all videos from Epidemic Sound. Get One Month Free when you subscribe through this link. Here is a short playlist
share.epidemic...
CONTACT INFORMATION:
workbenchwednesday@gmail.com
tomstrainsandthings@gmail.com
tomstrainofthou...
#tomstrainofthought
#structurekits
#floridatrainshows
Disclaimers: all opinions are my own, sponsors are acknowledge.
Intended for viewers over the age of 14

Опубликовано:

 

25 авг 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 33   
@DominicFawver
@DominicFawver 4 года назад
I just started messing with this part of DCC++, so perfectly timed :)
@TomsTrainsandThings
@TomsTrainsandThings 4 года назад
Glad it was helpful
@frightrisk7407
@frightrisk7407 3 года назад
Just wanted to let you know that this is not the way it works for outputs. The command is , the IFLAGS are not separate parameters, they are bitflags in a byte. You have to do some binary to decimal math. So you have bits 0,1 and 2 reading from right to left line this (2,1,0). Those are position numbers since a bit can only hold a 1 and a 0. So if bit 1(the rightmost bit) is a 0 or a 1, it is easy since the decimal value you would enter is the same, a zero or a one. But to compute the others, the easiest way is to use the power of 2 based on the position of the bit. So 2 to the 0 power is 1, 2 the the 1st power is 2, 2 to the 2nd power is 4. So you just add those numbers together if they have a 1 in them. So 001 is 1, 010 is 2, 100 is 4.. So to set bit 0 and 2 to one, you add 1 and 4 and get 5. To set the fist two bits on, which looks like 011 to the computer, you add 1 and 2 together and get 3. You are counting in powers of two instead of powers of 10. Those 3 bits can hold 8 possible combinations of 1s and 0s. There are free online calculators in addition to the one that comes with windows that let you just turn bits on and off and it will give you the number ;)
@TomsTrainsandThings
@TomsTrainsandThings 3 года назад
Thanks for your input! At least someone knows how to do it!
@bernardc2553
@bernardc2553 4 года назад
What was I think N... OH YAH... Tom.. your the best teacher !!!
@TomsTrainsandThings
@TomsTrainsandThings 4 года назад
Thanks Bernard
@MomentumChaser0331
@MomentumChaser0331 7 месяцев назад
My Man knows his S ah Stuff 😁👌🏼👍🏼👍🏼🙏
@TomsTrainsandThings
@TomsTrainsandThings 7 месяцев назад
Thanks
@MomentumChaser0331
@MomentumChaser0331 7 месяцев назад
@@TomsTrainsandThings Yes Sir I like Train’s Specially Ho Style Sir and I am working on this system that you set up here for my very own set up and testing Sir and thank you for sharing with us
@Chris-xh4hw
@Chris-xh4hw 4 месяца назад
So this board will only take IR sensors which run on 3.3v. I have a IR sensor which is 5v.
@TomsTrainsandThings
@TomsTrainsandThings 4 месяца назад
I have IR sensors and relays in this video, all 5vdc. This is an I/O sensor shield, that means any input or output that has 5vdc. The pins are clearly marked as Input or output, but they can be changed in code which I discussed in another video
@ArenINMotion
@ArenINMotion 4 месяца назад
So if I have a relais on pin 128 on my PCA9685 (#41) and I set it with 7 is bit 0,1,2 high. I store it in the eprom with But with what command can I set the relais?
@TomsTrainsandThings
@TomsTrainsandThings 4 месяца назад
T= turnout, Z=relay, S=sensor. To set them in eprom, use E, this will set any sensor in. As shown at 7:15
@DudeFrom1972
@DudeFrom1972 3 года назад
Video request: How to install a decoder in a railwagon to operate a feature like internal light.
@SheltonDCruz
@SheltonDCruz 3 года назад
Thanks Tom!
@TomsTrainsandThings
@TomsTrainsandThings 3 года назад
You are welcome!
@BillMastersMRR
@BillMastersMRR 5 месяцев назад
How long of a wire run can the sensor be from the arduino? Say the ir sensor is 20 feet away from the arduino? Will it keep enough signal for the Arduino to read on that far of a run?
@TomsTrainsandThings
@TomsTrainsandThings 5 месяцев назад
I think the developers at DCC-EX tested the length of leads for sensors and servos at 20 ft. also with success. Although they use a PCA9685 for the control with the Arduino. I personally kept my Arduino close to where I was using sensors and servos. I have used a 50ft+ 4 pair twisted pair telephone cable to operate Tortoise switch machines in the past. The best way to find out is to experiment to see if it will work in your case
@BillMastersMRR
@BillMastersMRR 5 месяцев назад
@TomsTrainsandThings , Thanks. After asking I got to reading about using cat6 cable for extending the distance between I2C devices. Seems to be the way to go.
@joelvale3887
@joelvale3887 4 года назад
Welcome to the oldtimer's club.
@TomsTrainsandThings
@TomsTrainsandThings 4 года назад
Been in that club for a while!
@JamesNortonJones
@JamesNortonJones 2 года назад
I'd wondering how you connect the power to the DF Robot Shield and the Motor shield, to they have their own power supplies or does the sensor shield power the motor shield? Thanks
@TomsTrainsandThings
@TomsTrainsandThings 2 года назад
You can see the barrel connector in the video and me explaining the switch to change from the Mega power or the external power. The motor shield is powered in the same way with external power which is explained in the DCC++ videos
@JamesNortonJones
@JamesNortonJones 2 года назад
@@TomsTrainsandThings That's great thanks for clarifying.It was just in the video it didn't show the power connector on the motor shield ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-TdISgXAyiOY.html. I really appreciate the reply.
@whiiiz9410
@whiiiz9410 2 года назад
Is it possible to enable WiFi using the DFROBOT ESP8266 WiFi Bee since we are already using the DF IO Shield instead of the recommended MakerFabs ESP8266 WIFI Shield?
@TomsTrainsandThings
@TomsTrainsandThings 2 года назад
Not with DCC++ but you might want to check into DCC++EX to see if that is one of the compatible wifi devices
@whiiiz9410
@whiiiz9410 2 года назад
@@TomsTrainsandThings Sorry I forgot to mention that I'm using DCC++EX but it's not on the official list. As I'm using an UNO hooked up to JMRI via USB and wanted to add both Sensors and Wi-Fi, hence my question. It's very hard to get the MakerFabs Wi-Fi shield so I wanted to check with you since you already have the DF IO shield before ordering the Mega and other shields. Thank you for replying on such an old post, really appreciated.
@FBMRR
@FBMRR 4 года назад
Yeahhhhhh..... hmmmmmmm..... but,... right... ???????????????? Ill catch on sooner or later.
@TomsTrainsandThings
@TomsTrainsandThings 4 года назад
Easy as NCE. lol
@westwonic
@westwonic 3 года назад
'Easily add...' seriously?
@TomsTrainsandThings
@TomsTrainsandThings 3 года назад
Just enter the numbers and it's there!
Далее
Easily Add Sensors & Outputs To DCC++ Part 2
11:30
Просмотров 6 тыс.
🎙А не СПЕТЬ ли мне ПЕСНЮ?
3:09:39
Просмотров 1,6 млн
Я ДОСТРОИЛ ЗАВОД - Satisfactory
19:13
Просмотров 167 тыс.
Hi Resolution Block Detector (Video #33)
16:48
Просмотров 19 тыс.
🎙А не СПЕТЬ ли мне ПЕСНЮ?
3:09:39
Просмотров 1,6 млн