flyingbrick

Arduino stuff/ programing/so cheap

Recommended Posts

^ Good call.

Also, if not, have a looky round the docs, some modern devices might run faster I2C. I2C used to be 100kHz, then 400, but I've seen some devices will do i2c at 2.4ish MHz

  • Like 1

Share this post


Link to post
Share on other sites

Nailed this issue :D

 

Was looking through an example and noticed this in the sketch

 

Quote

// Option 1: use any pins but a little slower
//Adafruit_SSD1331 display = Adafruit_SSD1331(cs, dc, mosi, sclk, rst);  

// Option 2: must use the hardware SPI pins 
// (for UNO thats sclk = 13 and sid = 11) and pin 10 must be 
// an output. This is much faster - also required if you want
// to use the microSD card (see the image drawing example)
Adafruit_SSD1331 display = Adafruit_SSD1331(cs, dc, rst);

 

A simple copy paste to change from option 1 to option 2 and its away :-D I copy pasted out a long benchmark (just filling the screen with different colors over and over) with a time running counter displayed at the end and tested the two options. before it took 153 seconds to run the sketch, got that down to 33 seconds :-D

 

 

20170804_212239.jpg

  • Like 3

Share this post


Link to post
Share on other sites

Hi guys,.

Okay, two simple (probably related problems that i cant solve via google)

 I decided to use the tone function to reproduce the oldschool CLICK sound that would happen when indicating. The code is extremely basic and near impossible to fopar HOWEVER it makes my whole program extremely unstable which leads to the screen randomly displaying garbled garbage which DOES NOT rectify itself on reset.

The second issue was with a simple piece of code that played a series of around 10 tones with ever increasing pitch. 

If i leave the arduino looping the code and playing the tone sequence over and over EVENTUALLY it starts either skipping notes or simply playing notes at random times out of sequence. 

Any idea what could be up here? 

I'm using a little buzzer piezo thing from a PC without a resistor... could it be drawing too much juice and making shit go bad that way?

 

Share this post


Link to post
Share on other sites

Example code?

Wiring diagram and piezo part number or pic or datasheet.pdf please.

Share this post


Link to post
Share on other sites

I'm having a bunch of fun doing these arduino projects, can think of so many sweet projects you could do with this stuff. 

 

Cool project would be to have a light sensor and turn on headlight relay when there is no light outsite. maybe when I get back to NZ I can make that project. Use a 3D printer to make a little housing

 

Also crusty escort wiper motor control. The OG ford switch has some tricks inside it to make sure it returns home when the wipers are switched off, but I havent been able to find a replacement, other than using an aftermarket headlight switch and losing a speed on the wipers

  • Like 1

Share this post


Link to post
Share on other sites
On 04/08/2017 at 20:56, flyingbrick said:

Nailed this issue :D

 

Was looking through an example and noticed this in the sketch

 

 

A simple copy paste to change from option 1 to option 2 and its away :-D I copy pasted out a long benchmark (just filling the screen with different colors over and over) with a time running counter displayed at the end and tested the two options. before it took 153 seconds to run the sketch, got that down to 33 seconds :-D

 

 

20170804_212239.jpg

 

I have had a huge amount of success since these last posts- my biggest is a change from the CRAP adafruit library to the one on this link

https://github.com/sumotoy/SSD_13XX/blob/master/README.md

This new library is fuggin amazing- a tiny change and my benchmark drops from the 33 seconds I was happy about above to FOUR SECONDS.

I'm now happy I took the time to produce the quick benchmark program and actually record the times.

All logos/warning lamps are now BMP files converted to code like this

Quote

{


0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc0,
0xff,0xff,0xff,0xff,0xff,0xe1,0xff,0xff,0xff,0xff,0xc0,
0xff,0xff,0xff,0xff,0xff,0xe0,0xff,0xff,0xff,0xff,0xc0,
0xff,0xff,0xff,0xff,0xff,0xc0,0xff,0xff,0xff,0xff,0xc0,
0xff,0xff,0xff,0xff,0xff,0x80,0x7f,0xff,0xff,0xff,0xc0,
0xff,0xff,0xff,0xff,0xff,0x0,0x7f,0xff,0xff,0xff,0xc0,
0xff,0xff,0xff,0xff,0xff,0x0,0x7f,0xff,0xff,0xff,0xc0,
0xff,0xff,0xff,0xff,0xfe,0x0,0x3f,0xff,0xff,0xff,0xc0,
0xff,0xff,0xff,0xff,0xfc,0x0,0x3f,0xff,0xff,0xff,0xc0,
0xff,0xff,0xff,0xff,0xfc,0x0,0x3f,0xff,0xff,0xff,0xc0,
0xff,0xff,0xff,0xff,0xf8,0x0,0x1f,0xff,0xff,0xff,0xc0,
0xff,0xff,0xff,0xff,0xf0,0x0,0x1f,0xff,0xff,0xff,0xc0,
0xff,0xff,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,0x0,0x0,0xc,0x0,0x0,0x3f,0xff,0xff,0xc0,
0xff,0xfe,0x0,0x0,0x1e,0x0,0x0,0x3f,0xff,0xff,0xc0,
0xff,0xfc,0x0,0x0,0x3e,0x0,0x0,0x3f,0xff,0xff,0xc0,
0xff,0xfc,0x0,0x0,0x7f,0x0,0x0,0x3f,0xff,0xff,0xc0,
0xff,0xfc,0x0,0x1,0xff,0x0,0x0,0x3f,0xff,0xff,0xc0,
0xff,0xf8,0x0,0xf,0xff,0x80,0x0,0x3f,0xff,0xff,0xc0,
0xff,0xf8,0x0,0x7f,0xff,0xc0,0x0,0x3f,0xff,0xff,0xc0,
0xff,0xf8,0x3,0xff,0xff,0xe0,0x0,0x3f,0xff,0xff,0xc0,
0xff,0xfc,0x1f,0xff,0xff,0xf8,0x0,0x3f,0xff,0xff,0xc0,
0xff,0xff,0xff,0xff,0xff,0xfc,0x0,0x3f,0xff,0xff,0xc0,
0xff,0xff,0xff,0xff,0xff,0xfe,0x0,0x3f,0xff,0xff,0xc0,
0xff,0xff,0xff,0xff,0xff,0xff,0x80,0x3f,0xff,0xff,0xc0,
0xff,0xff,0xff,0xff,0xff,0xff,0xc0,0x3f,0xff,0xff,0xc0,
0xff,0xff,0xff,0xff,0xff,0xff,0xe0,0x3f,0xff,0xff,0xc0,
0xff,0xff,0xff,0xff,0xff,0xff,0xf8,0x3f,0xff,0xff,0xc0,
0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x7f,0xff,0xff,0xc0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc0,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc0
};

