Actron Aircon / ESP32 Controller Help

Hey @lordvorta

Nice project. Have you solved the issue?

I too would love to see some support from the experts to see you up and running.

I’ve got an actron air with an LM7 controller which hopefully could be integrated in a similar way.

Not yet unfortunately I still have a bit more playing around and investigating to do. I was able to get some controls working with the DAC directly connected to the key wire bypassing the transistor setup and could see keypress reflected on the wall panel with temp up temp down etc… So in theory this should all work.

This was with the keywire not connected to the wall panel so there was no native controls via the wall panel. However sometimes the unit would turn on and off with this setup when I was testing the different button presses. I assume due to the dac briefly dropping to 0v when I send the different voltage levels so not ideal.

My next step was to maybe look at trying with a optocoupler that way I can keep the circuits separate for the esp32 and wall panel and see if that works any better.

If I get any further I will definitely look to update this thread.

1 Like

I’m thinking of setting up a breadboard to do some of my own testing and playing. I’m by no means and expert,but, can follow well in other people footsteps and use examples from other projects as learning.

Since you first post have you changed your wiring or parts list? This is of course not considering the octocoupler you recently mentioned?

Nope parts list is all still %100 the same as what I had posted so hopefully that would be a ok start for you to play around with.

I will let you know how I go with any further testing that I look at doing.

Hi @lordvorta - I think I might give this a try.

I assume you are using the voltage measurement just to verify the voltage generated and not to decode the LED statuses as in the original Github project (which measures voltage on the Power line)?

One point I note different between your circuit shown and the sample on Github is that you have your voltage divider for measuring the voltage in series with the transistor. My electronics knowledge is very rusty - but I would assume this would affect the resistance and thus the voltage at KEY.
Your diagram is also unclear (and there is no detail on the Voltage sensor module - but my guess is that this is just a voltage divider and the Vcc and + connections are both connected together) - if so and you have + connected to 3.3V on the ESP - that would be a problem.

Have you tried just removing the voltage divider (or connect VCC/+ direct to to KEY / collector) ?

I did some testing this weekend with this and replicated @lordvorta’s circuit as shown below.
When the KEY line voltage sensing circuit (highlighted R4/R5) was in place the keypad did not respond correctly. (I’m guessing higher resistor values with the same ratio might work better)

If I removed R4& R5 (which makes the circuit identical to the original circuit in the Github source) - I was able to get the circuit to emulate the keypad buttons by outputting different voltages from the MCP4725 DAC.

I used trial and error to get the required DAC output for a voltage measured on the KEY line (using a multimeter) would match the voltage when a specific button was pressed.

I don’t have a fully working config yet but thought I’d post this info in case it helps anyone.
My next focus (when time allows) will be to try get a working custom component to get the LED status by decoding the data on the Power-C line as done in the original Github project.

Wow nice work!, defiantly very helpful I hadn’t had a chance to bust out a multimeter yet so all your hard work is greatly appreciated. I might see if I can look at getting it all wired up minus the voltage sensor and fingers crossed I can get something working similar to what your results are.

I was hoping that I would have been able to get some sort of two way state checking of any changes that had been made via that key line voltage sensing circuit but it sounds like that might have been causing some of the issues was I was seeing. I think reading any changes that have been made via the physical keypad and reading that via the LED status on the power-c line would defiantly be the best option but that was defiantly well above my coding skill level :laughing:

As you said hopefully we could get a custom component using a lot the code that had initial been shared as part of the original GitHub project.

Out of curiosity what was the specific NPN transistor that you ended up using in the end was it the same BC548?

Glad to hear you managed to have some luck and thank you so much for sharing your results!

Yes - I used a BC548.
I was also hoping to measure the Key voltage to check for external state changes and was surprised that the external voltage divider circuit affected the voltage (since I chose the same resistor values from the photo of your module).
I actually decided to simulate (my understanding of) the Key voltage with different values of the top resistor in the sensing divider

