#21

I am enjoying watching your experiments. Some interesting concepts.

Alan

#22

Day Four: The Six Lab

It’s time to put together a little lab where I can test out all the sensor, LED, and motor, ideas for future Electro Plastic Steampunk machines. The Six offers a good place to experiment. Take off the dome, remove a few of the appendages and you have 12 places to attach EZ bits, which in turn can have a variety of things attached to them.

I want at least:

one solderless breadboard
a place to experiment with the famous 37 Sensor kit
PWM experiment area
ADC experiment area
the ability to drop voltage form 7.4 volts to 5 volts
a camera with horizontal and vertical movement
at least one gripper with horizontal and vertical movement
one pointing finger
A place for 8x8 matrix display
at least one continuous rotation servo
a place for my motor controller for DC motors

I thought I would start by redesigning a new interface and create a project called the Six Lab. This ongoing project can be found on the EZ Cloud (Public, Revolution, DIY, Incomplete) as Six Lab. Here is a picture of my version, preparing to test some LEDs via PWM.

User-inserted image

#23

Day Five: PWM Experiments

I enjoy doing visual things with computers and robots, like blinking LEDs and moving gauges. Sometimes the simplest controls offer an opportunity to explore in new directions. How about if I achieve the visual effects simply by means of changing the voltage.

I keep going over the tutorials, looking for new inspirations. while was looking over the lessons and I noticed the PWM control and decided using this as a good place for experimentation. Just by using the PWM control and sliding the slider I can change the voltage to alter LEDs move meters maybe other things. Let’s get started.

What things can undergo visual changes, making interesting robot activity by altering the voltage applied to one or more of the ports? Let's set up a little PWM lab and gather these components:

• LED
• RGB LED
• LED VU meter (1349)
• LED voltmeter
• Analog meter
• Multicolored LED
• Blinking LED
• Arduino oscilloscope (.96)
• Green eyed LEDs
• Red light LED
• Fiber optics
• Pulsing LED
• Countdown LED

Pulse Width Modulation is very useful and fun, but I only wish I knew how to change the voltage over a greater range than three volts. Does anybody know how to do that? Anyway, on with all the different things I decided to PWM.

These ideas merit a trip to the dollar store for supplies. I was able to find the fiber optics (a plastic flower with one changing RGB LED, 4.5 volts), the pulsing LEDs (a pair of blinking happy birthday glasses), and the eye-possible LEDs (a cheap reading lamp - one white LED each).

A little cutting and soldering of DuPont cables, and some bending and breaking of plastic and I have three useable PWM experimental pieces.

I use digital ports D3, D4, D5 and D6 for the PWM experiments. Be sure to read the tutorial in the learn section. It is a great start to Pulse Width Modulation.

Here is a photo of the finished project and a video of all the PWM accessories going at once.

User-inserted image


#24

Quote:

I only wish I knew how to change the voltage over a greater range than three volts. Does anybody know how to do that?


I have a 5v laser diode connected using a 5v regulator to drop the voltage from the 7.4v lipo, and a TIP120 transistor to switch it on and off. I haven't measured the voltage when doing PWM, but I am sure it effectively ranging from 0 to 5v because it is full bright at 100 pwm and off at 0 and moves smoothly between them.

Now of course pwm is not really changing the voltage, it is poweringn on and off very very fast and appears to most devices that the voltage is lower because it is not getting full voltage long enough to come up to full power (or something like that. DJ could explain better). If you view an LED getting less than 100 PWM with the EZ-B (or any digital) camera, you can see that it is actually blinking, but your eye can't see it on its own.

Alan

#25

Digital ports logic voltage is 3.3v, the only voltage you get in a port is 0 or 3.3v.

PWM has a specific frequency depends on the Microcontroller timers, when PWM a port between 0 and 100, you are changing the duty cycle.

For example if the pwm frequency is 1 Hz (1 time per second), and your PWM is 25 you will see the LED blinking.

if the pwm frequency is 100 Hz (100 times per second) and your PWM is 25 you can't see the led blinking instead you see it less bright.

Arduinos default PWM frequency is 490Hz, and 980Hz. I have an Arm Cortex M4 and the default frequency is 480 Hz, but it depends on the micro controller clock.

i don't know the EZB PWM frequency and if it varies per version (v3,v4) but my bet is arround 500Hz.

DJ demos the pwm duty cycle:
https://www.ez-robot.com/Tutorials/Help.aspx?id=164

#26

Thanks thetechguru and ptp for the great comments. They are helpful and appreciated.

Question - what is the simplest way to turn on a 5 volt digital device using the Digital Write Control? I have some 5v circuits on little boards that I just need to turn on and off under EZ Script control. Should I use a transistor switch and power the little board from its own battery or is there a simpler way?

#27

short answer: yes you can use a transistor, but, not all transistors are equal.

e.g. TIP120 can fit in a scenario where you need to control a Motor or a Light.

#28

Good information about how to wire a TIP120 here: http://www.ez-robot.com/Community/Forum/Thread?threadId=3050

However, the thread was polluted somewhat by a troll (Robotmaker). For a while his posts were hidden, so it was both easier and harder to read the thread. They are back in now, but most of what he has to say is useless, so just stick with the first two pages of the thread.

The other option is to use a relay board, but typically you would only need that when dealing with higher voltages.

Alan

#29

If you are enabling or disabling a digital circuit not sourcing or powering, you will need to provide a logic level (1) or (0 if inverted logic).

some circuits will accept 3.3v as logic level (1).

To protect the EZB pin, use a 1k resistor between the EZB PIN and the circuit you are enabling/disabling.

if the other digital circuits needs a 5v, you will need a logic level circuit.

One good fit for you breadboard is the SN74HCT:

http://www.digikey.com/product-detail/en/texas-instruments/SN74HCT245N/296-1612-5-ND/277258

although the ic needs 5v.

don't confuse with the 74LVC245:

http://www.digikey.com/product-detail/en/SN74LVC245AN/296-8503-5-ND/377483

the 74LVC245 does the opposite converts 5V to 3.3V, one could use to interface to EZB, and use it as input, but, is not necessary EZB pins are 5V tolerant.

https://www.ez-robot.com/Tutorials/UserTutorials/163/3

Those circuits are not bi-directional, if you need one you will find cheap ones on ebay.

#30

If you are powering the circuit, the correct transistor family is a mosfet.

A TIP120 is very simple to use, i have a few to interface with motors, fans etc, but is not efficient. Is old tech before Microsoft & Apple.

http://hackaday.com/2015/08/17/you-can-have-my-tips-when-you-pry-them-from-my-cold-dead-hands/

there are a few well know mosfets:

http://www.digikey.com/product-detail/en/on-semiconductor/NTD4906N-35G/NTD4906N-35GOS-ND/2194521

http://www.digikey.com/product-search/en?keywords=IRLB8721PbF

http://www.digikey.com/product-detail/en/infineon-technologies-americas-corp/IRF540NPBF/IRF540NPBF-ND/811869

recently i used this:
http://www.nxp.com/documents/data_sheet/2N7002.pdf

to turn on/off the XV11 Lidar's motor (100 ma max peek), unfortunately the mosfet is surface-mount only.