Putting Some Smartness Into A Smart Fortwo

I have been a happy owner of a 2006 700cc Smart Fortwo since last Summer. But I have been want to put some automation to it for a while. I started my endeavor to making windows open even when ignition is off. There is easy to  follow instruction on the net.

I plan to have a spesific feature which for example a coupe BMW has. When door is opened, door window automatically lowers a bit and when closing the door, window goes automatically up. I want it because every time I close the door I feel overpressure in the cabin. It seems there is no pressure relieve valve like in more ordinary cars. Windshield is the biggest window in the car and because overpressure the sealing of it get much stress when closing doors. A very common problem with Smart Fortwo is a leaking winshield. My car had it also. I think that leaking is caused by overpressure. Luckily I managed to find leakage before my control unit got wet. By the way, that control unit controls pretty much everything in this car so it really should stay dry. It is located below dashboard so it easily get wet if windshield leaks.

That window feature is not implemented yet but I have made some testing. Maybe I’ll write something about it when it is done.

At the moment I just finished a very early alpha version of the control of seat heating. A small microcontroller(Arduino) controls with relays contact pads of seat heater switches. It puts them on automatically when head lights are switched on. After 30 seconds it puts them off and they stays off until lights are cycled off and on again. Convenient! Heating time is short because heating element is so powerful.

As I want more, I equipped control system with a rotary encoder, a temperature sensor and an LCD. My plan is that user can control various variables in the system, for example heating time. And of course temperature depended heating. When environment is warm enough one do not want his/hers seat to be heatened! LCD can display temperature readings and/or how much heating time is left.

Here are some pics taken during the process:

The initial plan was to install everything here.

001-Environment-20160324_180158

Started to work by removing the Safety Triangle and dissassembling it.

002-Triangle-20160219_008

The journey continues by re-engineering.

003-Re-engineering_traces_20160218_003

The very first version of connection board.

004-First-revision-of-conn-board-20160303_013

Here one can see it from another side. I planned to use PC817 optocouplers for isolation but along the way I switched to relays. More on that later. I took the liberty to use USB-connector for connection with car’s electric system. D9 is for rotary encoder.

006-First-revision-of-conn-board-with-PC817_opto-20160312_075803

This is a starting point for house making to rotary encoder. Black case is from an old wall charger for Nokia mobile phone. Knob is from an old car stereo or something like that.

007-Rotary-control-knob-20160220_003

Here is a rotary encoder soldered in place. When I was continuing this build I realized that I should have put rotary the other way around, three legs pointing to left instead what it is now. Well, it happens to all of us..

008a-Rotary-progress-20160220_006

I also had to install capacitors to reduce interference. It still needs something, readings are not reliable enough.

008-Caps-for-encoder-20160313_103113

There is something in the mess, I rarely see a workbench which is tidy and clean. Hmm, except Quin Dunki’s bench. Her work is amazing.

Anyway, some progress has achieved.

012a-Testing-20160312_101144

This is my power supply. In it’s early life it served as 12V mobile phone charger. Through this I can safely use my small embedded systems in electrycally noisy car environment.

012-PSU-20160311_162310

This is my new connection board equipped with relays. As mentioned, previous plan was to use optocouplers. I did not managet to get them work, maybe because of some my stupid coding error. Anyway, I switched to relays.

Those relays “push” the triangle’s buttons when commanded by Arduino. Smart has conveniently system I like very much: Pushbutton is ON-OFF state information for car’s computer instead of some resistance change. This way relays can be used to “push” buttons.

From left to right connectors are: Black: Temperature probe connection, USB: Power to my system and controlling buttons and D9 is for rotary as earlier mentioned. Temperature connector in salvaged from an old PC’s motherboard. It is an audio connector. In the future there might be coming a minor problem with D9. In the end of cable is a quite heavy connector and stiff car’s suspension combined with that weight might do some issues by removing solder joints during time. That is to be seen.

015-Conn-board-rev_2-20160320_094237

This is a starting point for facade. The white plate is salvaged from an old laptop LCD monitor.

017-Starting-to-make-frontplate-20160312_083032

And here we are: Casing for encoder is ready, temperature sensor(red thing) is ready, main unit is ready. Now it only needs to be installed. And it maybe need some clever programming also. Now it is only a timer ) :

018-Assembled-20160324_174743

This is only temporarily mock-up.

020-Fitting-20160324_202349

From another angle. When thinking how to install main unit on top of dashboard wisely(read: do not drill holes in that dashboard) I got an idea: Why not make a console in front of gear stick and stuff the whole system inside it? That way there is room for that earlier mentioned window-control also.

Yes, that is a good idea. But then again that means a lot of work and no automated seat heaters yet. And Summer is coming. Also, I finally want to enjoy the work of my hands. It has been a long building process. What to do? Naturally install the system. Temporarily, of course. ūüėČ

Encoder is located beside the gear stick. Temperature sensor is on the floor, for now. Wires needs to be sorted. But it works. Hooray!

021-Another-view-of-fitting-20160324_202440

Here is a link for video

That’s all for now!

 

 

 

 

Advertisements

Servicing an Child’s Electric Piano

Recently we were given a small toy piano. Grandmother has bought it from the flea market. It is a very common cheap toy. Somewhere during the road it has had some bumps because half of the keys did not produce any sound at all.

Open it I did.. And it revealed it’s secrets to me. A piece of circuit board was missing, actually the whole board was cut in half. Luckily I managed to find that missing piece.

20150722_001

20150722_003-pala

After some thoughts it was clear what to next. I inserted some cyanoacrylate and then I could go repairing those broken lines. I had to remove some coating that solder could stay in place.

20150723_001.jpg

