Visitors

Flag Counter

Sunday, October 13, 2019

Further focus on Electonics and Arduino



One thing I wanted to try and see if I could get working was the detection circuit which I had built for my signalling system using the Current Transformers.  So I went ahead and built another Detection Circuit for use with the Arduino UNO.  This will be used as a sensor.

The next step was to get another Arduino MEGA and Arduino Motor Shield, which arrived from the USA last week.  These are the genuine boards.  I downloaded and flashed the MEGA with the DCC++ program so I could now have two sets of DCC Systems, one for the train shed and one for testing pursposes here in my room inside the house.

I would use this system to now build up another arduino program to test detection using the current dectectio circuit I had built.  So, using one of the Analog Pins of the UNO, and setting this as INPUT, I was able to read the voltage on the Serial Monitor which was showing 5v with no detection and more importantly was showing 0v when detection occured, as the 555 timer is configured in bi-stable mode and initially the output of the 555 is set to HIGH.

Using some basic logic in the code I was able to tell the UNO to count the number of these detections.  As I told you in my previous post, I have a circuitous layout and every X loops representing distances between towns/stations, with one loop representing 1 mile. 

Wouldn't it be cool to have the UNO do the counting and then to show via LEDs or a Display where we are on the journey?  This is what I have been aiming to do.

The below two shots show the Voltage output from one of the PINs when there is not detection and when a detection has occurred.

This opens up a new world of interacting with the layout and interfacing this to a microcontroller!



No comments:

Post a Comment

Followers

Blog Archive