I would like help with an arduino project... FYI I am a complete novice.

69 views
Skip to first unread message

philip james

unread,
Apr 25, 2017, 9:55:03 PM4/25/17
to Norwich Hackspace

Hello

I'm new to this whole hackerspace thing but I've always been interested in making things, it's just my need for help with this particular project that has driven me to find the nearest space to me. I live in Thetford so I'd like to arrange a time to meet someone who I know can help me out instead of just turning up with a pile of parts and hoping someone will know what the hell I'm going on about.

So my project is a little obscure... If you know about broadcasting then you might know what I'm on about, but not many people do. I want to make a control interface for a 'Blackmagic ATEM television studio' which is a video switcher used in live video production. The product I will be basing this on is made by a danish guy called Kasper Skaarhoj. His products are very expensive but he has released some of his Arduino libraries for communicating with the ATEM system so, in theory, it should be possible to make my own interface based on this product (link). But having never coded in my life I'd be lying if I said I'm pretty lost. This is his GitHub (link) where you can view the library and he has a few videos explaining certain aspects of his products but they are really hard to navigate.

So like I said, I'm pretty bad at coding, that's what I'll need the most help with, but there are also a few hardware things that I'm not sure about and I thought I should ask about before I buy. This is the design I would like to go for (excuse the crude rendering, but it illistrates the point)



So the parts for this would be as folows

1x Some kind of housing to put it all in (yet to decide on that)
6x red LED lit arcade style buttons (as these are cheapest) (link)
6x green LED lit arcade style buttons (link)
1x white LED lit rectangle button (link)
1x potentiometer (for transition timer value input... I think that's what I'd need) (link)

and obviously an Arduino of some description, I'm not sure what will be best in that department, either an Arduino ethernet or the arduino mega with the ethernet sheild... I'm not sure how many pins I'd need for this project.

I will also need resistors, but I'm not sure what kinds, and also wires and solder for putting it all together. if you can see anything wrong with that list then please correct me.

I think that's everything. If anyone is interested in helping me out I'd love to hear from you! I'm also keen to go and check out the maker space at some point, this has given me an excuse to do so. I also understand if it's a little too complicated, It's a lot for me to take on as a first-time Arduino user and I have no idea how much time configuring all the code would take - If it's lots then I'll happily buy food and beverages for anyone involved and I would be really greatful for anyone who gives up their precious time for my project.

Thanks a lot.

Philip James.

Toby Catlin

unread,
Apr 26, 2017, 5:14:56 AM4/26/17
to Norwich Hackspace
Hi Philip,
First of all there is some good news that you don't have to do any coding as this has all been done for you, but you do need to be able to read a bit and understand what is happening. If you have not done so already you need to read the Getting started pages on the Arduino website: 

I recommend starting with an UNO as these are kinda considered the default board. Don't get too confused between all the different board types, they are largely the same and just differ in amounts of pins and memory. There is a vast range of boards because the project is open source and welcomes people to take the design and make their own versions. Some of the clones are a quarter of the price of original boards. The UNO has 14 input pins and it seems you have 13 buttons and a pot. If you plan on adding more features and buttons then you will need to extra pins a Mega provides. There are also other ways of reading buttons that use less pins like a matrix: http://playground.arduino.cc/Main/KeypadTutorial

You can buy from lots of places:

Once you have the board learn to upload code to the board. The most basic sketch (program for the arduino) is the blink sketch which turns a led off and on: https://www.arduino.cc/en/Guide/ArduinoUno

From looking at the readme and a bit of the video the core of this seems pretty straight forward. The Arduinos job is to send certain network messages when a button is pushed. The ATEM library he has supplied will deal with all of the complexity of the networking and detecting a button push is not very hard.

