Skip navigation

Enchanted Objects

5 Posts authored by: kidiccurus

When subbmiting my application to join this road test, I set myself 4 success citeria:

 

Success Criteria: I will deem the project a success if:

•It can accurately and reliably display the number of messages in my inbox up to 12

•The system can cope with more than 12 messages in a way that does not result in catastrophic failure

•The display can be read in darkness with an LED backlight

•The unit is powered by a single DC wall wart

 

My project has been successful in meeting all four of these criteria. The final version of the multimeter was able to display more messages than expected, and additional messages merely left the needle in the highest position without moving any higher.

The led backlight was also incredibly successful. My original design featured a single blue led to provide illumination due to the requirement to use a motor controller. By hooking the display up to the arduino with resistors I was able to use simple PWM control to manage the display, allowing me to then use an led driver shield to implement an impressive three colour backlight that not only allows the display to be read in darkness, but also provides an additional means of displaying the number of messages. The one failing with the backlight is that it is not quite as bright as I had hoped. Due to space constraints, the LEDs had to be mounted in the case in a way that left them pointing more towards the inside of the case than the top of the display. The backlight is still useable, but the colours are a little less content than I had hoped. However, this shortcoming is partly made up for by the fading effects enabled by the driver shield. Using the shield, I was able to set up a system so that when values on the display changed, the colours of the backlight would neatly fade into the new shade instead of suddenly changing. A similar fade also occurs when the backlight is turned on or off.

  Finally the unit was powered with one dc power brick to the use of a ubec to provide regulated power to the yun. The original idea was to power the unit with a "wall wart" style adapter with the transformer moulded directly into the plug, but I instead opted for a "power brick" unit with the transformer connected to mains via a kettle lead. This makes it fay easier to extend the length of the power cord as the kettle lead can easily be replaced. It also had the advantage of allowing me to recycle a used power adaptor that would otherwise have gone to landfill. The main intention of the "single wallwart" objective was that the unit should not need two plug sockets, so this can be considered a slightly modified objective to better utilise the parts available.

 

My original apapplication also highlighted some areas of the project that appears to potentially be difficult. Theses were:

• Writing the code for the parser

   -Whilst I do have some experience of python, I have only coded something like this once in the past

•Calibrating the pwm

   -I will probably needs a separate program to test pwm values via a serial terminal. I will probably use an arduino Leonardo for this, simply because I feel more confident     using it

•Comunicating between Linux and the Atmega

   -Having never used a Yun, this appears to be one of the challenges specific to the platform

 

Calibrating the PWM turned out to be incredibly easy. The fast upload times of my new Uno board made the use of a serial connection unnecessary, and trial and errror found appropriate values surprisingly quickly. The other two areas were even harder than I expected. IOT is incredibly difficult. The internet is a huge, wonderful resource, but tapping into it can be hard. The yun made the creation of an iot device possible for me, but writing the code for it was incredibly challenging. Plus, it didn't help that the site I was working with had some badly timed issues .

 

I would like to finish this post by thanking all the people who made this project possible.

Thank you to the element 14 staff who arranged this design challenge; your work creates worldwide enthusiasm for electrical engineering and is an excellent opportunity for both aspiring and we'll versed engineers.

Thank you to the network engineers who tracked down the issues with the site and rendered it useable for this project, and sorry about the bad timing.

Thank you to all the people who commented on my posts, you provided rays of inspiration for this project and helped keep me motivated.

Thank you dad for letting me use your multimeter, you can borrow mine if you want.

And finally, thank you Genesis for writing some excellent music for me to listen to whilst working.

 

This project has been an immense journey for me and I am glad that it turned out to be such a success. Once again, my thanks to everyone for making this such a great success.

IMG_20150626_110244.jpg

