I have been trying to find a real simple way to control an led light strip with my EZ-B. I have seen several circuits that I could make to do the job but would rather buy a mosfet circuit. I need to control a 12v light strip with 5v EZ-B signal. I found this board and wanted what the forum thinks.
Upgrade to ARC Pro
Your robot can be more than a simple automated machine with the power of ARC Pro!
I am using an IRF29 mosfet driver module with 12v in and out. The signal is coming from my Lotiny microprocessor.
Here are the picture and specs for the mosfet module.
*Size: 34mm * 26 mm
*Weight: 10 g
*Voltage: 3.3 V, 5 V
*Ports: Digital Level
*Output load voltage: 0-24V
*Output load current: ?5A (1A above need to add heat sink)
I have added this code to the Lotiny from tutorial and changed port to D0:
# Sound servo to PWM range Script
# Author: Rich
# Version: 1.0.0
# Date: 25th June 2013
# Variables (do not adjust)
# $soundvalue = auto
$pwmvalue = 0
# Main script
# Set the start point for the never ending loop
# Check the variable from the Sound servo control against a list of pre-determined levels (you may need to change these) and set the PWM value to suit.
IF ($soundvalue < 10)
$pwmvalue = 0
ELSEIF ($soundvalue < 20)
$pwmvalue = 10
ELSEIF ($soundvalue < 30)
$pwmvalue = 20
ELSEIF ($soundvalue < 40)
$pwmvalue = 30
ELSEIF ($soundvalue < 50)
$pwmvalue = 40
ELSEIF ($soundvalue < 60)
$pwmvalue = 50
ELSEIF ($soundvalue < 70)
$pwmvalue = 60
ELSEIF ($soundvalue < 80)
$pwmvalue = 70
ELSEIF ($soundvalue < 90)
$pwmvalue = 80
ELSEIF ($soundvalue < 100)
$pwmvalue = 90
$pwmvalue = 100
# Set the PWM with the value chosen above (you may need to change the port to suit)
# Add any other PWM ports above this line with PWM(PortNo, $pwmvalue)
# Sleep for 100ms to avoid saturation (you may need to adjust this to increase accuracy or increase stability. Reduce the delay for better accuracy, increase for better stability)
# Jump back to the start
I installed Sound servo Pc and configured it according to the tutorial.
When I run sound synthesis message it plays on my computer but dos not light up the lights on my robots mouth.
I have checked the 12v going in and it is ok. I get no voltage on the out.
I have been working on this for around a week and still do not have the system working.
PWM (digitalPort, speed)
Set the PWM (Pulse Width Modulation) to the desired duty percentage cycle
This simulates voltage on the specified pin (Between 0 and 5v)
PWM Value is between 0 and 100
Are you saying to change the speed variables to larger numbers (over 100)? It now seems like no signal is coming to the mosfet board?
Shouldn't I be able to hear the robot voice and light leds at the same time. Maybe I have to do something to assign the speaker and the Lotiny in Windows.
I really appreciate you help. I think it is something simple but, as of yet, not been able to find it.
I think you have a good idea though.
Let's start from the begin.
If you add PWM slider:
and play with the control can you switch on, off, dim the lights ?
Using a new circuit with LED controls and script you have not used before those introduce several different points where things "could" go wrong.
So PTP and I were trying to suggest ways to bring the complexity down to something simple - which is to ask the question "Does your circuit work with the PWM slider to control the lights?" - If not we need to look at your circuit and connections.
If it does work we can move onto seeing why the PWM circuit is not reacting to the sound servo PC control.
Does that make sense?
I share Justin's opinion you need to go back to the begin and troubleshoot the wiring, component and only then the software.
Rick's script works.
It depends how valuable is your time and how patient you are.
You spent a couple bucks in a cheap Chinese supplier (nothing against the Chinese) the problem is the lack of support, lack of documentation and misleading information.
So no support hein !?
Looking to the PCB: 1 x mosfet, 2 x resistors and maybe a led.
this is my guess:
1 resistor is used with the led, the other one must be pull down
There is no optocoupler to separate the input/output, so a common ground is used.
There isn't a amplifier transistor so the Mosfet gate uses the EZB signal (3.3v) to drive.
This is a simple diagram:
It's obvious you share a common ground and you don't need EZB's VCC.
The next question is to know the gate to source threshold voltage at which the mosfet turns on.
looking the specs:
EZB signal is 3.3v
There are other factors like temperature, component quality, tolerance etc
I don't gamble so i would say that 3.3v is not enough to drive the Mosfet.
Maybe you can get lucky.
If you want to drive the mosfet you will need to amplify/convert the signal
1) using a transistor
2) Logic Level circuit 3.3v to 5v
like rb550f mentioned.
With 4.5V you can get current just a bit higher than 1A.
I can't guess how much current you can drive with 3.3v but it will be lower.
This is not an issue If your lights need less than 1A.