Page 1 of 2

Simple PWM display

Posted: 16 Aug 2019, 13:43
by Phil_G
This is so simple its hardly a project at all, it came about when I needed to measure two servo pulse sources simultaneously. I have an MT01 which is very handy but only displays one, so I needed another 'right now' :D

Its so quick & easy, that choosing a suitable font for the display took longer than assembling the PWM meter!





IMG_20190816_120643.jpg



Above the MT01 is a much smaller PWM meter using only 3 parts, a £1 promini, a £2 128x32 OLED and a junkbox servo lead, total cost £3. It shows the pulse-width coming from whatever source its plugged into, or 'No pulse' if there is power but no pulses which is typical of 'failsafe' on cheap receivers like the Oranges.



IMG_20190816_115907.jpg


IMG_20190816_115921.jpg


The folded white thing between the boards is double-sided tape!
IMG_20190816_120406.jpg


IMG_20190816_120433.jpg

IMG_20190816_120223.jpg


The display can be mounted above the promini, where the holes for A4/SDA and A5/SCL align, so
two short, stiff wires can be used as stand-off supports, or a 2-pins from a header strip. Of course there are differing promini layouts so use whatever is most convenient. Theres a bit of insulative double-sided tape between the two boards then the whole thing is wrapped in transparent heatshrink.



servo_pwm_meter.jpg



Usually we get away without them, but for the first time, and only on the promini, I had to add the 1k I2C pull-up resistors on SDA and SCL. The same sketch on an ebay 'Strong' didnt need them.
They are part of the I2C spec so really ought to be there, but we often dont bother. Its just a couple of the smallest 1k resistors you can find, both with one end to vcc (+5v) and the other ends to SDA and SCL (or A4 and A5, whichever is easier)
The symptom is the display occasionally locking up - the promini was still working, I can tell because even during a lock-up the promini's onboard D13 LED still correctly indicates 'pulses' or 'no pulses'. The pull-ups are a 100% fix.

Arduinos are great for making things on the fly as & when you need them - for example I recently needed to revisit the old Frsky SBUS frame-rate divider project, and I have no SBUS gear... but its so cheap & easy to emulate with a promini, problem solved :D

Finally just a reminder that the 5v input wont take a 5-cell NiMh voltage so if you use high voltage packs, feed the promini positive on Vin (sometimes called 'raw') rather than Vcc. In other words take the red of the servo lead to 'Vin' or 'Raw' rather than to 'Vcc'. The display is still powered from Vcc.
All my own gear is either a 5v BEC, a 4-cell Nimh or a single Lipo cell so it suits me as drawn above.

If you can find an Arduino "Mini" (not promini), all four display pins line up in the right order, A4 A5 + - are all in a row, so a 4-pin header could be used to join the two:


arduino_mini_not_promini.jpg


Cheers
Phil

Re: Simple PWM display

Posted: 16 Aug 2019, 14:08
by Wayne_H
Elegantly simple :ugeek: - gotta make at least one, just to keep in the field box!

thanks Phil 8-)

Re: Simple PWM display

Posted: 16 Aug 2019, 14:13
by RON
Superb Phil, and so simple. I have 3 of those displays, I’m gonna have a play around. No pro minis though, so a nano it will have to be.
Ron.

Re: Simple PWM display

Posted: 16 Aug 2019, 14:33
by tiptipflyer
Great Phil,
I think I have all parts here, so I will try one out.
Well done.
Frank

Re: Simple PWM display

Posted: 16 Aug 2019, 16:00
by RON
Phil
Knocked up a quick version with a 128x64 display.
How about making a 2 channel version with 2 separate leads. They would be a perfect fit on the screen

Ron.
E102C0BD-5F82-48CF-A110-A80FAB7E4C25.jpeg

Re: Simple PWM display

Posted: 16 Aug 2019, 16:32
by RON
Thanks Phil,
Id prob never use the 2 channel version to be honest, I just saw the display with only half of it used and my brain was working overtime.

Its really nice and useful as it is Phil, leave as is.

Ron

Re: Simple PWM display

Posted: 16 Aug 2019, 16:55
by Martin
You could measure and display the voltage to use the second line of a two-line display - that would be useful information.

If you're going to try it, you'll need to use the analogReference(INTERNAL); command to use the Arduino's internal 1.1V reference - and a pair of resistors to drop the voltage down to less than 1.1V so you can measure it. You can't otherwise measure the same (roughly 5V) voltage that you're powering the Arduino with - that won't work.

Re: Simple PWM display

Posted: 16 Aug 2019, 17:00
by RON
Thanks Martin,
Great idea, Im on it.

Ron

Re: Simple PWM display

Posted: 18 Aug 2019, 10:05
by RON
Finally finished "Phil's" version except I used an Arduino Mini,(not pro mini). Unfortunately these are discontinued now but are even easier to wire than Phil's as the 5v and ground line up too, so the display just drops straight in. I used 1/8w 1k resistors for the i2c lines, really small.
Just need some clear heat shrink now!

A superb little project and so useful. Thanks Phil.

Ron
Screenshot 2019-08-18 at 10.04.47.jpg

Re: Simple PWM display

Posted: 18 Aug 2019, 15:14
by RON
Phil_G wrote: 18 Aug 2019, 15:08 Yes if you can find one, all four display pins line up with the "Mini" A4 A5 + - all in a row, so a 4-pin header could be used to join the two:



arduino_mini_not_promini.jpg
You should have one kicking about Phil, I remember giving you one years ago :D , if you haven’t used it if course.