Today I finished putting the final touches on to the inbox and the code. First of all, the code. Unfortunately, for the past few weeks there has been an intermittent issue with the inbox and activity on the element 14 website. The issue has now been resolved, and was not a major barrier to normal use, but it made prototyping code increasingly difficult as the section of the site the code was trying to observe would fail randomly, making troubleshooting incredibly difficult. As a result of this I was forced to delay writing my code until the site was repaired, hence the rather late nature of this blog post. Eventually I was able to get some python code running to provide the cookies normally seen when logged in to the site and request the HTML of the page. This HTML was then parsed to return just the number of messages in my inbox, and passed this number over to the atmega chip to drive the display to the appropriate value. I made sure that the code waited a full 20 minutes between each time it attempted to check the website. This will ensure that it does not use too much of my internet bandwidth or put an excessive load on element 14s servers.

HTML code featuring the name of my account

/\ Some of my first success with the parser, finding a block of code featuring my account name, also proving the cookies worked

 

After writing the code, the time finally came to mount the circuitry. Installing the display and LEDs was reasonably easy with a little hot glue, and transferring the wiring was simply a case of transferring conditions from the breadboard one at a time. I did however run into some major issues in getting everything to fit into the case. Because of the weight of the various ports on an arduino yun, shields will often not be able to fit onto it properly. My intention was to work around this simply by having the shield at an angle with some pins not fully within the female header. Unfortunately this did not provide a good enough connection in some pins, forcing me to rethink my design. In the end I solved this issue by soldering a second set of male headers directly onto the ones I had already mounted. This effectively gave me double the height and easily allowed me to clear the ports. However, this new set of headers rendered the bord far to thick to fit correctly into the original case. In the end the only way I could solve this problem was by running a ribbon cable from inside the multimeter out to a separate enclosure containing the boards. This worked surprisingly well and the meter was soon up and running.

Two strips of pin headers soldered together

The case I chose for the boards was a cardboard box with a slide off clear colour. When I eventually install this I will try and find a better way to conceal the extra electronics, but for now I thought it would would be better to have them clearly visible for you all to see. With this done the only two parts to add were the voltage regulator for the yun and the switch to turn off the backlight. On my breadboarded version of the circuit I used a tact switch to turn off the backlight when held down. Obviously this is not practice in the actual meter so instead I desoldered one of the original switches from the multimeter circuit board and soldered it in place of the tact switch. Due to the design of the case, the switch would hold itself in place so I did not need to glue it in, allowing me to seperatge the two half's of the case for easy repairs. As for the voltage regulator, I choose to use something called a ubec. Ubecs are switching voltage regulator designed to produce a very low amount of rf noise for rc applications. I choose to use on because they are more efficient than traditional linear regulators. It also helped that I had one in my parts bin. To simplify construction, I attached the two input power lines for the ubec to the 12v power supply simply by soldering them to the underside of the power connector on the led driver board. 5v and ground were connected to appropriate pins on the shield and the whole thing was carefully checked with a multimeter before plugging in the yun. It worked perfectly.

A ubec

The only other addition I made to the board was for photography. Because of the 20 minute delay, filming and photographing the board was going to be a very time consuming process. In order to circumvent this I added two tact switches to pins 2 and 3 using the internal pullups. As in some of the prototypes, these were programmed to increment and decrement the post count allowing me to change the value on the display without having to wait for the system to update. For some additional rigidity glued the switches to a piece of wood. It is important to stress that this was only done for the purpose of photography and is not a required part of the system.

  The system seems to be working fully. I will evaluate the success of the solution against my original specification in a separate post, but for now, here are some posture of the finished unit.

 

IMG_20150626_105827.jpg

/\ The entre setup

 

IMG_20150626_111036.jpg

/\ The inside of the meter

IMG_20150626_110228.jpg

/\ The display in action

Good news, my Yun has arrived. I am not quite ready to move on to the internet side of my project, but it nice to be able to see what I am working with. On the minus side, the Ups shipping notification arrived two days after the Yun, but thankfully I was at home on the day that it arrived so there were no problems with the delivery.

IMG_20150330_092344.jpg