Then some soldering and it looked like this:

20150723_011.jpg

When reassembly was done I recognised that it works!

20160317_232851.jpg

Arduino, LCD and DS1820

As I mentioned in previous post, I might use those DS1820-sensors. And I did. Platform is the same, but enhanced by one little but mighty sensor. (Actually that sensor can be seen in previous post also.) Those little things are packed full of technology. They look like an ordinary transistor but that fools you a lot. They measure temperature quite a wide range (‚Äď55¬įC to +125¬įC) and convert analog readings to digital in no time. Multiple sensor can work in the same line because every one of them have it’s own unique serial number. They have also some other tricks in their sleeve, your favorite search engine will tell to you¬†a lot about them.

When measured temperature is already converted to digital values, it is easy to get those values to Arduino, for example. Code is in Git. Code is released under gnu gpl 3 and is patched together from others contribution with a little bit of my own code.

This apparatus measure temperature values and shows them in Celsius degrees in LCD. Video below.

 

Arduino, LCD, Rotary Encoder and Ikea USB-LED

Update 21.5.2014: Here is the source code: https://github.com/renerento

Yes, Arduino, a piece of electronics that divides people. Some of us like it and some of us hate it. I like it.
Some time ago I bought 2 Arduinos at once and started to play with them. At first my¬†goal was connect an Arduino to LCD and display some data on it. Then I realized that I have a rotary encoder and it would be fun to use that component as well. I digged code snippets from internet and found many ways to connect a rotary encoder to Arduino. Some of them used external capasitors for debouncing and I did not like that. Then I found Ben Buxton’s home page and used part of his code to make things click.

I also had some DS1820 temperature probes lying around and I decided to connect also them to Arduino. Maybe later more about that topic.

I found a simple aluminum enclosure. I modified it a bit for my components to fit in and started coding. As I am not a real coder, I simply searched code from the internet and modified it to suit for my applications.

This code does following:

When powered on string on LCD is displayed “LED dimming test”. After that display goes blank. When one rotates encoder¬†LCD shows either string “Minimum value reached!” or¬†up going numbers. Simultaneously with up going numbers the USB LED from Ikea¬†starts to shine. The more the numbers grow the more LED shine, until it reaches the max value. When that happens¬†LCD says “Maximum value reached!” User can decrease or increase the level of the numbers and¬†brightness simple rotating encoder. Numbers change 5 unit per one encoder click, min is of course 0, max is 255.

 

Here are some pics and video.

LED_Dimming_Arduino_And_LCD_01

LED_Dimming_Arduino_And_LCD_02

LED_Dimming_Arduino_And_LCD_03

 

Nokia N900 wireless charging #2

It’s been a while.

I put a wallwart to power the station and made two white lines to mark where system is working. I also superglued the coil and electronics behind the battery and cut a hole to the backplate of phone for them. I lifted coil a bit up with two sheets of plastic. I also covered both coil and electronics with esd-plastic sheet. Field experience is still zero, but who knows, maybe some day..

– Rene

charging.. someheight wireless System

Nokia N900 wireless charging

Disclaimer: If you make something similar showed in this blog and you or somebody or something gets hurt I am not responsible for that. Do it at your own risk.

As we all N900 owners know, battery life of the phone is not very good. After three years I finally got tired of sticking charger cable in every night to the phone and started to think how charging could be done differently. Few days went by and then I remembered: A while ago I saw in a supermarket a wireless charging kit for Nintendo Dsi. Could that kit be the key for N900 wireless charging?

I quickly googled the¬†DSi¬†battery¬†and¬†closer inspection showed that the battery voltage was the same in both devices, 3,7V. In the original DSi¬†charging¬†system there is a¬†some kind of¬†system that tells to the¬†loading station when stop charging. (I guess system measures charging current or voltage and when certain level is achieved charging is¬†stopped.) If I use DSi battery’s electronics I should be safe, the only thing that changes in the system¬†is battery capacity. Also N900’s battery has its own protection system from overcharging so there is actually¬†a double safety option. Feeding power back to N900 is another story but I think it can stand it.

Off to the¬†¬†supermarket we go.. Kit was still there and I quickly bought it. 15‚ā¨ well spent.

Package:

Battery:

One can see that the charging system uses only two wires, positive and negative. Third terminal of the battery is not used at all. That makes things easier, right?

I quickly disassembled the station. Manufacturer seems to added some weight to get more solid feel to it..

N900’s battery BL-5J. There are two small screws in the plastic head, covered with plastic, you have to do some digging. Also sticker pads¬†needs to be removed before head comes out.

Some wires soldered. Be careful when soldering a Li-Ion battery terminals!

Fitting things together. On the right there is the coil and electronics from DSi’s¬†battery. They are connected by two wire to the BL-5J battery positive and negative terminals.

First tests show that system is working and don’t get heated generally at all.¬†Still, more testing needs to be done. It looks like charging is a bit slow, due¬†the double electronics safety mechanism in the BL-5J and in the¬†wireless charging system.¬† (Maybe I should get more involved with some measurement equipments? :))

Because charging happens directly from battery’s terminals, N900 don’t look like charging, battery graph don’t do that rising thing what it normally do when charging. This should keep in mind, I don’t advise you to put any cables to N900’s micro USB port while this system is connected to you N900.. Maybe¬†there should be¬†a slide switch which¬†disconnect the wireless charging electronics from the phone.

Also station is very picky about the position of the phone on top of it.

If I can get system reliable enough¬†I might try to make some cover for coil’s electronics. This is a spare phone so I don’t have to carry it around and thus there is no hurry. In todo-list there is also a proper power feed for station, right now I feed the thing from PC’s USB port.