(On the above link, open the circuit, click simulate - then Run DC Sweep)

This simulation shows that the voltage is being pulled down significantly by the divider and maybe if you used much higher resistors (47M/12M) - that might work. I haven’t tried it yet.

(Blue line is voltages with your divider 4.7k, orange is 47k, brown 47M)

Below is the ESPHome config I currently have working for button control of my keypad:

esphome:
  name: aircon-keypad
  friendly_name: Aircon Keypad

esp32:
  board: m5stack-core-esp32
  framework:
    type: arduino

# Enable logging
logger:
  level: DEBUG #INFO

# Enable Home Assistant API
api:
  encryption:
    key: !secret esphome_api_key

ota:
  password: !secret esphome_ota_password

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Aircon-Keypad Fallback Hotspot"
    password: "M3odvzX6U8gI"

captive_portal:


#Enable sensor to read external button Voltages 
#https://esphome.io/components/sensor/adc.html?highlight=gpio+sensor
#sensor:
#  - platform: adc
#    pin: GPIO32
#    name: "Aircon Wall Panel - Key Press"
#    update_interval: 50ms
#    accuracy_decimals: 3
#    filters:   
#    - multiply: 4.9166


#Setup i2c bus to controll MCP4725
#https://esphome.io/components/i2c#i2c
i2c:
  sda: 25
  scl: 21
  scan: true

#MCP4725 output to Send Voltages for key presses 
#https://esphome.io/components/output/mcp4725
output:
  - platform: mcp4725
    id: dac_output
    address: 0x62


##***TESTING***
# Define a number input component to output mV to the DAC
number:
  - platform: template
    name: "DAC Output miliVolts"
    min_value: 0
    max_value: 5000  # Adjust this value according to the DAC's range
    step: 1    # Adjust the step size as needed
    restore_value: true
    optimistic: true
    on_value:
      then:
        lambda: |-
          id(dac_output).set_level((x / 5000.0));
###############################################################


button:
  - platform: template
    name: "Power"
    on_press:
      - logger.log: Power Button Pressed
      - lambda: |-
          id(dac_output).set_level((5000.0 / 5000.0));
      - delay: 800ms
      - lambda: |-
          id(dac_output).set_level((0.0 / 5000.0));

  - platform: template
    name: "Fan"
    on_press:
      - logger.log: Fan Button Pressed
      - lambda: |-
          id(dac_output).set_level((718.0 / 5000.0));
      - delay: 800ms
      - lambda: |-
          id(dac_output).set_level((0.0 / 5000.0));

  - platform: template
    name: "Temp Up"
    on_press:
      - logger.log: Temp Up Button Pressed
      - lambda: |-
          id(dac_output).set_level((835.0/ 5000.0));
      - delay: 800ms
      - lambda: |-
          id(dac_output).set_level((0.0 / 5000.0));

  - platform: template
    name: "Temp Down"
    on_press:
      - logger.log: Temp Down Button Pressed
      - lambda: |-
          id(dac_output).set_level((741.0/ 5000.0));
      - delay: 800ms
      - lambda: |-
          id(dac_output).set_level((0.0 / 5000.0));


  - platform: template
    name: "Mode"
    on_press:
      - logger.log: Mode Button Pressed
      - lambda: |-
          id(dac_output).set_level((908.0/ 5000.0));
      - delay: 800ms
      - lambda: |-
          id(dac_output).set_level((0.0 / 5000.0));

  - platform: template
    name: "Timer"
    on_press:
      - logger.log: Timer Button Pressed
      - lambda: |-
          id(dac_output).set_level((810.0/ 5000.0));
      - delay: 800ms
      - lambda: |-
          id(dac_output).set_level((0.0 / 5000.0));

  - platform: template
    name: "Timer Up"
    on_press:
      - logger.log: Timer Up Button Pressed
      - lambda: |-
          id(dac_output).set_level((778.0/ 5000.0));
      - delay: 800ms
      - lambda: |-
          id(dac_output).set_level((0.0 / 5000.0));

  - platform: template
    name: "Timer Down"
    on_press:
      - logger.log: Timer Down Button Pressed
      - lambda: |-
          id(dac_output).set_level((763.0/ 5000.0));
      - delay: 800ms
      - lambda: |-
          id(dac_output).set_level((0.0 / 5000.0));

