Interior lights with touch screen and 3 way control. ( Arduino and Nextion)

Willoughby

Senior Member
VIP Member
T6 Pro
Helloooo

Long time no see ;) I was getting fed up not being able being able to dim or control my lighting (and a few other bits) from more than one location. Ended up adding a screen and an Arduino to the mix. Hoping to tie in with other Arduino fans and see what else we can control. I can do basics like voltage and current but would be nice to chat to canbus as a module is available. ;)

Video shows up and down led buttons Left,Right & Poptop an 'All Off' and a Door Lock/Unlock also have switch on B-pillar and Pop top.

Who is up for a bit of Arduino chat to see where we can go.


Kev
 
Count me in :waving:. Especially the canbus seems to be the way ahead to complete a few mods.
 
I've put 2 arduinos in.

A Mega to control the lights, and any future bits and bobs I think of. I didn't want the power consumption of a touchscreen though, so my buttons are on the lights. They work like this;
  • Multiple clicks cycle through 3 brightness levels.
  • A single click turns a light on or off.
  • Bed lights turn on dim first press, kitchen lights turn on bright first press.
  • If a light is on, a long press will turn ALL lights off
  • If a light is off, a long press will turn ALL lights on
I put a 4 core to each light;
  • 12v,
  • PWM for the light,
  • Pushbutton input
  • PWM for the pushbutton led (these glow dimly at night)
I built a 8 channel MOSFET power board as I couldn't find an off the shelf one.

And lastly, all the PWM has 'soft' switching, so the lights turn on and off gradually :)

If I get time & inclination, I may ditch the little cheap looking crappy LED gas-it display that came with my LPG tank and fit an arduino OLED display, for this I'll need to figure out how the tank sender works. I think it's 0 to 90ohm when the tank is full/empty, but I've no idea if its linear, or maybe 20-90ohm??

At some point i may fit a water tank level sensor, and put this on the OLED too.

And I have a Nano33BLE with 3.2"OLED for display in the front. This talks to my renogy DCC50s to get all the DC/DC and solar data over Modbus485 and display it on the OLED. I also found the Nano has an accelerometer, which I used to calculate and display van level, side to side, and front to back, in units of mm at the wheels, so I can see what size chocks I need for camping! I haven't fitted this yet, but will post some pics when it's done.

I had thought about hooking up to CAN, with ideas like turning all the lights off if the van gets locked, turning the slide door light on when that door is opened etc. So I'm interested in how it goes if you do this. I have a CANbus analyzer which I use at work, so I can see the CAN traffic if need be.
 
I have a Mega reading and displaying Victron information and a D1 Mini Pro linked to my alarm and communicating with the onboard Wifi router. Not that it gets to leave the garage these days. I'm finding the D1 Minis a bit unreliable around the house though and am probably going to replace the van one with a NodeMCU which I've found to be rock solid.
 
I quite like the idea of an accelerometer to display levelling as in the Cali, could even feed into the 2nd video input of my Kenwood. At the moment though I find chucking the iphone on the floor with a bubble level app works well.
 
I quite like the idea of an accelerometer to display levelling as in the Cali, could even feed into the 2nd video input of my Kenwood. At the moment though I find chucking the iphone on the floor with a bubble level app works well.
I've been putting a beer can on the kitchen worktop, as if i needed an excuse to get one out of the fridge :)
 
Morning Jay

I like idea of custom board, I went for off shelf 4 channel mosfet. Would be nice idea to make up a board others could use plug and play style.

If I get time & inclination, I may ditch the little cheap looking crappy LED gas-it display that came with my LPG tank and fit an arduino OLED display, for this I'll need to figure out how the tank sender works. I think it's 0 to 90ohm when the tank is full/empty, but I've no idea if its linear, or maybe 20-90ohm??
My LPG sender is linear 0-95 Ohm, built a bridge and use voltage to work out fill level. It's fine to use when stationary but would need to get a bit clever if using on the move.

I didn't want the power consumption of a touchscreen

I got the 5" Nextion it's about 15mA on standby. U can code to switch off after no touch and wake up on touch.

I will try get an Area where we can share code as I'm new to Arduino and my code cobbled together from bits I found and guessed.

Kev
 
I like idea of custom board, I went for off shelf 4 channel mosfet. Would be nice idea to make up a board others could use plug and play style.

For the board to be useful to others firstly it would need to be a PCB, not stripboard, and secondly it's customised to my wiring plan really;

The white connectors are for each light, and power the light itself, power the illuminated button and take in the pushbutton contact
The LHS 8 way black connector takes the 8 pushbuttons to the MEGA
The RHS 8 way black connector brings 8 MEGA PWM outputs to the stripboard
The blue terminals are 12V power
The little BLUE PCB is a ~12V to 5V regulator
The little black connector takes 5V to the MEGA

2020-10-27 17.19.49.jpg

Someday, if I can be bothered, I may make a PCB, but I doubt it would be useful to anyone else :)

My LPG sender is linear 0-95 Ohm, built a bridge and use voltage to work out fill level. It's fine to use when stationary but would need to get a bit clever if using on the move.

Useful info, thanks!

I got the 5" Nextion it's about 15mA on standby. U can code to switch off after no touch and wake up on touch.

That sounds pretty good, but not for me. Despite appearances, I'm trying the keep the tech hidden away, and purely functional. The only reason I didn't go 'off the shelf' with lighting is because I could chuck it all in and decide later how it should work, and easily change my mind if need be.
 
Here's my (almost) finished arduino display for my solar, dc/dc and van levelling;
 
Helloooo

Long time no see ;) I was getting fed up not being able being able to dim or control my lighting (and a few other bits) from more than one location. Ended up adding a screen and an Arduino to the mix. Hoping to tie in with other Arduino fans and see what else we can control. I can do basics like voltage and current but would be nice to chat to canbus as a module is available. ;)

Video shows up and down led buttons Left,Right & Poptop an 'All Off' and a Door Lock/Unlock also have switch on B-pillar and Pop top.

Who is up for a bit of Arduino chat to see where we can go.


Kev
What have you used for your door lock/unlock signal? Red/brown wire as a switch input? Can you share your wiring diagram for this part of the circuit?
I'm using an esp32 but unsure how to convert the switched -I've from BCM into a switched input to the esp32.
 
Back
Top