This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 1 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Digitise an older engine - ESP32
#21
(2022-07-22, 05:03 AM)Techstyle Wrote: @boatingbaileys

I just tried your main.cpp but you may want to include in the readme that you have to add a couple of dependencies to the 'lib deps' section of platformio.ini - the bottom two lines:

Code:
lib_deps =
 ; Peg the SensESP version to 2.0.0 and compatible versions
 SignalK/SensESP @ ^2.0.0
 ; Add any additional dependencies here
 adafruit/Adafruit BMP280 Library@^2.6.3
 SensESP/OneWire@^2.0.0

I have your code up and running, now I am going to rewatch the episodes to try to decipher what's happening and how to connect it all up - thanks

Thanks for that - Completly forgot about the lib_deps. i'll update it now.
Reply
#22
@boatingbaileys

I got some of my project up and running:


1.  I adapted your Coolant sender code to work with my oil Pressure sender.  Haven't tried it yet but used a different scale table to map the resistance to the oil pressure, obviously
2.  Added 6 onewire sensors for a variety of stuff, tested and works well - oil temp, Aft Stateroom temp, Exhaust Elbow temp, Exhaust temp, Alternator Temp, and Transmission Temp
3.  Adapted your BMP280 code to the BME280, which seemed straight forward at first but it is not working, struggling a bit with it
4.  Used your RPM code as is, not tested yet
5.  Used your fuel consumption code but with a new fuel map for my engine and I changed the Signal K Key "propulsion.engine.fuel.rate", this comes with known units - m^3/s.  m^3/s is a bit inconvenient but is more correct by the Signal K Spec.  It does mean that the fuel map needs to be changed.
6.  another change I made was for consistency some of your Signal K keys state "propulsion.main.<whatever>" and some are "propulsion.engine.<whatever>".  I believe "main" refers to main engine and "engine" refers to the only engine - I commonised on "engine" for all of them 

I do fancy adding a flood sensor like you talk about for under the engine bay and near the raw water thru hull

thanks again for all this work
Reply
#23
(2022-07-28, 02:55 AM)Techstyle Wrote: @boatingbaileys

I got some of my project up and running:


1.  I adapted your Coolant sender code to work with my oil Pressure sender.  Haven't tried it yet but used a different scale table to map the resistance to the oil pressure, obviously
2.  Added 6 onewire sensors for a variety of stuff, tested and works well - oil temp, Aft Stateroom temp, Exhaust Elbow temp, Exhaust temp, Alternator Temp, and Transmission Temp
3.  Adapted your BMP280 code to the BME280, which seemed straight forward at first but it is not working, struggling a bit with it
4.  Used your RPM code as is, not tested yet
5.  Used your fuel consumption code but with a new fuel map for my engine and I changed the Signal K Key "propulsion.engine.fuel.rate", this comes with known units - m^3/s.  m^3/s is a bit inconvenient but is more correct by the Signal K Spec.  It does mean that the fuel map needs to be changed.
6.  another change I made was for consistency some of your Signal K keys state "propulsion.main.<whatever>" and some are "propulsion.engine.<whatever>".  I believe "main" refers to main engine and "engine" refers to the only engine - I commonised on "engine" for all of them 

I do fancy adding a flood sensor like you talk about for under the engine bay and near the raw water thru hull

thanks again for all this work

I am also wondering if the BME280 issues are something to do with my platformio - for whatever reason, I cannot compile successfully when Firebeetle32 is selected as the board - Mat - any chance you could post your platformio.ini file?
Reply
#24
(2022-07-28, 05:46 PM)Techstyle Wrote:
(2022-07-28, 02:55 AM)Techstyle Wrote: @boatingbaileys

I got some of my project up and running:


1.  I adapted your Coolant sender code to work with my oil Pressure sender.  Haven't tried it yet but used a different scale table to map the resistance to the oil pressure, obviously
2.  Added 6 onewire sensors for a variety of stuff, tested and works well - oil temp, Aft Stateroom temp, Exhaust Elbow temp, Exhaust temp, Alternator Temp, and Transmission Temp
3.  Adapted your BMP280 code to the BME280, which seemed straight forward at first but it is not working, struggling a bit with it
4.  Used your RPM code as is, not tested yet
5.  Used your fuel consumption code but with a new fuel map for my engine and I changed the Signal K Key "propulsion.engine.fuel.rate", this comes with known units - m^3/s.  m^3/s is a bit inconvenient but is more correct by the Signal K Spec.  It does mean that the fuel map needs to be changed.
6.  another change I made was for consistency some of your Signal K keys state "propulsion.main.<whatever>" and some are "propulsion.engine.<whatever>".  I believe "main" refers to main engine and "engine" refers to the only engine - I commonised on "engine" for all of them 

