aftermathx25
New Member
Hello everyone,
First of all I want to say Hi, I'm new here.
I am actually in progress of my own home automation system.
My main motivation to create it was an engineer thesis, but I went beyond that and decided to continue the project.
I am creating this topic here to share my ideas and hear yours to improve/change/add features etc..
So let's begin:
Said component is Raspberry Pi Zero. I am using the cheapest variant without WiFi and Bluetooth module.
Its role is to be a control center unit device.
We will be back with RPi, now let's jump to the next component:
Map coverage: EuropeProcessor: Samsung 6443 400 MHz
As I saw this I knew that if something has only 4 pins it has to be simple.
So I went on eBay and started looking for the touchscreen controllers.
At this moment I started to develop software part of this project.
There are many things in both hardware and software.
I had a lot of code left from my last project where I used ESP8266 as a slave units to send data but I need to rewrite it to work with the current project.
I hope you made it to the end of this post.
Greetings, Aftermathx25
First of all I want to say Hi, I'm new here.
I am actually in progress of my own home automation system.
My main motivation to create it was an engineer thesis, but I went beyond that and decided to continue the project.
I am creating this topic here to share my ideas and hear yours to improve/change/add features etc..
So let's begin:
I'd like to highlight that I hate making orders online for electronics because it always ends up the same way:
Oh, I need one resistor and two electrolytic capacitors. Your basket total value is: $300
So that's the reason why I want to use as much recycled parts as possible, and it also makes me think, what and how can I use.
The main component I had laying around may be considered as new but it was used already in other project so I just borrowed it.Said component is Raspberry Pi Zero. I am using the cheapest variant without WiFi and Bluetooth module.
Its role is to be a control center unit device.
Let me explain what I mean by control center:
- It is running main controller process to receive all signals from slave units
- It is able to display a GUI to control said slave units and/or read data from them
You may think that 1GHz processor and 512MB of RAM may have troubles with handling that tasks.
I thought that too but as far as I tested it with first version of app which was based on cloud MQTT broker, it worked fine and very smoothly.
So I guess it will do just fine for this project. Let's not forget that it has to be low-cost not real-time high-end system.
We will be back with RPi, now let's jump to the next component:
I had an old navigation unit laying around and collecting dust. It is too old to handle newest maps so I decided to gave it a second life.
It looked like this:
It is Mio Spirit 680:
Let's look at the specs:
Screen size: 5.0"
Screen resolution: 480x272
Touchscreen: Yes
A/V Input: Yes
To be honest I kinda shortened these specs, because we don't need to know everything about that thing. (btw. I looked for the datasheet or info about this processor but I couldn't find anything)
DISPLAY
The feature that stole my heart was A/V Input. So it has 2.5" jack A/V input. Unfortunately I couldn't find any cable laying around, so I decided to make one myself.
I started looking for pinouts or any schematics.
After many tears and about an hour I decided to find the "yellow input" myself.
I had desoldered the socket and I found the pins which transmitted the video:
This basically gave me an ability to use the screen:
(Don't worry about these Python errors these are fixed already)
You don't need to be an expert to tell that both camera operator and the screen quality are bad. That statement is very true.
I had to make some adjustments. The main reason for this poor quality on the picture was wrong video system. RPi was set as NTSC by default but this screen is using PAL.
After changing that setting image quality has become much better.
Note: Camera operator wasn't fixed in this step.
Also on this picture you can see me installing system using USB mouse.
At this stage I started to imagine me standing in front of this tiny screen turning a wireless mouse on and navigating on this tiny screen to turn on my lights.
This would be too much effort. I'd rather unscrew the bulb than do that.
So here comes the interesting part:
TOUCHSCREEN
So I need a touchscreen input, but this is an integrated LCD and touchscreen module, how can I do that?
I had a very similar unit also laying around so it was time for: DISASSEMBLY TIME!
I had to unscrew the panel and gently remove the protective tape from the display flex.After that I connected the screen back to the unit to make sure it still works.
So I the touchscreen module is a simple 4-wire resistive touchscreen.
I desoldered touchscreen flex from the main one and extended it a little.I started to measure it's resistance values with the multimeter and with the oscilloscope.
Just kidding. In this project we either do something ourselves or we have it already.
I thought that someone already did a touchscreen driver program for the Arduino or something but I couldn't find it or nobody created this before.
So it was my turn to do that.
I used a base code found on the internet but it was missing features and it looked like a proof of concept rather than working code, so I added features and published it on my GitHub for you people to enjoy if you need it: Link to my ->> GitHub
At first I used an Arduino Micro to use it as a HID device but a library I used was buggy on Raspbian so I decided not to write my own library.
Just to utilize a better (in my opinion) more reliable solution which was a simple Python script to translate touch coordinates send over a serial port to mouse coordinates and then simulate a click at this position.
Just to utilize a better (in my opinion) more reliable solution which was a simple Python script to translate touch coordinates send over a serial port to mouse coordinates and then simulate a click at this position.
Now it works flawlessly. You can see it in action in the video below.
USB PORTS
I thought I'd need more than one USB and I wasn't mistaken. So I found almost ancient USB hub which can be nearly as old as me. I disassembled it and soldered to the RPi power and USB data lines.
WI-FI
I just connected a USB Wi-Fi card I had which I bought 2 years ago for like $5.
No problems so far.
At this moment I started to develop software part of this project.
SOFTWARE
I had created a server in Node.js to utilize WebSockets to render a data in real time.
To show data to user I am using Chromium browser which autostarts in kiosk mode.
On the video below you can see a demo of this server testing touchscreen precision.
VIDEO - FIRST TESTS
There are many things in both hardware and software.
I had a lot of code left from my last project where I used ESP8266 as a slave units to send data but I need to rewrite it to work with the current project.
You can tell me what do you think about this project and also I'd glad to hear your suggestions and if I did something wrong please point it out to me.I hope you made it to the end of this post.
Greetings, Aftermathx25