I was starting to lose interest because it took a visible amount of time to draw each icon! now they appear instantly..oh and theres a seriously wanky startup logo now :-D

 

 

  • Like 3

Share this post


Link to post
Share on other sites

Hey people I've been thinking about copying this for some canbus fun:

http://paulr33.com/evo/vipec_can/

Using this screen 

http://www.4dsystems.com.au/product/uLCD_32PTU_AR/

I notice that some people here have mentioned that the update speed of arduino for a screen is quite slow, but this type of screen looks to have its own processing etc. 

So would that improve the refresh rate at all / by much? 

Keen to get some custom jibber jabber up on a screen in the dash unit.

Share this post


Link to post
Share on other sites

Serial interface seems a bit odd, will probably top out at 1Mbit, but drawing smart things may save the time. You'll probably have to look for reviews, google the product name and "slow" or "problems", or just gice it a try. It's kind of hard to predict with these things, sometimes, so much depends on architecture and implementation, which is hard to analyse in advance. Sorry I can't offer more...

  • Like 1

Share this post


Link to post
Share on other sites

I forgot the part number right this minute, but FTDI makes an LCD controller chip that takes lots of the processing away... Just google FTDI LCD and should get it

  • Like 1

Share this post


Link to post
Share on other sites

I made a little PCB!!

This one is the result of my second attempt at ironing the transfer to the copper. it was not perfect but good enough for me- unfortunately my sharpie has a thick tip so was hard to touch up any missed bits. This will hold my 6 little relays.

 

 

 

20170929_213944.jpg

  • Like 5

Share this post


Link to post
Share on other sites

What software did you use? I used to use eagle before it was sold to autodesk. Haven't tried it lately, dunno what the free license is like now

  • Like 1

Share this post


Link to post
Share on other sites

I used Circuit Maker but then sent it to work email as a PDF, then imported into CAD, resized it to scale and then printed.

To be honest I must have tried about 5 programs and all of them seemed difficult as hell to use. I understand people might need auto routing and 1 million layers etc but I didn't and the complexity sucked.

I couldn't even work out how to change track width so ended up with these tiny lines that could have been 2x the width. 

About ironing on the laser print- I tried about 5 times- my first attempt was half adhered. My second attempt is the one i used. My 3rd, 4th and 5th attempts were worse than the first despite trying every single tip I could find (getting the copper super clean, scuffing with steel wool, water, soap, dipping in acid etc etc etc)

Am a little tempted to send the file to a professional and just spending the $$ to get it done nicely with pre drilled holes etc.

 

 

 

20170929_132144.jpg

Share this post


Link to post
Share on other sites
17 hours ago, Ned said:

I forgot the part number right this minute, but FTDI makes an LCD controller chip that takes lots of the processing away... Just google FTDI LCD and should get it

Looks like its only for TFT displays which (in my opinion) are fuckin terrible for auto application due to very narrow viewing angle (on the few that i have seen anyway) . I'm not sure if large OLED screens are even available but they are really the only type worth spending money on

The slow processing speeds are not really a problem if you design your interface to compensate- EG make the information to be sent as small as possible.

Share this post


Link to post
Share on other sites

circuit maker is made by altium, so line width is likely the tab key (tab key gets you into the properties box of whatever you're doing)

and just send the PCBs to OSH Park and you will get 3 of those PCBs pro made for $5 per square inch or something, and they free ship it back to NZ. Bloody great for hobby stuff if yuou can wait the 3 weeks to get the PCBs

  • Like 2

Share this post


Link to post
Share on other sites

Bought some solder paste and cooked things on an element. Probably got it all too hot but wont know until i test it :-)

All the connections and tracks work :-D

20171001_162833.jpg

  • Like 5

Share this post


Link to post
Share on other sites

20171013_191946.jpg

I am REALLY happy with how this has turned out. MY PCB/little relays work as they should and its all been potted in hot glue and tests A+. 

I ended up using a little LM1084 voltage regulator and some little capacitors and tiny prototype board to get down to 5v. The relay PCB is wired to the arduino using little wires salvaged from a broken USB cable :-D

 

Basically- the wires coming out of the left just get connected to switches in the vehicle (like the handbrake or gear indicator switches) and the wires on the right get fed 12v to close the relays switch (eg, 12v from the headlights )

I used hot melt glue because it was cheap, fast and easy (pretty much my life motto). It looked like shit until baked in the oven for 10 minutes at a low temp. Its an awesome thing to do on electrical shit like this and its turned from being a fragile heap of shit to a robust heap of shit.

 

:-D

20171010_183450.jpg

  • Like 3

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now