I do fancy adding a flood sensor like you talk about for under the engine bay and near the raw water thru hull

thanks again for all this work

I am also wondering if the BME280 issues are something to do with my platformio - for whatever reason, I cannot compile successfully when Firebeetle32 is selected as the board - Mat - any chance you could post your platformio.ini file?

Will do, and will respond to the above. Currently got limited access to internet but will be back i a couple of days.
Reply
#25
(2022-07-30, 10:58 PM)Boatingbaileys Wrote: Will do, and will respond to the above. Currently got limited access to internet but will be back i a couple of days.

Thanks, actually I got it working, I had to add some code to get the I2C interface to work.  I had to define the pins

Code:
Wire.begin(22,21)

where 22 is the SCL pin and 21 is the SDA pin.

I think you may have got around this by better defining the board you were using, but I had trouble with that in version 2.
Reply
#26
(2022-08-01, 04:54 AM)Techstyle Wrote:
(2022-07-30, 10:58 PM)Boatingbaileys Wrote: Will do, and will respond to the above. Currently got limited access to internet but will be back i a couple of days.

Thanks, actually I got it working, I had to add some code to get the I2C interface to work.  I had to define the pins

Code:
Wire.begin(22,21)

where 22 is the SCL pin and 21 is the SDA pin.

I think you may have got around this by better defining the board you were using, but I had trouble with that in version 2.

Took me a little longer to get back to this, but I have had a look through the code, and I've not needed to define this. It looks like it set the ports up for me, I know I had to change to 0x76 for mine, but the pins appear to have been defined.  Glad its working!
Reply
#27
I am now trying to get the RPM sensor to work for me, it seems you made your own board, but I already had a Optocoupler board based on the EL817 that I used for my ST1 connection (https://amzn.to/3Kkoy2q).  Running the code below:

Code:
(new DigitalInputCounter(RPM_PIN, INPUT_PULLUP, RAISING, 500))

it seems the voltage to at the pin never drops, I think I should try:

Code:
(new DigitalInputCounter(RPM_PIN, INPUT_PULLDOWN, FALLING, 500))

any thoughts?
Reply
#28
(2022-08-25, 06:27 PM)Techstyle Wrote: I am now trying to get the RPM sensor to work for me, it seems you made your own board, but I already had a Optocoupler board based on the EL817 that I used for my ST1 connection (https://amzn.to/3Kkoy2q).  Running the code below:

Code:
(new DigitalInputCounter(RPM_PIN, INPUT_PULLUP, RAISING, 500))

it seems the voltage to at the pin never drops, I think I should try:

Code:
(new DigitalInputCounter(RPM_PIN, INPUT_PULLDOWN, FALLING, 500))

any thoughts?
Yeah, I think that might work. Are you seeing a change in voltage from the alternator side at all? It’s a Yanmar engine?
Reply
#29
(2022-04-01, 10:40 PM)tYuoAz Wrote: I'm working on the same project right now!

Using a Sailor Hat board which has an ESP32 built in. I've also got the engine hat add on for the SH-ESP32 and almost have everything working. Currently working on trying to get oil pressure sorted out.

Do you have any code on github to share? I'd love to see how you did it.

If anyone doesn't know this is the ESP32 board I mentioned. It's main benefit is that it can be 12v powered and has a CAN bus input if you want to use it with N2K.

https://hatlabs.fi/product/sailor-hat-wi...16fd43adaa

What a great idea! I have only seen the Raspberry pi version of this HAT previously but it looks to be a very useful and well specified board (the ESP32 version especially) with protected PSU and protected I/O as well as EMC certification and SensESP support. Are you making use of the NMEA2000 interface?
Paul
Reply
#30
Hi,

I've now added a bilge monitor to this using a cheap float switch. The code on the website and in the video returns true or false, but thanks to a subscriber i'm updating that with the below so that i can return a string of text. Here is the updated code:

auto* bilge = new DigitalInputState(25, INPUT_PULLUP, 5000);

auto int_to_string_function = [](int input) ->String {
    if (input == 1) {
      return "Water present!";
    }
    else { // input == 0
      return "bilge clear";
    }
};

auto int_to_string_transform = new LambdaTransform<int, String>(int_to_string_function);

bilge->connect_to(int_to_string_transform)
     ->connect_to(new SKOutputString("propulsion.engine.bilge"));




Hope this is helpful.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)