ODB2 port based gauge system
This project is probably 70% complete.
I looked into fitting extra gauges in my Ford Ranger and could not believe how much a digital gauge costs.
So, Ebay came to the rescue. I bought a bluetooth ODB2 port reader for £4, and a selection of LCD displays.
The best display seems to be the 2.2" one. I have a larger 3.2" touchscreen but I think that is going to be too large.
Plus, the 2.2" screens are peanuts to buy.
So, I hooked one up to an Arduino Mega 2560 and began programming.
As usual, I got carried away and instead of making a simple gauge, you can now select one of many layouts, colours, and also select what information you want to display.
The data is retrieved from the trucks ECU via a bluetooth HC-06 module. It talks to the truck and takes the data it needs.
I will probably hard wire to the ODB2 port when the project is completed, although it will still have the bluetooth function.
I purchased from a scrapped truck, the pair of interior corner trims that run up the insides of the windscreen.
Eventually, I will custom mold half a dozen screens into these trims and install them on each side.
I looked into fitting extra gauges in my Ford Ranger and could not believe how much a digital gauge costs.
So, Ebay came to the rescue. I bought a bluetooth ODB2 port reader for £4, and a selection of LCD displays.
The best display seems to be the 2.2" one. I have a larger 3.2" touchscreen but I think that is going to be too large.
Plus, the 2.2" screens are peanuts to buy.
So, I hooked one up to an Arduino Mega 2560 and began programming.
As usual, I got carried away and instead of making a simple gauge, you can now select one of many layouts, colours, and also select what information you want to display.
The data is retrieved from the trucks ECU via a bluetooth HC-06 module. It talks to the truck and takes the data it needs.
I will probably hard wire to the ODB2 port when the project is completed, although it will still have the bluetooth function.
I purchased from a scrapped truck, the pair of interior corner trims that run up the insides of the windscreen.
Eventually, I will custom mold half a dozen screens into these trims and install them on each side.
|
|
Gear indicator
This is a little project. I have a slight habit of having the music in my truck so loud, that I don't notice what gear I am in.
Or, I drop down to 5th in roadworks or something, and then forget to put it back into 6th on the motorway.
So, mounted into the top of the corner trims I am going to make for the above gauges, will be this tiny little screen.
It is about an inch wide and simply displays the gear that you are in.
Based on an Arduino Mini Pro chip, its pretty simple.
The gearstick position is deducted by a set of reed switches mounted around the base of the gearstick. There is a small circle of magnets on the bottom of the shifter.
Or, I drop down to 5th in roadworks or something, and then forget to put it back into 6th on the motorway.
So, mounted into the top of the corner trims I am going to make for the above gauges, will be this tiny little screen.
It is about an inch wide and simply displays the gear that you are in.
Based on an Arduino Mini Pro chip, its pretty simple.
The gearstick position is deducted by a set of reed switches mounted around the base of the gearstick. There is a small circle of magnets on the bottom of the shifter.
Bluetooth controlled sensor
I have designed a Bluetooth controlled PIR sensor. The idea is that you log in to the sensor with your phone and then set up the required detection requirements remotely. None of this vague turn a dial on the bottom of the PIR detector (as they usually are).
Many times I get asked to install sensors, and then the customer asks for a specific length of time for the light to stay on (triggered time).
This is hard to achieve, using the very vague trim pots that are used on most standard PIR sensors. These resistors probably set a discharge rate on a capacitor timing circuit and are not accurate at all.
Using a phone app, I can set the time down to a second.
I can also add a 'window' mode, where the sensor will only work between certain times of the day.
The Lux (light) level is also much more accurately controllable.
Finally the sensitivity can also be set from the phone.
Talking of writing apps, if you have an Android phone, then have a go with the free MIT App inventor.
This is a great bit of software. It takes a little bit of practice, and it has some odd quirks, but you can make some very professional looking apps for your phone.
I used it to make the remote control for my pickup trucks lighting and central locking.
Many times I get asked to install sensors, and then the customer asks for a specific length of time for the light to stay on (triggered time).
This is hard to achieve, using the very vague trim pots that are used on most standard PIR sensors. These resistors probably set a discharge rate on a capacitor timing circuit and are not accurate at all.
Using a phone app, I can set the time down to a second.
I can also add a 'window' mode, where the sensor will only work between certain times of the day.
The Lux (light) level is also much more accurately controllable.
Finally the sensitivity can also be set from the phone.
Talking of writing apps, if you have an Android phone, then have a go with the free MIT App inventor.
This is a great bit of software. It takes a little bit of practice, and it has some odd quirks, but you can make some very professional looking apps for your phone.
I used it to make the remote control for my pickup trucks lighting and central locking.
Above are the PCB layouts for the power supply and switching board, and the main control board.
I have designed them with Diptrace, an excellent PCB design software suite. It is free if you do not exceed a certain sized PCB (that I have yet to do).
These have just been emailed to a company for production (£20 for the pair). They will make a much better job than I can do at home. I am trying a copper milling technique, rather than the usual copper etch method.
The circuit basics are as follows. A dedicated 08m2 Picaxe IC monitors the received data from a HC-06 Bluetooth module.
If it receives valid data, then it flags a high signal to the main 14m2 Picaxe processor.
The reason for the 08m2 IC is purely for speed. If the main single processor sits waiting for Bluetooth data, it cannot really do anything else. If you do ask it to multitask, then its highly likely to miss the Bluetooth data packet while its completing some other request. Picaxe processors are not very fast at all.
The 14m2 takes this Bluetooth data from the 08m2 chip and converts it as required. If the on-board pots (time, sensitivity and Lux) are set at minimum, then it takes the value sent from the mobile phone app.
This means local control can be achieved without a phone if required, by turning the local pots up from minimum.
The PIR detection is handled by an industry standard PIR detector IC, the BISS0001.
I have designed them with Diptrace, an excellent PCB design software suite. It is free if you do not exceed a certain sized PCB (that I have yet to do).
These have just been emailed to a company for production (£20 for the pair). They will make a much better job than I can do at home. I am trying a copper milling technique, rather than the usual copper etch method.
The circuit basics are as follows. A dedicated 08m2 Picaxe IC monitors the received data from a HC-06 Bluetooth module.
If it receives valid data, then it flags a high signal to the main 14m2 Picaxe processor.
The reason for the 08m2 IC is purely for speed. If the main single processor sits waiting for Bluetooth data, it cannot really do anything else. If you do ask it to multitask, then its highly likely to miss the Bluetooth data packet while its completing some other request. Picaxe processors are not very fast at all.
The 14m2 takes this Bluetooth data from the 08m2 chip and converts it as required. If the on-board pots (time, sensitivity and Lux) are set at minimum, then it takes the value sent from the mobile phone app.
This means local control can be achieved without a phone if required, by turning the local pots up from minimum.
The PIR detection is handled by an industry standard PIR detector IC, the BISS0001.