And now onto my progress. Having determined that the screen could be driven from 5v, my first step was to try and power it from the Uno. The minimum safe resistance on the io pins of most Arduinos is around 200 ohms, so to test the display I wired a 220 ohm resistor in series with it, and hooked it up to the Uno. My original plan to test the display was to use a serial terminal to communicate with the Arduino so I could change PWM values on the fly to work out the correct values for this display, but the code I uploaded for a test uploaded so quickly compared to the sketches on my Leonardo that I decided just to use a simple analogue write and change the value and re upload each time. This could damage the chips memory over time, but I wanted to take advantage of this new boards features the first time I used it. Using trial and error, I was able to work out display values to get the screen to work correctly. However, I had to use very low PWM values to the point that I could not get the resolution that I needed. To fix this I added a second 220 ohm resistor in series with the first and changed my PWM values accordingly to get a reasonably accurate display working. In the final design, I will use a single 470 ohm resistor, but at the time I did not feel like rummaging through my part bins for a second time. Using the new PWM values I then created a quick demo programming that moves the dial up through all the values. Some tweaking is still needed but it works reasonably well.

 

Now that I have the display working, it is time to think about my backlight. My original plan was a monochromatic backlight driven by a single PWM pin from the Arduino. However, now that I have moved away from the motor shield, I am able to very easily install the Infineon LED sheild instead. I am going to use the shield to implement a traffic light style indication of the number of posts from the backlight, starting green and moving through to yellow and red. Rather than an RGB led, I am going to use a separate red, green and yellow led. The In fine on shield does not come with headers installed, so I first had to solder these into place. It is worth bearing in mind that no headers are included with the sheild, I had to use the ones from the Arduino starter kit. Nonetheless, breaking apart and soldering on the headers was very quick and easy. I also used some spare headers to attach to create an adaptor to plug the outputs from the sheild into a breadboard, to a low the display to plug into the breadboard, and to add some wires coming off the sheild to more headers so I could still use the display as well as add some buttons. To power the sheild I just cut the end off a twelve volt power brick I had lying around.

  The first issue I had was with downloading the example code. Strangely enough, the download from the official website required running a programming to create the correct folders. As a Linux user, this could have been an issue. Thankfully though, it was able to run under WINE with no issues. My next issue was setting the current limit. I had some issues lowering the current limit from the driver through software. Instead of fighting with code I decided just to use some resistors to ensure the current passing through the LEDs was not to high. This is a bit of a dirty fix, but for a prototype it is not to much of an issue.

  Eventually I was able to modify the example code to the point where I could control the backlight. I then combined this with my previous demo programming and was able to cycle through the values on the dial and backlight. A few more modifications, and I was able to control the values with a pair of buttons. The buttons work through a variable in the code which in the final version will be updated by the number of message in my inbox. I also added the option to deactivate the backlight with a third button, which will be replaced with a switch in the final version. This is so I can have the unit in a bedroom and turn off the backlight to sleep. I have set up the light to go red quite a while before the dial reaches the end of the scale. This mostly because my inbox rarely has more than 6 messages, and I want to try and enjoy the full color spectrum available to the light system.

 

  My next step is going to be working on the code for the internet side of this project. If anyone knows a good way to create the cookies on the Yun to log in to the site so I can parse for the message count, or has another way of getting the message count please leave it in the comments.

The arrival of parcels is always exciting for me. Even if it is just an Amazon box containing an audio cable, I still get a little excited, so naturally, when this arrived at my door, I was VERY excited.

 

IMG_20150319_164745.jpg

The box arrived within a few days of the e-mail telling me that I had been accepted into the challenge. Considering that I am in the UK, this is especially impressive. Naturally, my first reaction was to open everything and lay it out onto my bed (I had just had guests and my desk was still not cleared). Strangely enough, the Arduino proto sheild came in a separate envelope from a UK warehouse in order to ship faster to the UK. It is nice to see that fast shipping is given such a priority. Unfortunately the Gun has not arrived yet, but everything else was included in the box. Also, kudos to Atmel for including a USB cable with the explained board. One of my micro B cables recently suffered some sort of internal failing, leaving it unable to charge my tablet at a reasonable speed. The new one is now a significant part of my cab.

IMG_20150319_164606.jpg

Strangely enough, I have never owned an Uno. My only Arduino up to this point has always been a Leonardo, thanks to the extra IO, reduced cost and keyboard emulation. I was really excited about the ease of use with extra library's and ability to swap chips. What I did not realise was how much faster it would be to upload sketches. Uploading sketches to the Leonardo is not too difficult after the first time, and did not expect the Uno to blow me away in this area. In reality, after the sketch compiled, it would upload several times faster on the Uno. I still like my Leonardo, but the Uno is going to be a valuable addition to my toolkit.


