Welcome to Synthiam!

Program robots using technologies created from industry experts. ARC is our free-to-use robot programming software that makes features like vision recognition, navigation and artificial intelligence easy.

Get Started
United Kingdom
Asked — Edited

Running A Led Of Port D6

Hey guys.

I have a couple of general questions regards running LED's off a digital port.

1. I hooked up a 3V LED to the signal and ground pins on D6 on my v4 earlier today, made a little digital on, sleep 5 seconds, digital off script to test it but all it would do is very quickly flash once. I changed it over to port D12 and it worked fine. Any reason why D6 didn't work? The port is fine as I tested it with a servo. I was just wondering if it's because D6 is also a UART port as well and this may have caused the issue.

2. Any ideas if I could power a set of 20, 3v fairy lights off the V4 signal and ground pins? I lent my multi meter out so I can't test the amp output of the LED's. They normally run off two 1.5v AA batteries. Could 20 bulbs be too much?

Thanks.:)

AI Support Bot
Related Content
Synthiam
Based on your post activity, we found some content that may be interesting to you. Explore these other tutorials and community conversations.
United Kingdom
#17  
Lol, sorry I'm confusing myself now :P. Let's try again.

Rich mentioned using the Vcc pins with a TIP122 circuit which will allow me to use the 5 amps from the Vcc pin. What I wanted to confirm was that using a regulator, that would have to be 5 amps too. For example, the 5v regulator from the shop only supplies 1 amp and would not be sufficient. Is that right?

I have two sets of 20 bulb LED strands, one is 3v and the other is 4.5v. I'm only looking at using one of these.
United Kingdom
#18  
It depends on the current draw of the LEDs. 1A will drive 50 x 20mA LEDs (1A/0.02A).

The regulator can be whatever you need it to be. You can't have too many amps but you can have not enough. A 1A may do but it will depend on the current draw of the LEDs.
#19  
The Tip circuit is more or less just a switch.... It probably has a limit to how many amps can be pulled through it, but I don't think we're talking about any number we need to worry about... I have a 12V high output 24 super bright led array that only draws about 200ma (at 12V).... So I think your led light strip is probably going to be in the same neighbourhood... So I would have to say the voltage regulator from the store would be fine... So your light strip is 5V meant for an RC controller? You can also do the same with a LM7805 voltage regulator....
United Kingdom
#20  
No, the "light strip" I'm referring to are the battery powered Xmas fairy lights. Anyway thanks for explaining and clearing that up guys. I've been testing things in a couple of the spare ports on K-9's EZ-B. I'm ordering a new one at the end of the month and my new project will be using pretty much every available port (digital and analog), so not much room for error.

Thanks again Rich and Richard.:)
#21  
No worries Steve.... If you're curious you could pull out the ole' multimeter and see how much the light strip is pulling in the way of mAs..... The higher the voltage the less power the strip will use (mA wise).... So I would try and use the max voltage that the strip is rated for... if you can that is....
United Kingdom
#22  
Yeah... multimeter. Sore point with me at the mo. I lent it to a friend "for the evening" over a week ago. Still waiting for it. *mad*
United Kingdom
#23  
@Richard.

Hey, you mentioned about using a relay switch like the one you linked to and I just found this on Amazon. I just wanted to ask about hooking it up. I get the Ground, +5v and signal in the right, but what are the terminals on the left (NO, COM, NC), and to which ones would a need to connect a two wire LED string?

User-inserted image
United Kingdom
#24  
NO = Normally Open (i.e. when the relay is not powered/the EZ-B isn't set to high) the contact is open
COM = Common
NC is normally Closed (i.e. when the relay is not powered/the EZ-B isn't set to high) the contact is closed.

So, you would have your Vcc to Com. The LED, light, motor whatever connected to NO and the other side of it to ground. When the signal pin of the digital port is On/High it would close the contact and whatever is connected would work.

If you wanted it to work when the EZ-B signal was low/off (including if the EZ-B is powered off) then connect between Com and NC.
United Kingdom
#25  
A bit more info/diagram for clarity;


User-inserted image


The switch in the relay is moved by the electromagnet from NC to NO when the relay is energised.
United Kingdom
#26  

Quote:

the other side of it to ground


Thanks Rich. Just to confirm from what you said, the other side (LED wire) goes to a ground on the battery. So this doesn't need a common ground then?

EDIT: Forget what I said about common ground. I'm going to power the LED's (with a 5v reg) from spare ground and Vcc pins on a port which a ping echo uses.

Thanks again buddy.
PRO
Synthiam
#27  
If you ask Jeremie - he can help you with a mosfet schematic that can connect to the PWM of the ez-b and give you brightness control:D
United Kingdom
#28  
Thanks DJ. I may just do that.;)
#29  
As I recall those relays need 5V to operate and the EZ-BV4 is 3.5V. You will require a converter like a EzSBC.com LS1
United Kingdom
#30  
@bookmaker32

Indeed they are 5v. I'm going to power it from spare ground and Vcc digital pins through a 5v regulator (post#27). Thanks though.:)
PRO
Canada
#31  
Here's the thread that I believe @DJ is referring to. P-Channel FETs are used for switching/dimming the positive voltage side. But as the other folks on the forum have suggested a TIP high current transistor would work, or an N-channel MOSFET (for switching the negative side of the LEDs) would work as well.

@Bookmaker32 funny enough some relay coils will still respond to a lower voltage. I remember switching a 9V relay with 5V in the past.
United Kingdom
#32  
Thanks Jeremie. I'll take a look.
#33  
@jeremie I agree however I have learned the hard way with these cheap Chinese relays.
#34  
@Steve...As mentioned before... I have and use these and they are guaranteed plug and play with the ezb4... They can switch up to 2 amps and are pretty cheap.... 5V relay
#35  
@Steve Good find! The Songle pictured in reply #24 will definitely not work with 5v.
Edit: I meant 3.5 volts.
United Kingdom
#36  
@bookmaker.

Quote:


5V 1-Channel Relay interface board, and each one needs 15-20mA Driver Current
Equipped with high-current relay, AC250V 10A; DC30V 10A
Standard interface that can be controlled directly by microcontroller, such as Arduino , 8051, AVR, PIC, DSP, ARM and so on
Contact independent wiring, safe and reliable
With screw holes for easy installation
Size: 42 x 24 x 20mm
Package Include:
1* 5V 1 Channel Relay Module Board


According to the write up, it should work at 5v.

EDIT: I've just seen your edit. No worries.;)