This is the basic BISS0001 circuit that I worked with.
I removed the time adjustment, as this is now handled by the 14m2.
The light sensor input has also been removed, as this is also controlled by the main processor.
The range input pot has been replaced with an AD5242 1 Megohm digital resistor.
I removed the time adjustment, as this is now handled by the 14m2.
The light sensor input has also been removed, as this is also controlled by the main processor.
The range input pot has been replaced with an AD5242 1 Megohm digital resistor.
This is actually a dual resistor, but I am only using one side (I had it in the workshop).
Depending on the digital signal you send the AD5242, it applies the correct resistance to the BISS0001 to replace the manual adjustment sensitivity (range) pot.
Depending on the digital signal you send the AD5242, it applies the correct resistance to the BISS0001 to replace the manual adjustment sensitivity (range) pot.
The time is kept on the 14m2 by a real time clock IC.
The DS1302 needs a 32.768Khz crystal to keep accurate time. Communication of the hour, minute, second, date and year is by an I2c data bus. This is a pair of signal wires that allow multiple IC's to communicate with the main 14m2 Processor, using the same pair of wires. The digital data to the AD5242 digital resistor shares this I2c bus. Each component on the I2c bus has its own unique address. They are sometimes preset, or you address them manually with a set of high or low signals. |
The I2c bus consists of SCL and SDA. You also need a common 0v rail (negative).
SCL is the clock and is issued by the master device (in this case, the 14m2 processor).
The SDA line is the data. This line is read by the slave devices, which in my case are the AD5242 and the DS1302.
There are a lot of timing compliance's to deal with when using an I2c bus. I will not go into those here however.
SCL is the clock and is issued by the master device (in this case, the 14m2 processor).
The SDA line is the data. This line is read by the slave devices, which in my case are the AD5242 and the DS1302.
There are a lot of timing compliance's to deal with when using an I2c bus. I will not go into those here however.
My AD5242 for instance is addressed on pins 10 and 11.
I have them both set low ( 0 volts). A 'high' signal by the way is 5 volts. The pins SCL and SDA are the I2c data bus connections. Pin 'W1' is the wiper of the pot (centre terminal) and A1 and B1 are each end of the resistive track. I won't cover the other spare pins, as they are not relevant to this project. |
So here is a snippet of the data PDF for the AD5242. It shows the data that you need to send down the I2c data bus to get the AD5242's attention. So... You send the slave address first. So that is 01011 (remember that 0= 0 volts and 1= 5 volts). Then you send AD0 and AD1. These are the two pins you set on the chip when you wired it. In my case, its a further 00, as I set them both low. The next set of instructions tell the IC what it is supposed to be doing. I won't go into too much detail, but for instance, this could be whether to adjust resistance output 1 or resistance output 2. Again, these are just 1's or 0's. That is all binary data can contain. |
The final set of instructions is the data. This is basically a binary representation of the required figure between 0-255.
Zero is the resistance at its lowest level, and 255 is maximum resistance. So for instance, 127 (approximately half way) would be sent as 01111111. I could have designed and built this circuit using SMD components (Surface mount). They are much smaller than the DIL components I have used here. However, this is a prototype and I have nearly all the parts in DIL. Plus, with my dodgy old eyesight... DIL is far easier for me to solder! The only component I could not get in DIL (dual In Line), is the AD5242. So this SMT part will get soldered to a DIL converter. |
Well the PCB's are assembled (minus one chip that I am waiting for). It went together very well.
Only had to alter one component from the original track layout, and that just needed a new hole drilling.
The 230v relay board plugs into the bottom of the main PCB quite nicely.
The HC-06 bluetooth module is quite noisy on the power lines and is creating an issue with the communication lines between the other chips.
This is has actually lead to quite a few issues.
The HC-06 pulses at around 30mA while waiting to pair with a master bluetooth transmitter.
I had to add lots more smoothing and regulating circuitry to try and remove this 'noise' on the power bus.
This included a 1000uF capacitor across the HC-06 itself and several diodes.
The Vigortronix 1000mA PSU was also suffering with noise. A 47R resistor directly across the supply bus seems to have cured the issue. Its possible the low load was creating a problem for the regulator and it needed a steady load on its output to provide a smooth voltage.
I also increased the value of the resistor for the blue led from 100R to 330R. Otherwise the current was a little high for the Picaxe pin to supply.
All part of the design fun! (apparently)
Only had to alter one component from the original track layout, and that just needed a new hole drilling.
The 230v relay board plugs into the bottom of the main PCB quite nicely.
The HC-06 bluetooth module is quite noisy on the power lines and is creating an issue with the communication lines between the other chips.
This is has actually lead to quite a few issues.
The HC-06 pulses at around 30mA while waiting to pair with a master bluetooth transmitter.
I had to add lots more smoothing and regulating circuitry to try and remove this 'noise' on the power bus.
This included a 1000uF capacitor across the HC-06 itself and several diodes.
The Vigortronix 1000mA PSU was also suffering with noise. A 47R resistor directly across the supply bus seems to have cured the issue. Its possible the low load was creating a problem for the regulator and it needed a steady load on its output to provide a smooth voltage.
I also increased the value of the resistor for the blue led from 100R to 330R. Otherwise the current was a little high for the Picaxe pin to supply.
All part of the design fun! (apparently)