My first stage of testing was to remove the display from the meter's circuitry and hook it up to a 5v power supply to see if the dial would reach full deflection. Thankfully the dial had convenient positive and negative labels for the terminals. I briefly tapped the terminal and the dial immediately went off the scale. This may change my approach to the design for project. It may be possible to commit the motor driver and circuitry from the multimeter and instead drive the dial via a pwm pin from the Arduino via some resistors to limit the current. Of course this depends on the power required to drive the dial and whether the Arduino is capable of supplying the required current. If this is possible, then I may instead use the LED driver I was sent to implement a more interesting backlight.

IMG_20150319_175034.jpg

I also noticed that the cover for the display was held on only with sellotape. This potentially means I could remove the cover and polish out some of the scratches that it has picked up over the years. However, my experiences with polishing plastic have been universally disappointing. If you have any advice on how to polish it, or on any other aspects of the protect, please feel free to leave it in the comments section.


NOTE: My new computer setup is still causing me some issues in producing these blog posts. I will attempt to continue posting from my backup device but expect some delays in posts. Strangely enough, comments are not being impacted.

I would like to start by thanking everyone involved in making this design challenge happen. Things like this are great for the electronics community and are one of the reasons I got insterested in electronics. Thank you.

 

Problem: I don't check my inbox on Element 14 for new messages at regular intervals. This leads to messages either sitting around for a few days or me checking in to find only an empty inbox.

Solution: Repurpose an old analogue rapiest multimeter to display the number of messages in my inbox via the voltage indicator.

IMG_20150302_181900.jpg

/\ fig 1 This is the meter I want to use, along with some objects for scale

IMG_20150302_191520.jpg

/\ fig 2 And here we have a photo of the meters circuitry

 

Hardware Design: The idea is to drive the display using a motor driver board and PWM. Conveniently the meter has a range of about 12 volts so a standard DC wall wart should be fine for powering this This does mean that the device can't display more than 12 messages, but hopefully I will check in regularly enough for this not to be an issue. Any values greater than 12 can easily just be have to be displayed as 12, or alternatively by a needle alternating between 0 and 12. The wall wart could also power the main board of the unit via a voltage regulator. For the main board I intend to use an Arduino Yun. The meter will conveniently operate on DC voltage mode with no power source so powering it will not be an issue. It also features 2 convenient side mounted switches that can easily be used to turn the unit on and off. It may also be worth adding an LED backlight to the unit that can be driven by the Yun and turned off with the other switch.

Post meter design.png

/\ fig 3 A quick visual overview of the hardware. Note that for simplicity, some passive components and the switches and the circuitry from the multimeter have been ommited.

 

Software design: The first stage of software will run on the Linux half of the Yun. Using Python it will regularly load and parse my inbox to find the message count. this will then be passed on to the ATmega. The mega will compare the value it receives to a table of PWM values and then use this to power the motor driver and move the needle to the correct position, or possibly between positions in the case of more than 12 posts, but this will be handled as a special case. The Yun can also drive the backlight with PWM, potentially allowing for either a heartbeat effect or a brightness increasing with message count.

 

Success Criteria: I will deem the project a success if:

•It can accurately and reliably display the number of messages in my inbox up to 12

•The system can cope with more than 12 messages in a way that does not result in catastrophic failure

•The display can be read in darkness with an LED backlight

•The unit is powered by a single DC wall wart

 

Challenges in this project:

• Writing the code for the parser

   -Whilst I do have some experience of python, I have only coded something like this once in the past

•Calibrating the pwm

   -I will probably needs a separate program to test pwm values via a serial terminal. I will probably use an arduino Leonardo for this, simply because I feel more confident     using it

•Comunicating between Linux and the Atmega

   -Having never used a Yun, this appears to be one of the challenges specific to the platform

 

Edit: Apologies for the delay in posting this. I have recently changed my PC and have been having some issues posting. These issues have not yet been resolved, but I am now able to post through another device so updates should now be a little more frequent.