Nanobaro - NMEA/USB barometric sensor, easy DIY electronics project

tudorsailor

Well-known member
Joined
12 Jun 2005
Messages
2,737
Location
London
zebahdy.blogspot.co.uk
Well the nice man from amazon has delivered the LCD. It has an adapter to allow just 4 pin connection GND VCC SDA and SCL. It is an I2C interface. There are no instructions of course. I assume that I have to solder the adapter onto the LCD. Will the Sketchfrom GHA work with a 4 pin connection? Do I use a breadboard to share the SDA and SCL that are also used by the sensor or is that too simple?

Capture7.JPGCapture6.JPG

Thanks
 

GHA

Well-known member
Joined
26 Jun 2013
Messages
12,167
Location
Hopefully somewhere warm
Visit site
Well the nice man from amazon has delivered the LCD. It has an adapter to allow just 4 pin connection GND VCC SDA and SCL. It is an I2C interface. There are no instructions of course. I assume that I have to solder the adapter onto the LCD. Will the Sketchfrom GHA work with a 4 pin connection? Do I use a breadboard to share the SDA and SCL that are also used by the sensor or is that too simple?

View attachment 74295View attachment 74296

Thanks

Looks like I2C board solders straight onto the screen. Bluetack can sometimes be handy to keep the bits in place while you get a couple of pins soldered >>
afef3b83a9190c755c2440cde6bfda96.jpg

The SDA & SCL just all piggy back in parallel, yes. Give the sketch a try - might work! Or before I had to do a bit of google to find the right library/settings but just trying some code from the examples menu might come up with something that works, often just trying an example works plug and play without resorting to google.
 

tudorsailor

Well-known member
Joined
12 Jun 2005
Messages
2,737
Location
London
zebahdy.blogspot.co.uk
Is VCC on the screen OK to connect to VIN from the board?

BTW I still cannot copy and paste the code from this forum into IDE. When I try it all ends on one like with a bit of text at the end referring back to YBW. Ctrl-t does not help. In fact I wonder if this is a forum thing as I have found that copying and pasting into a word document does not retain the format and does insert http://www.ybw.com/forums/showthread.php?484828-Nanobaro-NMEA-USB-barometric-sensor-easy-DIY-electronics-project#kdvj6yBGHHLtRDbs.99 at the end

Thanks
 

rogerthebodger

Well-known member
Joined
3 Nov 2001
Messages
12,404
Visit site
When I was playing with an Arduino I started by following some of these projects

https://circuitdigest.com/arduino-projects

I also played with a barometric sensor following this project

https://circuitdigest.com/microcontroller-projects/pressure-sensor-bmp180-with-arduino

I used the same display as you but without the I2C board just wired direct.

When I have a little more time I will be playing with weighing my LPG cylinders and calculation the remaining percentage LPG and playing with measure fuel depth with laser and/or ultrasonics.

This project also uses the same display for temperature and humidity.

https://circuitdigest.com/microcontroller-projects/arduino-humidity-measurement

others

https://circuitdigest.com/microcontroller-projects/arduino-ammeter

https://circuitdigest.com/microcontroller-projects/arduino-weight-measurement-using-load-cell

https://circuitdigest.com/microcontroller-projects/arduino-alarm-clock
 
Last edited by a moderator:

dolabriform

Well-known member
Joined
12 Sep 2016
Messages
1,757
Location
London / Suffolk
freewheeling.world
I also have trouble copying code from the forum.

Try this Library:
https://github.com/fdebrabander/Arduino-LiquidCrystal-I2C-library

As GHA said, you can connect the sda and sdc pins from the LCD and the BMP together and connect to the Arduino.

Code:
[FONT=Courier New]                 
            BMP 280           LCD           Arduino 
              |  |            | |           |  |
SDA ----------|--)------------|-)-----------|  |
SCL--------------|--------------|--------------|[/FONT]
 
Last edited:

tudorsailor

Well-known member
Joined
12 Jun 2005
Messages
2,737
Location
London
zebahdy.blogspot.co.uk
Fantastic :encouragement:

I've updated the code on Github with the changes.

I'll try and add some info later about adding an LCD :)

Capture9.JPG

So thank you David, After relatively little fiddling and experimentation, I installed your code and it works perfectly.

So now I have an electronic barometer and I can even make it independent of the PC by plugging the USB into a USB charger

Of course you know what I now will ask.............. What would it take to also have a graphical display of the pressure over the past 6 hours as a bar graph on another screen??? Is that too much to do

I owe you several beers now, whatever your reply!

Boyd
 

dolabriform

Well-known member
Joined
12 Sep 2016
Messages
1,757
Location
London / Suffolk
freewheeling.world
Looks like I2C board solders straight onto the screen. Bluetack can sometimes be handy to keep the bits in place while you get a couple of pins soldered >>
afef3b83a9190c755c2440cde6bfda96.jpg

The SDA & SCL just all piggy back in parallel, yes. Give the sketch a try - might work! Or before I had to do a bit of google to find the right library/settings but just trying some code from the examples menu might come up with something that works, often just trying an example works plug and play without resorting to google.

