How to use PICO with OLED and MOSFET? #848
Replies: 22 comments
-
Posted at 2016-02-22 by DrAzzy That MOSFET is 4.5v logic level. The Espruino is a 3.3v device. You can't fully turn it on with 3.3v That's an N-channel MOSFET. Yet you say you're using it to switch the Vcc side. In order to turn it on, you would need to apply a voltage 4.5v above the source voltage to the gate - meaning you'd somehow need to get and control 7.8v+ just to control the mosfet. You need a P-channel logic level MOSFET if you want to switch the positive side, and you need it to be rated for Vgs < 3.3, otherwise you can't turn it on. Actually, I think you may have to use N-channel fet and switch low side if it's I2C, because if you switched the high side, it would draw current through the pullups - probably not enough to work, but enough to waste power. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-02-23 by @gfwilliams I would look at the OLED's datasheet (and/or google) While it isn't exposed in the driver, you can turn the OLED off using software, and it'll save you a lot of power. For instance the fitness watch I disassembled uses a SSD1306 and can last for a very long time on a charge - it doesn't add a MOSFET to control it, but instead just uses software to turn it off. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-02-23 by bigplik Tnx Lads, Gordon do you know the command for SSD1306 to switch it off and on again? |
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-02-23 by @gfwilliams The watch code was actually really nasty because I was trying to squeeze it down really small, but yes, I'd add a function called It's a shame you can't easily extend the graphics lib at the moment... I think if you were going to commit a modified module for everyone else to use, using |
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-02-23 by bigplik could you help with proper form for this command? |
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-02-24 by @gfwilliams Did you just add:
If it doesn't work, my guess is because you haven't defined It might actually be you don't have a |
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-02-24 by bigplik I have I2C OLED |
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-02-25 by @gfwilliams Ok, then change |
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-02-25 by bigplik I tried this but won't work in my case, possibly code from is wrong?
|
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-02-25 by @gfwilliams I don't know what your code is, but chances are you actually want |
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-02-25 by bigplik this is the code
but this only change the position of string displayed on the OLED, |
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-02-25 by @MaBecker I am working with a OLED over I2C and use module "SSD1306". this is what's working for me:
|
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-02-25 by @MaBecker sorry don't know what format tags to use for code ?! where using the correct tags but missed empty line, now it looks like code |
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-02-25 by DrAzzy
What do you expect that to do? Probably not what it's doing. You create a function called You also create a function called But when you do Instead, you want to just call dispoff, eg (which is pretty much what MaBe has posted) |
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-02-25 by bigplik MaBe your way is working for me too ;) DrAzzy, I still learn javascript code proper form ;) |
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-02-25 by @MaBecker @bigplik do you sometimes see lots of dots on oled instead of the object you requested to display ? |
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-02-26 by bigplik @mabe I see that dots sometimes, usually on the beginning, when I upload new code first, then when I upload it again I see on the display what I wanted, |
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-02-26 by @MaBecker @bigplik at the moment the OLED only shows wild dots... o added pullups 4.7K |
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-02-26 by @gfwilliams @mabe it worries me that you're using some strange module The random dots happen if you have managed to initialise the display and turn it on, but haven't sent any data using |
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-02-26 by @MaBecker @gordon sorry for confusion, wrong copy paste, I am using SDD1306 as local module SDD1306_I2C is just a SDD1306 without SPI, to shrink size added some prints
|
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-02-28 by @MaBecker solved, broken homemade build, have been using a build that generated stars or snow instead of display text ..... After using a new build every thing is working as expected ! If you start building firmware you should add comment to your source to remember you which build you used for that code .... |
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-02-28 by @MaBecker Before sending the init sequence a reset is needed, guess this is OLED specific. Mine is a 128x32 I2C from Adafruit and has a reset pin. Should be added to the module as optional parameter and toggled before sending the init sequence. calling connect:
add to module SSD1306:
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2016-02-22 by bigplik
Hi, I just want to ask about proper connection for Pico with OLED SSD1306 and Mosfet in VCC line for OLED.
I want to save more current on the battery, yesterday I left OLED connected to PICO and li-po battery, OLED was cleared, and today battery is empty, thought to use Mosfet to steering VCC supply line for OLED, but what I noticed is when I put (in my case B4) gate pin to 0 (digitalWrite(B4,0)) 0r (analogWrite(B4,0)) then my OLED still works. Screen isn't blank.
any advice how to switch this Mosfet off to cut off current for OLED?
I use IRFZ44N Mosfet
Beta Was this translation helpful? Give feedback.
All reactions