square wave output PWM but voltage change to 5V

28 views
Skip to first unread message

quite...@gmail.com

unread,
May 2, 2019, 9:42:26 PM5/2/19
to BeagleBoard

I am outputting three square waves and I need to change the output voltage into 5V. Is there any way I can change the voltage?
 
I use Cloud9

Here is my code:
 
var b = require('bonescript');
b.pinMode('P9_14', b.ANALOG_OUTPUT);
b.analogWrite('P9_14', 0.5, 1000, printJSON);
function printJSON(x) { console.log(JSON.stringify(x)); }

var b = require('bonescript');
b.pinMode('P9_22', b.ANALOG_OUTPUT);
b.analogWrite('P9_22', 0.5, 1500, printJSON);
function printJSON(x) { console.log(JSON.stringify(x)); }

b.pinMode('P9_16', b.ANALOG_OUTPUT);
b.analogWrite('P9_16', 0.5, 2000, printJSON);
function printJSON(x) { console.log(JSON.stringify(x)); }

evilwulfie

unread,
May 2, 2019, 10:15:27 PM5/2/19
to beagl...@googlegroups.com
search mouser for voltage translator ICs
--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/0532e196-d5b2-4e9b-b029-bd6fa3ef5e3b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Dennis Lee Bieber

unread,
May 3, 2019, 3:39:13 PM5/3/19
to beagl...@googlegroups.com
On Thu, 2 May 2019 13:00:02 -0700 (PDT),
quite...@gmail.com declaimed the
following:

>
>I am outputting three square waves and I need to change the output voltage
>into 5V. Is there any way I can change the voltage?
>
>I use Cloud9
>
>Here is my code:
>

Cloud9 and code is irrelevant... This is a hardware problem.

You can not get 5V outputs from a Beagle without adding additional
hardware. Google "level shifter"

https://www.sparkfun.com/products/12009 (bidirection)
https://www.adafruit.com/product/1787 (one direction)
https://www.adafruit.com/product/1875 (bidirection)

Note that most of the bidirectional types are strictly signal level to go
from one chip to another. If you need to then drive larger loads (LEDs) you
may need to add a transistor or high-output buffer between the level
shifter and the load.


--
Wulfraed Dennis Lee Bieber AF6VN
wlf...@ix.netcom.com

Robert Heller

unread,
May 3, 2019, 3:45:57 PM5/3/19
to beagl...@googlegroups.com, beagl...@googlegroups.com, Robert Heller
If *all* the OP wants to do is drive some load at 5V, an
open-collector/open-drain transistor is all that is needed.


>
>

--
Robert Heller -- 978-544-6933
Deepwoods Software -- Custom Software Services
http://www.deepsoft.com/ -- Linux Administration Services
hel...@deepsoft.com -- Webhosting Services

Reply all
Reply to author
Forward
0 new messages