Power for Micro Controller - Page 2 - Second Generation Nissan Xterra Forums (2005+)
 8Likes
Reply
 
LinkBack Thread Tools Display Modes
post #11 of 22 (permalink) Old 01-16-2019, 03:53 PM
Some random dude
2006 Solar Yellow ❌terra Off Road 6MT
 
meisanerd's Avatar
 
Join Date: Feb 2017
Location: Edmonton, AB, Canada
Posts: 330
Garage
Ahh, yes, forgot about that. Yah, an LM7809 with a filtering capacitor would likely solve that problem for you, into the Vin port on the Arduino. Power the bluetooth module off the 5v pin on the Arduino, and you should be good.
KnightArmorX likes this.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
meisanerd is offline  
Sponsored Links
Advertisement
 
post #12 of 22 (permalink) Old 01-17-2019, 04:15 PM
Veteran
2010 X
 
Join Date: Nov 2013
Location: Vancouver, BC
Posts: 740
Wow, this is an ambitions project! Maybe too ambitions.

Post pics. One thing I've noticed is that touch interfaces are not conducive to usage while driving, I prefer physical controls. This is a sweet project though.
eighty is online now  
post #13 of 22 (permalink) Old 01-17-2019, 05:40 PM
2013 Pro4X 6M/T
2013 Night Armor ❌terra Pro-4X 6MT
 
LNXPenguin's Avatar
 
Join Date: May 2016
Location: Somewhere in CommuNewsom's state
Posts: 430
This fits the bill for you https://www.amazon.com/DROK-Adjustab...c+dc+converter I used this to step down a 36v source to 6.5VDC to the Vin on an Arduino Mega 2560 clone, this creates a high enough voltage for the board to then iron out to 5VDC using its own integrated voltage regulator. If you are running relays as it looks like you intend to, there are prebuilt modules that require very little current to trigger and will handle about 10A. If you need more, I would suggest using an opto-isolator or solid state relay to do the switching versus mechanical reed relay. Check out Opto 22 for nice, affordable solid state relays. For lower currents, such as LED lighting, etc, a TIP102 NPN darlington transistor, 1K ohm resistor and 1N4004 diode can go a long way to switch inductive loads up to about 8A peak with proper heat sinks installed.

I would suggest if you are going to use a microcontroller in the rig, use something that you can solder onto like the Arduino compatible Teensy 3.x series, 3.6 has real time clock built in, 3.2 has space to solder in a battery and 32khz crystal to provide real time clock functions. If you want something with more outputs, I would suggest the Meduino 2560 (which can be found on ebay for under $15) this is Arduino Mega 2560 compatible, has 8k RAM and 256KB storage. The Arduino Uno has only 2K RAM, and only a handful of pins free after a touchscreen is attached. The above DC-DC converter does a decent job of providing clean DC into the board.

https://www.amazon.com/SainSmart-iMa...2Barduino&th=1
nworker likes this.

Professional amateur wanderer
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Last edited by LNXPenguin; 01-17-2019 at 05:50 PM.
LNXPenguin is offline  
 
post #14 of 22 (permalink) Old 01-17-2019, 07:09 PM Thread Starter
TNX Realm Noobie
2012 Xterra Night Armor Pro-4X
 
KnightArmorX's Avatar
 
Join Date: Nov 2018
Location: Mississippi
Posts: 39
Thanks, @LNXPenguin. That should fit the bill.
I have already purchased most of the parts.:
* Optoisolated relay board
* Adafruit Metro Mini microcontroller
* Adafruit Bluefruit LE SPI Freind
I think these will work. Iím not planning to build a touchscreen for this project. I considered it, but decided to back away from that much complexity. I plan to use my iPhon for now.
KnightArmorX is offline  
post #15 of 22 (permalink) Old 01-17-2019, 07:12 PM Thread Starter
TNX Realm Noobie
2012 Xterra Night Armor Pro-4X
 
KnightArmorX's Avatar
 
Join Date: Nov 2018
Location: Mississippi
Posts: 39
@LNXPenguin,
Do you have any experience with Bluetooth LE? So far, this is proving to be the hardest thing for me to learn. I might have a few questions along the way.
KnightArmorX is offline  
post #16 of 22 (permalink) Old 01-17-2019, 09:18 PM
2013 Pro4X 6M/T
2013 Night Armor ❌terra Pro-4X 6MT
 
LNXPenguin's Avatar
 
Join Date: May 2016
Location: Somewhere in CommuNewsom's state
Posts: 430
Unfortunately, I haven't worked with Bluetooth and Arduino yet. I have worked on my fair share of Arduino projects in the past, and have had to get creative powering things. If you notice you have too much "ripple" even with that DC-DC converter, you can simply add a 1000 uf, 16v capacitor across the Vin and ground, making sure to match polarity of course, to smooth out the DC. I know your motivation for this was to create a control panel for lighting to give you more flexibility with switch locations as the conventional rocker switches do take up a lot of real-estate, which the front panels are greatly lacking.

