
bret.tallent
USA
Asked
— Edited
Is it possible to vary the voltage output by one of the digital ports? I have a laser I want to use that works best at 3.3V - more than that and the laser gets dimmer. Any suggestions (other than tying resistors in line)? I can use resistors if I have to but wondered if there was a more practical and elegant way.
Thanks,
Bret
Also, it seems that if you hooked up like a servo, as you would control the value, the voltage would change maybe?
I don't think you need to go adding diodes, resistors, etc.
servocity, I think it was that sold a 5v-3.3 adapter. It was very cheap.
The ADC is input (read) only. ADC stands for "Analog Digital Convertor" and reads an analog input and converts it into a digital value. For example, the ADC input is between 0 and 5 volts, this means that the value of 2.5 volts would equal the value of 128 in digital. 0 volts would be the digital value of 0. And 5 volts would be the digital value of 255.
The Digital I/O (Digital Ports) can output a specific voltage by using PWM. PWM will vary the duty cycle of the digital port, which appears like a lower voltage. The duty cycle is specified in percentage (between 0 and 100).
3.3 volts would be approx 60%
However, I would recommend using a voltage regulator and switching transistor to operate the laser correctly. Digital Ports are not made for powering devices. Digital Ports are made for input and output for communication. The digital port current is very low and will not power the laser's current demand.
Use a TIP120 NPN transistor, combined with a 3.3V Regulator L4931CZ33-AP.
Only 3.55 on Ebay - free shipping.
You may reat this tutorial page to understand the ports on your EZ-B: http://www.ez-robot.com/Tutorials/Default.aspx?id=2
Use a TIP120 for switching to power external devices