You need a bit of confit to set the MAC and IP address of the ethernet card and the IP address of your ATEM switcher:
byte mac[] = {
0x90, 0xA2, 0xDA, 0x00, 0xE8, 0xE9 }; // <= SETUP
IPAddress ip(192, 168, 10, 99); ATEM AtemSwitcher(IPAddress(192, 168, 10, 240), 56417);
The setup function 
void setup() {
// Set up pins for
pinMode(7, INPUT); // Cut
pinMode(2, INPUT); // Select 1 for Preview
pinMode(3, INPUT); // Select 2 for Preview
pinMode(4, OUTPUT); // LED: 1 is on Program (Tally)
pinMode(5, OUTPUT); // LED: 2 is on Program (Tally)
// Start the Ethernet, Serial (debugging) and UDP:
Ethernet.begin(mac,ip);
Serial.begin(9600);
// Initialize a connection to the switcher:
AtemSwitcher.serialOutput(true);
AtemSwitcher.connect();
}

This function is run once when the arduino starts up and is basics configuring various pins to be inputs for buttons or outputs for led displays. It then starts the ethernet, starts a serial interface and then starts the ATEM library.

The main loop function is then called repeatedly as quickly as the arduino can run it
void loop() {
// Check for packets, respond to them etc. Keeping the connection alive!
AtemSwitcher.runLoop();
// Write the Tally LEDS:
digitalWrite(4, !AtemSwitcher.getProgramTally(1));
digitalWrite(5, !AtemSwitcher.getProgramTally(2));
if (digitalRead(2)) {
if (pushButton !=2) {
pushButton=2;
Serial.println("Select 1");
AtemSwitcher.changePreviewInput(1);
}
} ...
The ATEM library calls runLoop which seems to check for data coming from the ATEM source thingy. Then is sets the tally LEDS (not sure what these are for but it is turning leds on and off). Next is the code which detects the button press on pin 2. If it detects a button press it sends a message to the serial interface and then runs AtemSwitcher.changePreviewInpiut(1). No idea what this does but it obviously will send some network message back to the ATEM source.

This is the kind of stuff we do quite regularly at the Hackspace and tools like the laser cutter would be ideal for making an box to put this all in. To get a decent usable finished project you will need to do some prototyping and mucking about. There are people that will help you with this project but the ethos is to learn and so the help will typically be giving direction and not walking you through every step. I guess what I am saying is that if you become a member nobody is obliged to help you but the whole vibe is to help and share. If that all sounds good to you then sign up as a member and get cracking.

toby

--
You received this message because you are subscribed to the Google Groups "Norwich Hackspace" group.
To unsubscribe from this group and stop receiving emails from it, send an email to norwich-hackspace+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

philip james

unread,
Apr 26, 2017, 11:11:42 AM4/26/17
to Norwich Hackspace, to...@korfball.com
Thanks for looking at everything so closely, I really appreciate it.

It's good that the coding has been done for me, I couldn't make heads of tails of it before but now that you've highlighted the important bits it definitely seems less daunting, just two things to clear up though:

- will the UNO have enough pins to take inputs from all the buttons, the pot, and also output pins to run the LED's? I'm not certain how that works but I was under the impression that you'd need a separate output for each LED in the system. The buttons will all be backlit, but not continuously. The red line of LEDs indicates which camera is currently live or 'on programme' as I think the code refers to it. And the green line of LEDs indicates which camera you have selected as 'preview'. The whole preview/programme thing isn't so hard to get your head around but it's hard to explain and easier to show, but my point is that the LEDs will turn off or on depending on what camera is on preview and what camera is on programme - which to my mind means that I'd need 13 output pins in addition to the 13 pins for the buttons.

- I also thought that the ethernet shield took up some of the pins, won't that effect my decision for picking which Arduino to go for?

- I'm not sure how to get the pot readout to change the amount of time it takes to transition between two sources (I will have to show you what I mean by that.)

I'm good at physically building things, although I got diagnosed with MS last year so now I'm a lot less precise because my fine motor control isn't brilliant, so having access to the different tools and machines you have would help a lot with that. I also have some hacks that I've made to make life with my disability easier which some people might find interesting, like making adapted cutlery using a thermosetting polymer, and a bunch of other projects, I'm good at being able to visualise how to design and assemble things to meet a need, so I should be pretty good at making the enclosure and I'm also happy to lend a hand to others projects, I'm pretty good at using sketchup, it's not the best 3d cad software but it's free and can be used for 3d printing which might help someone. Is Monday still when the space is open? once you've confirmed how many pins I'll need then I'll order the parts and sign up to become a member. 

Also, my mobility isn't great because of the MS and I can't currently drive because I'm blind in my left eye for now, so I might have to get the train from where I live in Thetford, is there a chance I could organise with someone to get a lift from the station? - I can always get a uber or something but there's no harm in asking.

Thanks again,

Phil.


On Wednesday, April 26, 2017 at 10:14:56 AM UTC+1, Toby Catlin wrote
To unsubscribe from this group and stop receiving emails from it, send an email to norwich-hacksp...@googlegroups.com.

Toby Catlin

unread,
Apr 26, 2017, 11:43:17 AM4/26/17
to Norwich Hackspace
The are many ways to skin a cat as they say.

If you are using the simplest methods then you will need 1 pin for every button and one for every LED indicator light. You need one for the pot and probably some for the ethernet shield. So that means you need a mega for that number of pins.


However...
There are LEDs called Neopixels. These can display any colour and can be daisy chained together. It is very easy therefore to drive 60 LEDs or so from one pin. You can buy them on their own or in sticks and rings. It would look pretty trick to use a ring around a button or put the LED inside the button.


You can also do some tricks so that you don't need a pin per button. Think about your keyboard, there is not a wire per key but an arrangement buttons in rows and columns.

So does that help you decide what board to buy? Probably not.
I would start with a Mega as you will probably need more pins as you advance the project.

hope that helps
toby

To unsubscribe from this group and stop receiving emails from it, send an email to norwich-hackspace+unsubscribe@googlegroups.com.

Toby Catlin

unread,
Apr 26, 2017, 11:48:48 AM4/26/17
to Norwich Hackspace

philip james

unread,
Apr 26, 2017, 2:51:45 PM4/26/17
to Norwich Hackspace, to...@korfball.com
I've ordered the Arduino and shield combo that you linked and also a cheap starter kit thingy with a breadboard, resistors, LEDs and buttons so that I can make a proof of concept. Hopefully, I can figure everything out and have something workable soon.

The neopixel things look cool, but if I'm going to the effort of putting my own LEDs into the buttons then I think that making my own buttons would save on space (and cost) if I could use the 3d printer. Would I have to supply my own filament? and if so then what type do you run?

I did just submit my member's application, do you know how long it will take to get a response? I'm pretty keen to see everything and meet the people who go.

Thanks again 
Phil.

Toby Catlin

unread,
Apr 26, 2017, 3:59:11 PM4/26/17
to Norwich Hackspace
We do have a stock of filament which you can use. There is a nominal cost which I cant remember right now but a few pounds would be enough for loads of buttons. We mostly use PLA although there maybe some other types available. Not sure if we have any transparent but if not it is something we would get in for member use.

The right approach to your project is definitely to work up to the final product. Once you the board run the blink sketch which proves everything is setup correctly and demonstrates the use of a output pin. Then I would do the button sketch as it demonstrates using a input pin. Then the potentiometer sketch as that demonstrates reading an analog value from input pin. Then try and load your ATEM code being aware it does involve installing a custom library to get the sketch to run (just follow the install instructions for an Arduino library). The hook it up to the switcher and see the values change in the serial monitor. Once you get to this point you have all the building block you need.

Congratulations on joining the Hackspace. Someone will be in touch shortly. 

toby


To unsubscribe from this group and stop receiving emails from it, send an email to norwich-hackspace+unsubscribe@googlegroups.com.

Marion Catlin

unread,
Apr 26, 2017, 4:19:14 PM4/26/17
to norwich-...@googlegroups.com
Hello Philip. Yes I have got application and will invite you to Slack shortly and send you new member guidelines. Welcome to Norwich Hackspace. Marion 
Reply all
Reply to author
Forward
0 new messages