I can suggest taking into account having a fallback localized controller for the systems. I know you have plans to use your phone to control the whole setup via Bluetooth, but remember, phones can get lost, break, batteries can die, etc. It's a nice additional feature to have for sure, and I like the way you are approaching the problem. There are touch screen displays, about 3.5" in size, or roughly 3 rocker switches in width, that are easily to natively wire to an arduino and the libraries aren't too hard to use and program with. It takes about 12 I/O lines I would suggest SPI bus for the easiest wiring. You will need to keep two of the analog pins free for the touch screen portion to work, but the remainder of pins are fairly flexible, I believe most Arduinos and clones have a 6 pin ICSP port that can handle supplying voltage, ground, MISO, MOSI, clock and reset signals to the device.

In case phone is out of commission, having that backup interface allows you to still use the features that you may or may not depend on, but they will still be an option. The phone can act as a backup in case the screen on the local controls get damaged, this ensures you a bit of a failsafe. I am sure you will see many people mention fail safe designs in many threads here, it is far better to have a solution be over-egnineered and never need some of the features than having something barely meet your needs and fail at the worst possible moment, experience has been a cruel, but fair teacher. Just my $0.02 cents.
nworker and KnightArmorX like this.

Professional amateur wanderer
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
LNXPenguin is offline  
post #17 of 22 (permalink) Old 01-17-2019, 10:47 PM Thread Starter
TNX Realm Noobie
2012 Xterra Night Armor Pro-4X
 
KnightArmorX's Avatar
 
Join Date: Nov 2018
Location: Mississippi
Posts: 39
Great advice, @LNXPenguin.
My backup plan has 2 layers. (1) A small, wired remote with a series of buttons to toggle the inputs HIGH/LOW. Iíll keep it tucked away out of sight. (2) Repurpose a retired phone as a permanent resident in the Xterra, and have the app on it and my active phone.

I really like the idea of a wired touch screen. If I donít have a breakthrough with the Bluetooth LE (BLE) programming soon, I will probably switch gears completely and use a wired touchscreen as the primary interface. That option has cool factor also.

This will get the system running, and I can test the suitability of my optoisolated relay board.
This will also buy me some time to figure out the BLE communication.

This is a really beneficial conversation.
I think I will go ahead and order the touchscreen and related requirements just in case. That will be fun to play with anyway.
LNXPenguin likes this.
KnightArmorX is offline  
post #18 of 22 (permalink) Old 01-18-2019, 01:04 PM
Some random dude
2006 Solar Yellow ❌terra Off Road 6MT
 
meisanerd's Avatar
 
Join Date: Feb 2017
Location: Edmonton, AB, Canada
Posts: 330
Garage
Yah, BLE is fun... I haven't done any iOS dev using it, but making it work on Android was entertaining, in a not-very-actually-entertaining sort of way... There is a lot of trial-and-error involved, matching up device ids and capabilities to get the access you want. Once you have it connecting, though, the actual signalling (ie: turn on light 1) was pretty straight-forward.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
meisanerd is offline  
post #19 of 22 (permalink) Old 01-18-2019, 03:29 PM Thread Starter
TNX Realm Noobie
2012 Xterra Night Armor Pro-4X
 
KnightArmorX's Avatar
 
Join Date: Nov 2018
Location: Mississippi
Posts: 39
Hey, @meisanerd. I'm glad you're still with us.

I am having trouble finding some example code to use as a starting point. All of the code that I have been using from the example sketches is just talking back and forth from the phone app through the BLE & microcontroller to the computer Serial Monitor. For some reason, this isn't helping me understand how to get the microcontroller to take "On/Off" instructions and use them to switch the lights.

Maybe a couple of shots of Jose to go with my Miller Lite's will get my mind to relax enough to see it.
KnightArmorX is offline  
post #20 of 22 (permalink) Old 01-18-2019, 04:13 PM
Some random dude
2006 Solar Yellow ❌terra Off Road 6MT
 
meisanerd's Avatar
 
Join Date: Feb 2017
Location: Edmonton, AB, Canada
Posts: 330
Garage
Without seeing which sketches you are looking at specifically, I can only guess, but chances are there is somewhere that it is doing a write to the serial for the computer, you would just have to replace that code with logic to determine what you are doing with the value being read. If you can get the example sketch working with your phone and computer, you are probably 90% of the way there as far as comms go, as the last 10% is just reading the value on the arduino instead of forwarding it to the computer, and then determining what to do with it. You could probably even get away with something as simple as sending a byte of data from the phone, and parsing it into the bits to know what to do (ie: first 7 defines switch id, last one is either 0 or 1 for off or on). The other thing to consider is monitoring, so the app on your phone knows if it worked or not.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
meisanerd is offline  
Reply

  Second Generation Nissan Xterra Forums (2005+) > Xterra Tech Topics > Electronics

Quick Reply
Message:
Options

Register Now



In order to be able to post messages on the Second Generation Nissan Xterra Forums (2005+) forums, you must first register.
Please enter your desired user name, your email address and other required details in the form below.

User Name:
Password
Please enter a password for your user account. Note that passwords are case-sensitive.

Password:


Confirm Password:
Email Address
Please enter a valid email address for yourself.

Email Address:
OR

Log-in










Thread Tools
Show Printable Version Show Printable Version
Email this Page Email this Page
Display Modes
Linear Mode Linear Mode



Posting Rules  
You may post new threads
You may post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

 
For the best viewing experience please update your browser to Google Chrome