Blue Tack... Genius .. Thank you :)
 

dolabriform

Well-known member
Joined
12 Sep 2016
Messages
1,757
Location
London / Suffolk
freewheeling.world
View attachment 74328

So thank you David, After relatively little fiddling and experimentation, I installed your code and it works perfectly.

So now I have an electronic barometer and I can even make it independent of the PC by plugging the USB into a USB charger

Of course you know what I now will ask.............. What would it take to also have a graphical display of the pressure over the past 6 hours as a bar graph on another screen??? Is that too much to do

I owe you several beers now, whatever your reply!

Boyd

Thanks, hopefully we'll get to share the beers as this has been a good learning curve for me as well :)

To start logging the info and producing graphs is doable, but <imho> it's reinventing the wheel. It would require tracking the data and making a rolling display, which whilst not necessarily complicated has already been done so many times that it's not worth the effort ;)

Open CPN will already produce the graph, just plug this into the USB port of a Pi running it and install a VNC server so it can be viewed from a tablet over wifi.

Alternatively, plug into a NMEA 0183 network via a TTL converter to a plotter that will store and show the graph.

Option 3 ( which I'm currently working on ) is to spit out all the data including battery voltage and engine RPM to NMEA 2K so my MFDs can show all the data and track a graph with their built in functionality.

Of course that's just my opinion, someone more informed will come along any minute :)
 
Last edited:

Martin_J

Well-known member
Joined
19 Apr 2006
Messages
4,247
Location
Portsmouth, UK
Visit site
I think I got the barometric pressure onto N2k earlier in this thread... And fuel level... Can remember which... I'm also wondering about engine rpm (from the alternator W terminal) next... Just need to find perhaps an opto isolator that'll go between the signal wire and the Teensy input pin.. and a bit more spare time.
I'll update this post if I get anywhere with it.
 

tudorsailor

Well-known member
Joined
12 Jun 2005
Messages
2,737
Location
London
zebahdy.blogspot.co.uk
We have come full circle at last. This was my early prototype a few years ago, as mentioned in the blog post:

;)

I accept that "we" have come a full circle but for me this has been an interesting learning experience. I have no previous experience of Arduinos and the programs associated. I am very happy that as a beginner to have achieved the nanobaro with display. I think that this was only an "easy" project for those with experience of arduinos. I have needed a lot of hand holding but maybe others will learn from my process as there was quite a lot of assumed knowledge.
Thanks for the original post. Now off to my CAD program to make a little box on my 3D printer into which to put all the bits!

TudorSailor
 
Last edited:

Mattzilla

New member
Joined
8 Nov 2018
Messages
3
Visit site
Hi, I just constructed this and seems to work great so far. I would like to do the following and want to check what the appropriate pins on Nano board to use.

- I want to power the box by USB, however I want to output NMEA 0183 to a NMEA wifi multiplexer. What are the NMEA data pins I should use on Nano? Would it be TX1 and GND?
 

dolabriform

Well-known member
Joined
12 Sep 2016
Messages
1,757
Location
London / Suffolk
freewheeling.world
Hi, I just constructed this and seems to work great so far. I would like to do the following and want to check what the appropriate pins on Nano board to use.

- I want to power the box by USB, however I want to output NMEA 0183 to a NMEA wifi multiplexer. What are the NMEA data pins I should use on Nano? Would it be TX1 and GND?

From Post 24:
Look up the pinout for your Nano. You just need the transmit one (TxD), and ground of course. These are TTL level, so you may need a level shifter, but no harm trying (in this direction - very much harm if you put 12V on the Arduino RxD - but that's not something you need here). Also your NMEA device's input must be able to cope with RS232, not RS442 (differential), but most do that. Look up the pins and give it a go
 

GHA

Well-known member
Joined
26 Jun 2013
Messages
12,167
Location
Hopefully somewhere warm
Visit site
From Post 24:
Look up the pinout for your Nano. You just need the transmit one (TxD), and ground of course. These are TTL level, so you may need a level shifter, but no harm trying (in this direction - very much harm if you put 12V on the Arduino RxD - but that's not something you need here). Also your NMEA device's input must be able to cope with RS232, not RS442 (differential), but most do that. Look up the pins and give it a go

Also the TTL output from the nano is inverted compared to NMEA, software serial can invert the signal and send it out of your pin of choice, or a cheap rs232/TTL from ebay might be easier & will do the level shifting as well.
 

tudorsailor

Well-known member
Joined
12 Jun 2005
Messages
2,737
Location
London
zebahdy.blogspot.co.uk
+1

you are of course going to sand and polish the box!
:D

That's a bit harsh. Appreciation of the "engraved" name and the air holes would have been better :) .

Although sanding PLA is possible its a PITA. Had I printed in ABS, I think that I could polish up a bit using acetone. Might try and see

You might be interested to see the lower half of the box. This was printed with 0.1mm layer height whereas the top half is 0.2mm layer height - and so prints in half the time.
box.JPG


Thanks

TS
 
Last edited:
Top