Hope it helps somebody

Hi,

Good to see progress on this. I am not that good with reading diagrams but I will like to try and replicate what you have done so far and learn how it works.

@brentk can you pleas post a list of materials that you have used and works with the ESPHome example you posted?

Also would you be able to describe how all is connected (and maybe some pics?). I am looking at the diagram you posted but yeah I am not that good at interpreting it. So a description in words and pics will work much better for me.

Many thanks and looking forward to control my Actron from HA :slight_smile:

Materials at this stage are:

1 x M5 Stack Atom Lite (or any other ESP32)
1 x MCP4725 Breakout board
1 x BC548 NPN Transistor
1 x 20k Resistor
1 x 4.7k Resistor
1 x 1.2k Resistor

I am still in testing phase (trying to decode LED and 7-segment display) but will also later test if we can eliminate the GP8403 DAC and instead use the built in DAC on the ESP32. (ESP32 DAC is lower resolution than the external one - my guess is it should still work. I think the external was used in original project because it was based on ESP8266)
When I am done - I can look at adding some pictures - but ideally you need to be able to follow a basic circuit diagram like I included to build and troubleshoot something like this. (just leave out R3 and R4 and any of the connections to them).

Hey Guys

Great contributing work on the @brentk. I’ve not used an M5 Stack Atom Lite,but, I can see some potential simplicity in using it as another remote keypad.

Whilst looking at buying options for the m5 stack I saw this new rotary dial product which could potentially add a nice remote control UI.

1 Like

Hi thank you for the reply. The intention here is to try and replicate your work so far and learn at the same time :slight_smile:
One question - the GP8403 DAC. Would you have a link to where you got this from? When I search for it I get all sorts of results and not sure which one I should be getting.

Thanks.

@MnM - My apologies - I copied and pasted the DAC from lordvorta’s post and that is actually not the one I used. I used a MCP4725 Breakout board like this or this . (Which I already had and matches the original Arduino project).
I have updated my parts list to reflect this.

If you use the M5 Stack - this one would be simpler for you to wire as it is a simple plug connection. You would still need to solder connect the transistor and resistors though.

Hey @brentk

I’m just being a little lazy here, but, can you recommend a local (aus) supplier for the m5 stack atom lite. I really want to give this a try rather than the usual ESP32s. Core electronics doesn’t stock it.

I have bought one directly from their website as well as from rs-online when buying other items (free shipping over $80). I was looking at the Atom Echo the other day for the new voice stuff and found Digikey sell them with free shipping over $60 link (picture looks wrong but description is correct)

@brentk - thank you for the update.

Just to make sure I understood and I will order the right hardware:

So if I get

M5 Stack
M5Stack DAC Converter

will be OK?

Also for the BC548 NPN Transistor - I tried searching DIGIKEY (keep the shipping costs down if I can) but I cant find an exact match. Will and of the below options work?
Option1 or Option 2

For resistors when I search on DIGIKEY site I get categories of products return but no actual products. I will appreciate if you can send me some direct URLs for the 20k, 4.7k and 1.2k resistors. I just dont know what to buy and dont want to get the wrong items. (I assume DIGIKEY do sell them)

Many thanks again.

M5Stack items should be good.
Easiest is probably to get transistors and resistors in small quantities from Jaycar - I doubt Digikey will sell in small lots.
Either of those transistors should do I think

One more question - for the resistors I see that Jaycar has 1W, 0.5W 5W ones. Which one do I need to get?

0.5W is fine - probably come in a pack of 10